CentOS-7.9 安装rabbitmq3.9.11 ,erlang-23.3.4.11
下载所需rpm包 | wget https://github.com/rabbitmq/erlang-rpm/releases/download/v23.3.4.11/erlang-23.3.4.11-1.el7.x86_64.rpm |
wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.9.11/rabbitmq-server-3.9.11-1.el7.noarch.rpm | |
安装 Erlang | sudo rpm -ivh erlang-23.3.4.11-1.el7.x86_64.rpm |
安装 RabbitMQ | sudo rpm -ivh rabbitmq-server-3.9.11-1.el7.noarch.rpm |
# 初始化 RabbitMQ 插件 # 启用管理界面 |
sudo rabbitmq-plugins enable rabbitmq_management |
# 启动 RabbitMQ 服务 | sudo systemctl start rabbitmq-server |
# 设置 RabbitMQ 服务开机启动 | sudo systemctl enable rabbitmq-server |
添加 admin 用户并设置密码 密码根据实际情况修改 第二个admin为密码 | rabbitmqctl add_user admin admin |
添加 admin 用户为administrator角色 | rabbitmqctl set_user_tags admin administrator |
设置 admin 用户的权限,指定允许访问的vhost以及write/read | rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*" |
查看vhost(/)允许哪些用户访问 | rabbitmqctl list_permissions -p / |
查看用户列表 | rabbitmqctl list_users |
删除默认用户guest的访问权限 | sudo rabbitmqctl clear_password guest sudo rabbitmqctl set_user_tags guest "" |
# 开放 5672 和 15672 端口 | sudo firewall-cmd --permanent --add-port=5672/tcp sudo firewall-cmd --permanent --add-port=15672/tcp |
# 重新加载防火墙规则 | sudo firewall-cmd --reload |
# 查看 RabbitMQ 服务状态 | sudo systemctl status rabbitmq-server |
访问mq后台管理 | http://ip:15672 |