系统:CentOS 7.8
Erlang版本:19.0.4
RabbitMQ版本:3.6.14
一、安装 Erlang
1. 下载Erlang
RabbitMQ是基于Erlang语言开发
cd /usr/local/src/
wget http://www.rabbitmq.com/releases/erlang/erlang-19.0.4-1.el7.centos.x86_64.rpm
2. 安装Erlang
rpm -ivh erlang-19.0.4-1.el7.centos.x86_64.rpm
yum -y install erlang
3. 测试Erlang是否安装成功
显示 Erlang (SMP,ASYNC_THREADS,HIPE) (BEAM) emulator version 8.0.3
erl -version
二、安装 RabbitMQ
1. 下载RabbitMQ
- CentOS 7.X
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_6_14/rabbitmq-server-3.6.14-1.el7.noarch.rpm
- CentOS 8.X 可能会版本问题
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.20/rabbitmq-server-3.7.20-1.el7.noarch.rpm
2. 安装rabbitMQ server
yum install rabbitmq-server-3.6.14-1.el7.noarch.rpm
三、查看 RabbitMQ
1. 查看安装的 rabbitmq
yum list | grep rabbitmq
2. 查看状态、启动、停止、重启
systemctl status rabbitmq-server.service
systemctl start rabbitmq-server.service
systemctl stop rabbitmq-server.service
systemctl restart rabbitmq-server.service
3. 查看 RabbitMQ版本
sudo rabbitmqctl status | grep rabbit
四、配置 RabbitMQ后台管理
service rabbitmq-server start
rabbitmqctl start_app
rabbitmq-plugins enable rabbitmq_management
五、配置 RabbitMQ
1. 查看rabbit用户列表
第一列为用户名,第二列为权限
rabbitmqctl list_users
2. 修改密码
rabbitmqctl change_password 用户名 '新密码'
3. 添加用户
rabbitmqctl add_user 用户名 密码
4. 设置权限
rabbitmqctl set_permissions -p "/" 用户名 ".*" ".*" ".*"
5. 设置用户角色
rabbitmqctl set_user_tags 用户名 administrator