Centos 7.2 Install RabbitMQ 3.6.6
Centos 7.2 Install RabbitMQ 3.6.6
环境依赖
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC-devel httpd python-simplejson
下载otp_src
wget http://10.65.255.231/IXCb7261d0152b8aa2ad1f25a55bf0e761f/download/otp_src_19.1.tar.gz
tar -zxvf otp_src_19.1.tar.gz
cd otp_src_19.1
./configure --prefix=/usr/local/erlang --with-ssl -enable-threads -enable-smmp-support -enable-kernel-poll --enable-hipe --without-javac
make
make install
下载rabbitmq
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-generic-unix-3.6.6.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.6.6.tar.xz
mv rabbitmq_server-3.6.6 rabbitmq
配置环境变量
vi /etc/profile
#set erlang environment
export PATH=$PATH:/usr/local/erlang/bin
#set rabbitmq environment
export PATH=$PATH:/rabbitmq/sbin
刷新环境变量
source /etc/profile
测试
cd /usr/erlang/bin
./erl
启动rabbitmq
cd /rabbitmq/sbin
./rabbitmq-server
开启rabbitmq web监控
rabbitmq-plugins enable rabbitmq_management
启动httpd
systemctl start httpd
开机启动httpd
systemctl enable httpd
创建账号
rabbitmqctl add_user user_admin passwd_admin
赋予其administrator角色
rabbitmqctl add_user user_monitoring passwd_monitor
赋予其monitoring角色
rabbitmqctl set_user_tags user_monitoring monitoring
可以创建某个项目的专用用户,只能访问项目自己的virtual hosts
rabbitmqctl add_user user_proj passwd_proj
赋予其monitoring角色
rabbitmqctl set_user_tags user_proj management
创建和赋角色完成后查看并确认
rabbitmqctl list_users