Document

centos7安装RabbitMQ教程

 centos7安装RabbitMQ教程

erlang版本:22.2.1

RabbitMQ版本:3.8.2

1、安装Erlang

1.1安装依赖

yum install epel-release

yum install gcc gcc-c++ unixODBC unixODBC-devel wxBase wxGTK SDL wxGTK-gl socat

1.2下载

wget https://packages.erlang-solutions.com/erlang/rpm/centos/7/x86_64/esl-erlang_22.2-1~centos~7_amd64.rpm

rpm -ivh --nodeps esl-erlang_22.2-1~centos~7_amd64.rpm

2、安装RabbitMQ

2.1下载

wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.2/rabbitmq-server-3.8.2-1.el7.noarch.rpm

2.2安装

rpm -ivh --nodeps rabbitmq-server-3.8.2-1.el7.noarch.rpm

3、启动rabbitmq服务

启动|停止|重启

systemctl start rabbitmq-server.service

systemctl stop rabbitmq-server.service

systemctl restart rabbitmq-server.service

添加到开机启动

systemctl enable rabbitmq-server.service

 启动

systemctl start rabbitmq-server

4、安装web插件

rabbitmq-plugins enable rabbitmq_management

页面监控访问地址:  http://host:15672/#/

 

 

 

【说明】

访问登录页面监控需要先创建用户,并授权,请看下面的:用户&授权

 

 

 

 

5、设置账号密码

#user 普通账户

rabbitmqctl add_user user 123456            #新增一个账号

rabbitmqctl set_permissions -p "/" user ".*" ".*" ".*"   #设置用户权限

rabbitmqctl set_user_tags user administrator   #设置用户角色

#admin 管理员账户

rabbitmqctl add_user admin admin123

rabbitmqctl set_user_tags admin administrator

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

#添加、删除虚拟主机

rabbitmqctl add_vhost b2b2c_api

rabbitmqctl delete_vhost b2b2c_api

#设置指定用户在指定虚拟主机上的配置、读、写权限

rabbitmqctl set_permissions -p b2b2c_api user ".*" ".*" ".*"

 

posted @ 2024-03-27 21:52  从未被超越  阅读(5)  评论(0编辑  收藏  举报