1.先安装Erlang
rpm -Uvh http://www.rabbitmq.com/releases/erlang/erlang-18.1-1.el7.centos.x86_64.rpm
2.安装rabbitmq-server
rpm -Uvh http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.6/rabbitmq-server-3.5.6-1.noarch.rpm
查看rabbitmq-server有没有安装好,能查到说明已经安装成功了
rpm -qa|grep rabbitmq
3.开启rabbit-server用以下命令:
service rabbitmq-server start
关掉服务的话用:
service rabbitmq-server stop
用以下命令查看rabbit-server当前状态:
rabbitmqctl status
4.用以下命令安装维护插件:
rabbitmq-plugins enable rabbitmq_management
5.重启
service rabbitmq-server restart
如果Linux安装了桌面,浏览器进入http://localhost:15672/ ,用户名和密码都是guest。外网访问的话需要继续下面的配置
6.添加用户
add_user admin admin
7.设置角色
set_user_tags admin administrator
8.设置权限
set_permissions -p "/" admin ".*" ".*" ".*"
9.防火墙添加15672端口
firewall-cmd --add-port=15672/tcp --permanent
10.防火墙添加5672端口
firewall-cmd --add-port=5672/tcp --permanent
ok,MQ可以用了