Do you want to deploy RabbitMQ as micro services in multiple virtual machines? Do you want the freedom to launch a RabbitMQ Docker container in any cloud, any infrastructure? Then my friend, you’re in the right place. Read on to find out how.
In ElasticBox, you can deploy a RabbitMQ Docker container out of a box.
RabbitMQ, as you may already know, is an open source message queuing system based on the AMQP standard. RabbitMQ allows application components and services to talk to each other over a variety of protocols. As we shared before, you can configure RabbitMQ as a cluster or as a federation to queue and route messages.
In this post, I’m going to show you how I define and deploy a RabbitMQ Docker container using ElasticBox.
Defining a RabbitMQ Docker container
- On the Boxes page in ElasticBox, I select a pre-defined Docker RabbitMQ box. To get this box, contact me.
- In the Docker box, I edit the Dockerfile to customize it. To deploy the RabbitMQ container, in the Dockerfile, I configure the upstart command to not start RabbitMQ after installing. I add instructions to install RabbitMQ, and define an endpoint to start the RabbitMQ server. I expose some ports to access RabbitMQ components.
- Since I need files like a RabbitMQ public key and an upstart policy to install the messaging server in a container, I add those as file variables to the box. Then I use the ADD Docker instruction to store them in the container.
Launching a RabbitMQ Docker container
I’m all set here, so I click Deploy. In a deployment profile, I pick the options that create the virtual machine to host the container. These include the cloud provider, datacenter, number of instances, network, firewall rules, and RabbitMQ server ports. After I save the profile, I deploy the container.
As you’ll see, ElasticBox starts deploying the Docker container in a virtual machine in the cloud provider I select. That’s pretty much it! You now have your own RabbitMQ Docker container alive within minutes.
Testing RabbitMQ in the Docker container
To make sure that the RabbitMQ server is up and ready, I go to the instance page and from the Docker instance Endpoints tab, I use the expose_15672 endpoint to access the RabbitMQ management dashboard like this:
Optionally, I can SSH into the instance and type “$ docker ps” that outputs a list of running RabbitMQ containers.