RabbitMQ作为专业级消息队列;如何在微服务框架下搭建

使用组件

文档:

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

下载镜像:

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

cd docker-rabbitmq-cluster/cluster
docker-compose up -d

RabbitMQ:Docker环境下搭建rabbitmq集群-LMLPHP

等待下载完成;

会自动构建3个rabbitMQ;

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 ps查看一下容器已经运行;

打开地址:http://192.168.99.100:15672

用户:myuser 密码:mypass

RabbitMQ:Docker环境下搭建rabbitmq集群-LMLPHP

05-07 11:02