docker搭建rabbitmq集群环境的方法

时间:2021-05-19

本文主要讲述如何用docker搭建rabbitmq的集群。分享给大家,希望此文章对各位有所帮助。

下载镜像

采用bijukunjummen该镜像。

git clone https://github.com/bijukunjummen/docker-rabbitmq-cluster.git

运行

启动集群

cd docker-rabbitmq-cluster/clusterdocker-compose up -d......Status: Downloaded newer image for bijukunjummen/rabbitmq-server:latestdocker.io/bijukunjummen/rabbitmq-server: this image was pulled from a legacy registry. Important: This registry version will not be supported in future versions of docker.Creating cluster_rabbit1_1Creating cluster_rabbit2_1Creating cluster_rabbit3_1

默认启动了三个节点

rabbit1: image: bijukunjummen/rabbitmq-server hostname: rabbit1 ports: - "5672:5672" - "15672:15672"rabbit2: image: bijukunjummen/rabbitmq-server hostname: rabbit2 links: - rabbit1 environment: - CLUSTERED=true - CLUSTER_WITH=rabbit1 - RAM_NODE=true ports: - "5673:5672" - "15673:15672"rabbit3: image: bijukunjummen/rabbitmq-server hostname: rabbit3 links: - rabbit1 - rabbit2 environment: - CLUSTERED=true - CLUSTER_WITH=rabbit1 ports: - "5674:5672"

查看

docker@default:~$ docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESba5f665bb213 bijukunjummen/rabbitmq-server "/bin/sh -c /opt/rabb" 10 minutes ago Up 10 minutes 4369/tcp, 9100-9105/tcp, 15672/tcp, 25672/tcp, 0.0.0.0:5674->5672/tcp cluster_rabbit3_1b9466e206b2b bijukunjummen/rabbitmq-server "/bin/sh -c /opt/rabb" 10 minutes ago Up 10 minutes 4369/tcp, 9100-9105/tcp, 25672/tcp, 0.0.0.0:5673->5672/tcp, 0.0.0.0:15673->15672/tcp cluster_rabbit2_1b733201aeadf bijukunjummen/rabbitmq-server "/bin/sh -c /opt/rabb" 10 minutes ago Up 10 minutes 4369/tcp, 0.0.0.0:5672->5672/tcp, 9100-9105/tcp, 0.0.0.0:15672->15672/tcp, 25672/tcp cluster_rabbit1_188196436c434 daocloud.io/daocloud/daomonit "/usr/local/bin/daomo" 37 hours ago Up 2 hours daomonit

访问

http://192.168.99.100:15672,弹出登陆界面

输入guest/guest

参考

docker-rabbitmq-cluster

tutum/rabbitmq

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章