Over a million developers have joined DZone.

Creating a RabbitMQ Cluster on a Single Machine

DZone's Guide to

Creating a RabbitMQ Cluster on a Single Machine

Learn more about installing a cluster on a single machine and how to add more nodes to your cluster.

· Integration Zone
Free Resource

Learn how API management supports better integration in Achieving Enterprise Agility with Microservices and API Management, brought to you in partnership with 3scale

If you are having problems setting up a cluster on a single machine, then the following post might help answer some questions. I assume that you have already set up RabbitMQ on your local machine (rabbit@localhost) and want to know how to add two more nodes and cluster them.

These instructions relate to installation on a MacBook Pro running OS X Yosemite.

As you already have an installation of RabbitMQ. all you need to do is instantiate instances on new nodes. The following command will instantiate an instance of Rabbit on a node called hare@localhost.

        rabbitmq-server &

Ensure the port number is different to the port currently in use.

A sticking point are the ports bound by Rabbit to plug-ins. You might see the following error:


Error description:

This means that the Rabbit MQTT for the currently running node is using port 1883.


Error description:

This means that the Rabbit STOMP for the currently running node is using port 61613.

To resolve this conflict add an argument to RABBITMQ_SERVER_START_ARGS specifying a new port for the plug-in.

A list of installed plug-in is shown in the RabbitMQ web interface in the overview tab under ports and contexts.

The following shows how to configure ports for the Rabbit management and Rabbit MQTT

        -rabbitmq_management listener [{port,15674}]
        -rabbitmq_mqtt tcp_listeners [1884]"
    rabbitmq-server &

Now add the node to the cluster. Stop the instance, join it to another node and start.

rabbitmqctl -n hare@localhost stop_app
rabbitmqctl -n hare@localhost join_cluster rabbit@localhost
rabbitmqctl -n hare@localhost start_app

Unleash the power of your APIs with future-proof API management - Create your account and start your free trial today, brought to you in partnership with 3scale.

rabbitmq ,integration ,messaging queue ,clustering

Published at DZone with permission of Alex Theedom. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}