* on 192.168.3.7 ``` scp /var/lib/rabbitmq/.erlang.cookie 192.168.3.8:/var/lib/rabbitmq scp /var/lib/rabbitmq/.erlang.cookie 192.168.3.9:/var/lib/rabbitmq rabbitmqctl stop rabbitmq-server -detached rabbitmqctl stop rabbitmq-server -detached netstat -lntup ``` * on 192.168.3.8 ``` rabbitmqctl stop rabbitmq-server -detached rabbitmqctl stop vi /etc/hosts rabbitmq-server -detached rabbitmqctl stop_app rabbitmqctl join_cluster rabbit@rabbitmq01 rabbitmqctl start_app ``` * on 192.168.3.9 ``` rabbitmqctl stop rabbitmq-server -detached rabbitmqctl stop vi /etc/hosts rabbitmq-server -detached rabbitmqctl stop_app rabbitmqctl join_cluster rabbit@rabbitmq01 rabbitmqctl start_app ``` * on 192.168.3.7 ``` rabbitmqctl set_cluster_name rabbitmq_cluster rabbitmqctl cluster_status rabbitmqctl set_policy ha-all "^ha\." '{"ha-mode":"all"}' ``` ![](https://img.kancloud.cn/89/92/8992ff4a429046165bc338c8efd8d28b_1904x822.png)