.erlang.cookie 100% 20 19.6KB/s 00:00
[root@mq04 rabbitmq]# chmod 400 .erlang.cookie
[root@mq04 rabbitmq]# chown -R rabbitmq:rabbitmq .erlang.cookie
[root@mq04 rabbitmq]# service rabbitmq-server start
Redirecting to /bin/systemctl start rabbitmq-server.service
[root@mq04 rabbitmq]# rabbitmqctl stop_app
Stopping rabbit application on node mq04@mq04 ...
[root@mq04 rabbitmq]# rabbitmqctl reset
Resetting node mq04@mq04 ...
对于阿里云ECS一定要在安全组先临时开启15672、25672、5672、4369端口
[root@node173 network-scripts]# rabbitmqctl join_cluster mq171@node171
Clustering node mq_173@node173 with mq171@node171
[root@node173 network-scripts]# rabbitmqctl start_app
Starting node mq_173@node173 ...
completed with 3 plugins.
3. 然后再将B集群中的node174机器加入到集群A中
使用上面同样的方法,将node174加入到集群中去
4.剔除集群A中的node171、node172机器
Node172上执行
[root@mq02 rabbitmq]# rabbitmqctl stop_app
Stopping rabbit application on node mq02@mq02 ...
[root@mq02 rabbitmq]# service rabbitmq-server stop
Redirecting to /bin/systemctl stop rabbitmq-server.service
[root@mq02 rabbitmq]# cp -rf /var/lib/rabbitmq /var/lib/rabbitmq.bak
[root@mq02 rabbitmq]# service rabbitmq-server start
Redirecting to /bin/systemctl start rabbitmq-server.service
[root@mq02 rabbitmq]# rabbitmqctl stop_app
Stopping rabbit application on node mq02@mq02 ...
[root@mq02 rabbitmq]# rabbitmqctl reset
Resetting node mq02@mq02 ...
同样的node171上执行同样的命令
对于采用镜像队列集群,此方案可行
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx