English | 简体中文
Deploy a RabbitMQ cluster with one click using docker-compose, including 3 nodes.
- Install docker and docker-compose
- Download this project
git clone https://github.com/hsu1943/rabbitmq-cluster-docker-compose.git
- Configure the environment variables in stack.env Copy a copy of stack.env.example, named stack.env
cp stack.env.example stack.env
Specific configuration:
# RabbitMQ management username and password
RABBITMQ_DEFAULT_USER=admin
RABBITMQ_DEFAULT_PASS=admin
# Shared cookie for RabbitMQ cluster
RABBITMQ_ERLANG_COOKIE=rabbit-cookie
# This directory path
RABBITMQ_PATH=.
- Grant execute permission to the script
chmod +x ./join-cluster.sh
- Start
docker-compose --env-file ./stack.env up -d
Log in to RabbitMQ management: http://localhost:15672, you can see the cluster status of 3 nodes:
This is just a demo for practicing the deployment of rabbitmq multi-node. Please do not use it in your production environment. In the production environment, different nodes should be deployed on different servers to ensure high availability.