1.下载安装包
rabbitmq:https://packagecloud.io/rabbitmq/rabbitmq-server/packages/el/7/rabbitmq-server-3.8.16-1.el7.noarch.rpm/download.rpm?distro_version_id=140
erlang:https://packagecloud.io/rabbitmq/erlang/packages/el/7/erlang-23.3.4.11-1.el7.x86_64.rpm/download.rpm?distro_version_id=140
2.安装
2.1安装Erlang
rpm -ivh erlang-23.3.4.11-1.el7.x86_64.rpm
2.2安装socat插件
yum install socat -y
2.3安装rabbitmq
rpm -ivh rabbitmq-server-3.8.16-1.el7.noarch.rpm
开机自启:
chkconfig rabbitmq-server.service on
启动rabbitmq
systemctl start rabbitmq-server.service
查看rabbitmq
systemctl status rabbitmq-server.service
停止rabbitmq
systemctl stop rabbitmq-server.service
2.4开启web管理软件
rabbitmq-plugins enable rabbitmq_management
访问地址:http://ip:15672/
如果访问不了,可查看防火墙是否关闭,或者防火墙开放15672端口
1.关闭防火墙
systemctl stop firewalld
开机自关闭防火墙
systemctl disable firewalld
2.开放端口
firewall-cmd --permanent --zone=public --add-port=15672/tcp
firewall-cmd --reload
3添加用户以及赋权
3.1创建账号
rabbitmqctl add_user admin admin
3.2设置用户角色
rabbitmqctl set_user_tags admin administrator
3.3设置用户权限
rabbitmqctl set_permissions [-p <vhostpath>] <user> <conf> <write> <read>
用户admin 具有路径为"/"的vhost所有的的配置读写权限
rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
3.4查看用户和角色
rabbitmqctl list_users