9

Linux 下 RabbitMQ的安装

 3 years ago
source link: https://blog.csdn.net/weixin_45884459/article/details/111882417
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Linux 下 RabbitMQ的安装

安装RabbitMQ

1 配置语言环境

1.1 卸载旧版本

查看安装的erlang :# yum list | grep erlang
卸载旧版本:# yum -y remove [要卸载的版本]
示例:
在这里插入图片描述

1.2 准备文件

将说明文件提供的文件上传至:/data_disk/rabbitmq

1.3 安装erlang

切换目录至/data_disk/rabbitmq执行以下命令:

# rpm -Uvh erlang-21.2.3-1.el7.centos.x86_64.rpm

1.4 安装socat

# yum install -y socat

2 正式安装

2.1 卸载旧版本

查看安装的erlang :# yum list | grep rabbitmq
卸载旧版本:# yum -y remove [要卸载的版本]
示例:
在这里插入图片描述

2.2 准备文件

将本教程提供的文件上传至:/data_disk/rabbitmq

2.3 安装

切换至目录/data_disk/rabbitmq,执行命令:

# rpm -Uvh rabbitmq-server-3.7.9-1.el7.noarch.rpm

2.4 创建配置文件

跳转目录:# cd /etc/rabbitmq/
创建文件:# vim rabbitmq-env.conf
添加内容:NODENAME=rabbit@localhost

2.5 相关命令

启动服务:# systemctl start rabbitmq-server
查看状态:# systemctl status rabbitmq-server
停止服务:# systemctl stop rabbitmq-server

2.6 相关配置

• 设置开机启动:# systemctl enable rabbitmq-server
• 开启Web管理插件:# rabbitmq-plugins enable rabbitmq_management
• 添加用户:# rabbitmqctl add_user admin admin
• 为用户分配操作权限:# rabbitmqctl set_user_tags admin administrator
• 为用户分配资源权限:# rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

3 防火墙设置

• 若服务器开启了防火墙,需要将RabbitMQ要用的端口开放

# firewall-cmd --zone=public --add-port=4369/tcp --permanent
# firewall-cmd --zone=public --add-port=5672/tcp --permanent
# firewall-cmd --zone=public --add-port=25672/tcp --permanent
# firewall-cmd --zone=public --add-port=15672/tcp --permanent

• 重启防火墙:# firewall-cmd --reload

输入服务器地址+端口(15672),看得登陆页面,输入账户:admin admin进行登陆即可
效果:
在这里插入图片描述

本教程使用的erlang:erlang-21.2.3-1.el7.centos.x86_64
本教程使用的rabbitmq:rabbitmq-server-3.7.9-1.el7.noarch
下载地址:百度云提取码:1234
另:rabbitmq与erlang的版本匹配关系

6 参考文献

RabbitMQ安装卸载旧版本
服务启动报错纠正方案1:添加配置文件
服务启动报错纠正方案2:删除部分权限文件


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK