消息队列有很多,rabbitmq redis gearman….
至于为什么选择rabbitmq,这个一时半会儿也难说清楚,现在就记录一下rabbitmq的安装过程吧
首先要知道rabbitmq是用erlang语言开发的。
1.安装erlang,参考网址https://www.erlang-solutions.com/resources/download.html
1
2
| wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm |
wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
1
| rpm --import https://packages.erlang-solutions.com/rpm/erlang_solutions.asc |
rpm --import https://packages.erlang-solutions.com/rpm/erlang_solutions.asc
1
2
| vi /etc/yum.repos.d/erlang_solutions.repo
#gpgcheck=0 修改为 gpgcheck=1 |
vi /etc/yum.repos.d/erlang_solutions.repo
#gpgcheck=0 修改为 gpgcheck=1
1
| sudo yum install erlang |
sudo yum install erlang
2.安装socat
1
| wget --no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo -O /etc/yum.repos.d/convirt.repo |
wget --no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo -O /etc/yum.repos.d/convirt.repo
3.安装rabbitmq,参考网址http://www.rabbitmq.com/install-rpm.html
1
2
| wget https://dl.bintray.com/rabbitmq/rabbitmq-server-rpm/rabbitmq-server-3.6.12-1.el6.noarch.rpm
rpm -ivh rabbitmq-server-3.6.12-1.el6.noarch.rpm |
wget https://dl.bintray.com/rabbitmq/rabbitmq-server-rpm/rabbitmq-server-3.6.12-1.el6.noarch.rpm
rpm -ivh rabbitmq-server-3.6.12-1.el6.noarch.rpm
4.启动服务,
1
| /sbin/service rabbitmq-server start |
/sbin/service rabbitmq-server start
5.开启web管理
1
| rabbitmq-plugins enable rabbitmq_management |
rabbitmq-plugins enable rabbitmq_management