我的服务器操作系统版本是Centos7.
-
执行安装命令
传到Linux服务器上,使用rpm -ivh
命令将上边三个进行安装
-
复制配置文件到指定目录下
cp /usr/share/doc/rabbitmq-server-3.7.18/rabbitmq.config.example /etc/rabbitmq/rabbitmq.config
-
修改配置——允许用户从网络上的任何地方访问
vim /etc/rabbitmq/rabbitmq.config
-
启动RabbitMQ中的插件管理
rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@thenie:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@thenie...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
set 3 plugins.
Offline change; changes will take effect at broker restart.
-
启动RabbitMQ的服务
systemctl restart rabbitmq-server
-
查看服务状态
systemctl status rabbitmq-server
启动成功了
-
给RabbitMQ设置远程连接的密码和权限
这样我们才能远程进行登录
[root@rabbitmq1 ebin]
Adding user "admin" ...
[root@rabbitmq1 ebin]
Setting permissions for user "admin" in vhost "/" ...
[root@rabbitmq1 ebin]
Setting tags for user "admin" to [administrator] ...
-
开启防火墙端口号
firewall-cmd --zone=public --add-port=15672/tcp --permanent
-
重启防火墙
systemctl restart firewalld.service
-
开启安全组规则
如果是阿里云的服务器,还要在官网开启安全组规则