CentOS 8.2 下安装 RabbitMQ 3.8.5
作者:
大仙出游 | 来源:发表于
2019-11-07 16:45 被阅读0次
#服务器IP地址为:192.168.31.100/24/1
#三个文件,自行下载
https://packagecloud.io/rabbitmq/erlang/packages/el/8/erlang-23.0.3-1.el8.x86_64.rpm
http://mirror.centos.org/centos/8/AppStream/x86_64/os/Packages/socat-1.7.3.3-2.el8.x86_64.rpm
https://packagecloud.io/rabbitmq/rabbitmq-server/packages/el/8/rabbitmq-server-3.8.5-1.el8.noarch.rpm
依次安装
dnf install -y erlang-23.0.3-1.el8.x86_64.rpm
dnf install -y socat-1.7.3.3-2.el8.x86_64.rpm
dnf install -y rabbitmq-server-3.8.5-1.el8.noarch.rpm
#创建以下文件,否则无法启动
vi /etc/rabbitmq/rabbitmq-env.conf
内容为:NODENAME=rabbitmq@localhost
#添加端口
firewall-cmd --add-port=1883/tcp --permanent
firewall-cmd --add-port=5672/tcp --permanent
firewall-cmd --add-port=15672/tcp --permanent
#重新加载配置
firewall-cmd --reload
#防火墙启动关闭
systemctl start firewalld
#systemctl stop firewalld
#systemctl restart firewalld
systemctl enable firewalld
#查看防火墙端口列表
firewall-cmd --permanent --list-port
#启动服务
systemctl start rabbitmq-server
#查看服务状态
#systemctl status rabbitmq-server
#停止服务
#systemctl stop rabbitmq-server
#重启服务
#systemctl restart rabbitmq-server
#设置为开机启动
systemctl enable rabbitmq-server
#添加插件
rabbitmq-plugins enable rabbitmq_management
rabbitmq-plugins enable rabbitmq_mqtt
rabbitmq-plugins enable rabbitmq_web_mqtt
#不能远程web访问的解决办法
# 查看当前所有用户
sudo rabbitmqctl list_users
# 由于RabbitMQ默认的账号用户名和密码都是guest。为了安全起见, 先删掉默认用户
#sudo rabbitmqctl delete_user guest
# 添加新用户 root 密码 root
sudo rabbitmqctl add_user root root
# 设置用户tag
sudo rabbitmqctl set_user_tags root administrator
# 赋予用户默认vhost的全部操作权限
sudo rabbitmqctl set_permissions -p / root ".*" ".*" ".*"
# 查看用户的权限
sudo rabbitmqctl list_user_permissions root
#重启
systemctl restart rabbitmq-server
远程访问:http://192.168.31.100:15672
登录信息:root/root
本文标题:CentOS 8.2 下安装 RabbitMQ 3.8.5
本文链接:https://www.haomeiwen.com/subject/aouvbctx.html
网友评论