Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RabbitMQ cluster with three nodes

I am trying to do clustering with RabbitMQ. I have added two nodes, but I am unable to add a third one. I have clustered rabbit@node1 and rabbit@node2. Now I am trying to cluster rabbit@node3 with rabbit@node1.

Here is what I am trying to do:

rabbitmqctl join_cluster rabbit@node1
Clustering node rabbit@node3 with rabbit@node1 ...
Error: mnesia_not_running

Is there any way to add a third node to the cluster? Or any solution for the Error: mnesia_not_running error?

like image 555
Ali Warrich Avatar asked Feb 02 '26 13:02

Ali Warrich


2 Answers

When joining a cluster, the target node application should be started, while the source (current) node application should be stopped. An application can be stopped and started with rabbitmqctl stop_app and rabbitmqctl start_app.

Maybe you have stopped the application on rabbit@node1, while joining it to the cluster. In that case you should run rabbitmqctl start_app on rabbit@node1, or rabbitmqctl -n rabbit@node1 start_app to be able to join its cluster. Or you can join the rabbit@node2 cluster and start the app later.

To have a working cluster you should start the application on all nodes after joining.

like image 151
Daniil Fedotov Avatar answered Feb 05 '26 07:02

Daniil Fedotov


The error happens when the target node's app is stopped. When joining a node to a RabbitMQ cluster, only the source node (the node which you are trying to link) should be stopped.

On the master node:

rabbitmqctl start_app

On the current node:

rabbitmqctl stop_app
rabbitmqctl join_cluster rabbit@node1
like image 45
Bhagya Amarasinghe Avatar answered Feb 05 '26 09:02

Bhagya Amarasinghe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!