1. 程式人生 > >CentOS6.7 RabbitMQ的安裝和配置

CentOS6.7 RabbitMQ的安裝和配置

我這裡以3.5.6為例

一:RabbitMQ的安裝

首先,下載RabbitMQ

wget https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_5_6/rabbitmq-server-3.5.6-1.noarch.rpm

先安裝epel-release,否則無法安裝erlang

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm

然後,安裝erlang

yum install erlang

最後,安裝RabbitMQ

rpm -ivh rabbitmq-server-3.5.6-1.noarch.rpm

二:RabbitMQ的配置

1:新建使用者 (使用者名稱和密碼是admin/admin)

rabbitmqctl add_user admin admin

2:設定tag

rabbitmqctl set_user_tags admin administrator

3:設定許可權

rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"

三:配置RabbitMQ web管理外掛

rabbitmq-plugins enable rabbitmq_management

訪問url 

http://127.0.0.1:15672

四:RabbitMQ 的啟動與關閉

/etc/init.d/rabbitmq-server stop 
/etc/init.d/rabbitmq-server start
/etc/init.d/rabbitmq-server restart