I am trying to cluster rabbit using chef
Here is my error. I shutdown all of rabbit on the second node.
rabbitmqctl join_cluster --ram rabbit@ip-10-158-xxx-xxx
Error: mnesia_unexpectedly_running
So..what is the deal? I tried this from http://agiletesting.blogspot.com/2010/05/rabbitmq-clustering-in-ubuntu.html which is to remove /var/lib/rabbitmq/mnesia. No go. And on what server doen it not be be running? All?
Thanks
Make sure you call sudo rabbitmqctl stop_app before issuing the cluster command. That seemed to be the problem for me.
Then make sure you call sudo rabbitmqctl start_app to begin it again :)
To call out a very important piece of @Itai Ganot's comment that's not immediately intuitive: you need to run rabbitmqctl stop_app on all nodes but one. If you run rabbitmqctl stop_app on all nodes, you will get a different message: Error: mnesia_not_running.
In short:
Error: mnesia_unexpectedly_running means "you need to run rabbitmqctl stop_app on this nodeError: mnesia_not_running means "you need to run rabbitmqctl start_app on the node you're trying to cluster with"You need to copy the cookie from the node you trying to connect
Let us use an example with 2 nodes: rabbit@node1 and rabbit@node2
rabbit@node1 and copy the cookie from cat /var/lib/rabbitmq/.erlang.cookie
rabbit@node2 remove the current cookie and paste the new one.Execute the following commands on the same node
/usr/sbin/rabbitmqctl stop_app
/usr/sbin/rabbitmqctl reset
/usr/sbin/rabbitmqctl cluster rabbit@node1
That should do it.
The same procedure is documented here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With