如果网速慢 可以直接到百度云分享中下载,然后拉到centerOS中,进行第二步即可 两个人安装包地址,提取码:z1oz
1、安装erlang环境
wget http://www.rabbitmq.com/releases/erlang/erlang-19.0.4-1.el7.centos.x86_64.rpm
rpm -ivh erlang-19.0.4-1.el7.centos.x86_64.rpm
2、安装rabbitmq
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el7.noarch.rpm
yum install rabbitmq-server-3.6.6-1.el7.noarch.rpm
3、启动rabbitmq服务,并查看运行状态
service rabbitmq-server start service rabbitmq-server status
4、开启防火墙15672端口
firewall-cmd --zone=public --add-port=15672/tcp --permanent firewall-cmd --reload
5、修改rabbitmq.conf,使外部可以访问
cp /usr/share/doc/rabbitmq-server-3.6.6/rabbitmq.config.example /etc/rabbitmq/rabbitmq.config 进入rabbit文件夹下:cd /etc/rabbitmq 修改rabbitmq.config文件,使外部可以访问;vim rabbitmq.config 删除第64行的两个%和后面的逗号(注意最后的逗号)
修改rabbitma.config文件,打开5672端口,不然项目中无法远程链接
service rabbitmq-server restart
6、 添加用户
rabbitmqctl add_user lc lc 添加用户 rabbitmqctl set_permissions -p "/" lc ".*" ".*" ".*" 权限设置 rabbitmqctl set_user_tags lc administrator 修改角色
add_user <UserName> <Password> 添加用户
delete_user <UserName> 删除用户
change_password <UserName> <NewPassword> 修改密码
list_users 查看已有用户
add_vhost <VHostPath>
delete_vhost <VHostPath>
list_vhostsset_permissions [-p <VHostPath>] <UserName> <Regexp> <Regexp> <Regexp>
clear_permissions [-p <VHostPath>] <UserName>
list_permissions [-p <VHostPath>]
list_user_permissions <UserName>
list_queues [-p <VHostPath>] [<QueueInfoItem> ...]
list_exchanges [-p <VHostPath>] [<ExchangeInfoItem> ...]
list_bindings [-p <VHostPath>]
list_connections [<ConnectionInfoItem> ...]
原文地址:https://www.cnblogs.com/AbnerLc/p/12057552.html