docker私有网络集群

docker network create rabbitmqnet





docker run -d --name=rabbitmq1 -p 5673:5672 -p 15673:15672 -e RABBITMQ_NODENAME=rabbitmq1 -e RABBITMQ_ERLANG_COOKIE='SBZMNTLRSPESWGBEPRDS'  -h rabbitmq1 --net=rabbitmqnet  rabbitmq:3-management



docker run -d --name=rabbitmq2 -p 5674:5672 -p 15674:15672 -e RABBITMQ_NODENAME=rabbitmq2 -e RABBITMQ_ERLANG_COOKIE='SBZMNTLRSPESWGBEPRDS'  -h rabbitmq2 --net=rabbitmqnet  rabbitmq:3-management



docker run -d --name=rabbitmq3 -p 5675:5672 -p 15675:15672 -e RABBITMQ_NODENAME=rabbitmq3 -e RABBITMQ_ERLANG_COOKIE='SBZMNTLRSPESWGBEPRDS'  -h rabbitmq3 --net=rabbitmqnet  rabbitmq:3-management





docker exec rabbitmq2 bash -c  "rabbitmqctl stop_app && rabbitmqctl reset && rabbitmqctl join_cluster  --ram rabbitmq1@rabbitmq1 && rabbitmqctl start_app"





docker exec rabbitmq3 bash -c "rabbitmqctl stop_app && rabbitmqctl reset && rabbitmqctl join_cluster --ram rabbitmq1@rabbitmq1 && rabbitmqctl start_app"



docker exec rabbitmq1 bash -c  "rabbitmqctl forget_cluster_node rabbitmq3@rabbitmq3"

Author:

发表评论

电子邮件地址不会被公开。 必填项已用*标注