RabbitMQ - Join a node to a cluster using rabbitmqctl join_cluster

Before you can join a node to a cluster, you must first stop the RabbitMQ application and reset the node. This can be done with the rabbitmqctl stop_app and rabbitmqctl reset commands.


Be aware that reset will remove all resources and data on the node.

rabbitmqctl stop_app
rabbitmqctl reset


Then the rabbitmqctl join_cluster command can be used.


The Erlang cookie on each node must be identical. Typically, the file that contains the Erlang cookie is /var/lib/rabbitmq/.erlang.cookie. The RABBITMQ_ERLANG_COOKIE variable can be used to define the Erlang cookie on each RabbitMQ node.


Let's say this command is run on the node with hostname rabbit2.example.com. This command will create a cluster that contains both rabbit1.example.com and rabbit2.example.com.

rabbitmqctl join_cluster rabbit@rabbit1.example.com


Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 7fdb8 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |