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-12-20Docker部署资料:新手入门教程
- 2024-12-19Docker部署实战:新手入门教程
- 2024-12-19Docker部署教程:新手入门详解
- 2024-12-09云原生周刊:在Docker上部署大语言模型
- 2024-12-05Docker教程:新手快速入门指南
- 2024-12-05Docker项目实战:新手教程与案例解析
- 2024-12-04Docker入门教程:快速掌握基础操作
- 2024-12-04Docker入门教程:轻松搭建你的第一个容器化应用
- 2024-12-04Docker-Compose 入门教程:全面解析基础命令与应用场景
- 2024-12-04Docker入门:新手必读的简单教程