Steps to form rabbitmq cluster
- Run following containers to spawn three independent rabbitmq containers
docker-compose up
- Get the containers references using following command
docker ps
- Exec into rabbitmq containers
docker exec -it {rabbitmq conatiner reference} bash
- Check the status of cluster in each of the containers
rabbitmqctl cluster_status
each of the conatiner must have only itself one node in their cluster
- Pick one of the containers, stop the rabbitmq app, reset the state of the node and join the cluster of some other node
rabbitmqctl stop_app
rabbitmqctl reset
rabbitmqctl join_cluster rabbit_one@rabbit_one //example
-
Check the status of cluster in each of the containers
-
Follow the step 5 for remaining container as well.