rabbitMQ集群
1.一台主机启动多个rabbitMQ 伪集群
- 停止rabbitMQ服务
[root@MiWiFi-RA72-srv ~]# service rabbitmq-server stop
- (1)开启第一个节点
[root@MiWiFi-RA72-srv ~]# RABBITMQ_NODE_PORT=5673 RABBITMQ_NODENAME=rabbit1 rabbitmq-server start
## ##
## ## RabbitMQ 3.7.17. Copyright (C) 2007-2019 Pivotal Software, Inc.
########## Licensed under the MPL. See https://www.rabbitmq.com/
###### ##
########## Logs: /var/log/rabbitmq/rabbit1.log
/var/log/rabbitmq/rabbit1_upgrade.log
Starting broker...
completed with 3 plugins.
(2)开启第二个节点
[root@MiWiFi-RA72-srv ~]# RABBITMQ_NODE_PORT=5674 RABBITMQ_SERVER_START_ARGS="-rabbitmq_management listener [{port,15674}]" RABBITMQ_NODENAME=rabbit2 rabbitmq-server start
## ##
## ## RabbitMQ 3.7.17. Copyright (C) 2007-2019 Pivotal Software, Inc.
########## Licensed under the MPL. See https://www.rabbitmq.com/
###### ##
########## Logs: /var/log/rabbitmq/rabbit2.log
/var/log/rabbitmq/rabbit2_upgrade.log
Starting broker...
completed with 3 plugins.
设置主从关系
rabbit1操作作为主节点
# 停止rabbit1
[root@MiWiFi-RA72-srv ~