1、mq安装:

2、镜像集群:https://blog.51cto.com/u_15477117/4905546

注意镜像集群修改主机名称后需要重新连接,才可以生效;

RabbitMQ相关_IP

 

过程中相关命令参考: 
--------------------------------------------------------
firewall-cmd --zone=public --add-port=4369/tcp --permanent
firewall-cmd --zone=public --add-port=5672/tcp --permanent
firewall-cmd --zone=public --add-port=15672/tcp --permanent
firewall-cmd --zone=public --add-port=25672/tcp --permanent
--------------------------------------------------------
iptables -A INPUT -s <IP> -j ACCEPT --互加ip,举例:iptables -A INPUT -s 192.xxx.x.xx -j ACCEPT

// 允许ip访问9002端口,在主从互加ip
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="ip" port protocol="tcp" port="5672" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="ip" port protocol="tcp" port="15672" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="ip" port protocol="tcp" port="25672" accept"

//重新载入一下防火墙设置,使设置生效
firewall-cmd --reload
//查看已设置规则
firewall-cmd --zone=public --list-rich-rules
--------------------------------------------------------
sudo hostnamectl set-hostname masterInlet
sudo hostnamectl set-hostname slaveInlet

192.xxx.x.x  masterinlet
192.xxx.x.x  slaveinlet

查看主机名:hostnamectl
--------------------------------------------------------
sudo scp -o StrictHostKeyChecking=no root@10.10.101.78:/var/lib/rabbitmq/.erlang.cookie /var/lib/rabbitmq/

sudo rabbitmqctl join_cluster rabbit@masterinlet
--------------------------------------------------------

end