谷粒商城创建Rabbitmq集群(二十六)
369、集群-RabbitMQ-镜像集群搭建
docker run -d --hostname rabbitmq01 --name rabbitmq01 -v /mydata/rabbitmq/rabbitmq01:/var/lib/rabbitmq -p 15672:15672 -p 5672:5672 -e RABBITMQ_ERLANG_COOKIE=‘dalianpai‘ rabbitmq:management [ ~]# docker run -d --hostname rabbitmq02 --name rabbitmq02 -v /mydata/rabbitmq/rabbitmq02:/var/lib/rabbitmq -p 15674:15672 -p 5674:5672 -e RABBITMQ_ERLANG_COOKIE=‘dalianpai‘ --link rabbitmq01:rabbitmq01 rabbitmq:management ae25c092e6f5cadd37f8ac6b4ed76aaab04a43605aaf3d739d8e053148b8cf4c You have mail in /var/spool/mail/root [ mail]# docker run -d --hostname rabbitmq03 --name rabbitmq03 -v /mydata/rabbitmq/rabbitmq03:/var/lib/rabbitmq -p 15675:15672 -p 5675:5672 -e RABBITMQ_ERLANG_COOKIE=‘dalianpai‘ --link rabbitmq01:rabbitmq01 --link rabbitmq02:rabbitmq02 rabbitmq:management 2ca59e853b3908f0e368bf7f3ce8368b6e180993169b6ab388d5056a8a5535a0 [ mail]# docker ps -a [ mail]# docker exec -it rabbitmq01 /bin/bash :/# rabbitmqctl stop_app Stopping rabbit application on node ... :/# rabbitmqctl reset Resetting node ... :/# rabbitmqctl start_app Starting node ... :/# [ mail]# docker exec -it rabbitmq02 /bin/bash :/# rabbitmqctl stop_app Stopping rabbit application on node ... :/# rabbitmqctl reset Resetting node ... :/# rabbitmqctl join_cluster --ram Clustering node with :/# rabbitmqctl start_app Starting node ... :/# exit exit [ mail]# docker exec -it rabbitmq03 /bin/bash :/# rabbitmqctl stop_app Stopping rabbit application on node ... :/# rabbitmqctl reset Resetting node ... :/# rabbitmqctl join_cluster --ram Clustering node with :/# rabbitmqctl start_app Starting node ... :/# exit exit [ mail]# [ mail]# docker exec -it rabbitmq01 /bin/bash :/# rabbitmqctl set_policy -p / ha "^" ‘{"ha-mode":"all","ha-sync-mode":"automatic"}‘ Setting policy "ha" for pattern "^" to "{"ha-mode":"all","ha-sync-mode":"automatic"}" with priority "0" for vhost "/" ... :/# rabbitmqctl list_policies -p / Listing policies for vhost "/" ... vhost name pattern apply-to definition priority / ha ^ all {"ha-mode":"all","ha-sync-mode":"automatic"}
相关推荐
boneix 2020-10-21
seanzed 2020-10-15
ifconfig 2020-10-14
学留痕 2020-09-20
往后余生 2020-09-17
kka 2020-09-14
redis 2020-09-07
lzccheng 2020-09-06
soyo 2020-08-31
stonerkuang 2020-08-18
LxyPython 2020-08-17
raksmart0 2020-08-17
Lzs 2020-08-14
MrHaoNan 2020-07-31
80530895 2020-07-05
lengyu0 2020-06-28
YarnSup 2020-06-28
huanglianhuabj00 2020-06-27