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-14Docker端口:你真的公开了哪些东西?
- 2024-11-14用DOCKER在家里的实验室里搞些酷炫的玩意儿
- 2024-11-05掌握Docker:高效安全的十大最佳实践
- 2024-11-05在 Docker Compose 中怎么设置端口映射-icode9专业技术文章分享
- 2024-11-05在 Docker Compose 中怎么设置环境变量-icode9专业技术文章分享
- 2024-11-04Docker环境部署项目实战:新手入门教程
- 2024-11-04Docker环境部署资料:新手入门教程
- 2024-11-01Docker环境部署教程:新手入门指南
- 2024-11-01超越Docker:苹果芯片上的模拟、编排和虚拟化方案讲解
- 2024-11-01Docker环境部署:新手入门教程