Home » DevOps » Docker RabbitMQ cluster

About Biju Kunjummen

Biju Kunjummen

Docker RabbitMQ cluster

I have been trying to create a Docker based RabbitMQ cluster on and off for sometime and got it working today – fairly basic and flaky but could be a good starting point for others to improve on.

This is how the sample cluster looks on my machine, this is a typical cluster described in the RabbitMQ clustering guide available here -https://www.rabbitmq.com/clustering.html. As recommended at the site, there are 2 disk based nodes and 1 RAM based node here.


To quickly replicate this, you only need to have fig in your machine, just create a fig.yml file with the following entry:

  image: bijukunjummen/rabbitmq-server
  hostname: rabbit1
    - "5672:5672"
    - "15672:15672"

  image: bijukunjummen/rabbitmq-server
  hostname: rabbit2
    - rabbit1
   - CLUSTERED=true
   - CLUSTER_WITH=rabbit1
   - RAM_NODE=true

  image: bijukunjummen/rabbitmq-server
  hostname: rabbit3
    - rabbit1
    - rabbit2
   - CLUSTERED=true
   - CLUSTER_WITH=rabbit1

and in the folder holding this file, run:

fig up

That is it!, the entire cluster should come up. If you need more nodes, just modify the fig.yml file.

The docker files for creating the dockerized rabbitmq-server is available at my github repo here: https://github.com/bijukunjummen/docker-rabbitmq-cluster and the “rabbitmq-server” image itself is here at the docker hub.


Reference: Docker RabbitMQ cluster from our JCG partner Biju Kunjummen at the all and sundry blog.
(0 rating, 0 votes)
You need to be a registered member to rate this.
Start the discussion Views Tweet it!
Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Inline Feedbacks
View all comments