Deployment Of RabbitMQ Cluster Within Docker
2021/7/26 23:05:45
本文主要是介绍Deployment Of RabbitMQ Cluster Within Docker,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1. install RabbitMQ by pulling images of RabbitMQ
#docker pull rabbitmq:management
2. create network
#docker network create rabbtimanet
3. create 3 sections
rabbitmq1:
docker run -d --name=rabbitmq1 -p 5672:5672 -p 15672:15672 -e RABBITMQ_NODENAME=rabbitmq1 -e RABBITMQ_ERLANG_COOKIE='YZSDHWMFSMKEMBDHSGGZ' -h rabbitmq1 --net=rabbtimanet rabbitmq:management
rabbitmq2:
docker run -d --name=rabbitmq2 -p 5673:5672 -p 15673:15672 -e RABBITMQ_NODENAME=rabbitmq2 -e RABBITMQ_ERLANG_COOKIE='YZSDHWMFSMKEMBDHSGGZ' -h rabbitmq2 --net=rabbtimanet rabbitmq:management
rabbitmq3:
docker run -d --name=rabbitmq3 -p 5674:5672 -p 15674:15672 -e RABBITMQ_NODENAME=rabbitmq3 -e RABBITMQ_ERLANG_COOKIE='YZSDHWMFSMKEMBDHSGGZ' -h rabbitmq3 --net=rabbtimanet rabbitmq:management
4. add to cluster
#docker exec -it 247e80f63f88 bash
#rabbitmqctl stop_app
#rabbitmqctl reset
#rabbitmqctl join_cluster --ram rabbitmq1@rabbitmq1
#rabbitmqctl start_app
#exit
#docker exec -it c94262eb82dd bash
#rabbitmqctl stop_app
#rabbitmqctl reset
#rabbitmqctl join_cluster --ram rabbitmq1@rabbitmq1
#rabbitmqctl start_app
#exit
5. testing -> add one piece of data to each node, the data will sync to each other
这篇关于Deployment Of RabbitMQ Cluster Within Docker的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-19Docker-Compose容器集群化项目实战:新手入门指南
- 2024-11-19Docker镜像仓库项目实战:新手入门教程
- 2024-11-19Docker容器化部署项目实战:新手入门教程
- 2024-11-19Docker-Compose容器集群化资料入门教程
- 2024-11-19Docker镜像仓库资料详解:新手入门教程
- 2024-11-19Docker容器化部署资料:新手入门指南
- 2024-11-19Docker-Compose容器集群化教程:从入门到实践
- 2024-11-19Docker镜像仓库教程:新手入门指南
- 2024-11-19Docker容器化部署教程:初学者指南
- 2024-11-18Docker-Compose容器集群化入门教程