RabbitMQ, Erlang: How to "make sure the erlang cookies are the same"
Solution 1
The definitive answer to your specific question, on the RabbitMQ site is at http://www.rabbitmq.com/clustering.html
However, from your status dump, it doesn't look as though this is your issue. It just looks as though your node is down. Am I correct in assuming that you aren't running a cluster? The fact that the node that you can't connect to is the same as the one you are running the commands from indicates this.
If the RabbitMQ service is running then run rabbitmqctl start If it isn't running then go to services and start it and then the above. The erlang cookie is irrelevant for non-clustered configurations.
Solution 2
In my case, for some reason the cookie (.erlang.cookie
) stored under C:\Windows\
was different from the one I had stored under my home (%HOMEDRIVE%
%HOMEPATH%
, which was C:\
for me).
Once I copied the cookie from C:\Windows
into my my home folder everything started working.
Solution 3
For what it's worth, in 2018, the docs are WRONG. In windows 10, the default location of the cookie file appears to be:
C:\Windows\System32\config\systemprofile
and NOT
C:\Windows
as the docs say.
The best thing to do is to look at the log file, which is typically located in your user %AppData%\Roaming\RabbitMQ\log
directory.
The log file contains this entry, which helped me determine the cookie location:
node : rabbit@computername
home dir : C:\WINDOWS\system32\config\systemprofile
Solution 4
For those out there googling, this same erlang cookie error can happen when you are missing the HOME
parameter from your environment configuration. For example, on the default ArchLinux installation of rabbitmq.
In this case, the service is started with systemctl start rabbitmq
and it generates a cookie but the cli tools like rabbitmqctl status
will not work out of the box because they do not know the home location.
default /etc/rabbitmq/rabbitmq-env.conf
NODENAME=rabbit
NODE_IP_ADDRESS=0.0.0.0
NODE_PORT=5672
LOG_BASE=/var/log/rabbitmq
MNESIA_BASE=/var/lib/rabbitmq/mnesia
modified /etc/rabbitmq/rabbitmq-env.conf
NODENAME=rabbit
NODE_IP_ADDRESS=127.0.0.1
NODE_PORT=5672
HOME=/var/lib/rabbitmq
LOG_BASE=/var/log/rabbitmq
MNESIA_BASE=/var/lib/rabbitmq/mnesia
ref https://bbs.archlinux.org/viewtopic.php?id=191587
Solution 5
In home directory of the user running erlang process, there is hidden file .erlang.cookie. It holds string which is responsible for the topology of erlang cluster. Make sure that the string (cookie) is the same across all nodes you want to connect. If there is no cookie, create one.
Related videos on Youtube
Comments
-
Mikey almost 2 years
I am using RabbitMQ with Grails, and a problem cropped up this morning. When I run
rabbitmqctl
status it tells me:C:\Users\BuildnTest2>rabbitmqctl status Status of node 'rabbit@BUILDNTEST2-PC' ... Error: unable to connect to node 'rabbit@BUILDNTEST2-PC': nodedown diagnostics: - nodes and their ports on BUILDNTEST2-PC: [{rabbit,49164}, {rabbitmqctl27693,49286}] - current node: 'rabbitmqctl27693@BuildnTest2-PC' - current node home dir: C:\Users\BuildnTest2 - current node cookie hash: cSYB8tsT4mGGZHSUGQi08w==
When I go to the Rabbit troubleshooting page they say:
then you should make sure the Erlang cookies are the same.
What does this mean and how is it accomplished?
Googling found this forum thread which claims to have instructions to solving this problem, but alas it just redirects back to the rabbit site where there is no answer.
-
Muzaaya Joshua about 12 yearscheck the node
home dir
and for each node, modify a file called.erlang.cookie
and have the file contain the same value e.g.echo mycookie > $NODE_HOME_DIR/.erlang.cookie
for each node. -
Mick about 11 yearsIf people are not running a cluster, they might be interested to read this very similar issue.
-
-
Mikey about 12 yearsah so the service can be running without rabbit running?
-
Steve Martin about 12 yearsIndeed. The service is a host to the RabbitMQ server which can be started and stopped. Much like IIS and the hosted web sites within.
-
Michal over 7 yearsThis is the correct answer. Thank you very much, you saved me from pain.
-
Der_Meister almost 7 yearsThe solution is described in official documentation: rabbitmq.com/install-windows-manual.html
-
Todd Vance almost 7 yearsI try that and still get auth failed...but only on my rackspace vms
-
robasaurus about 6 yearsYes this works on Windows 10 where I had the same issue.
-
camjocotem about 6 yearsIs this definitely a Windows 10 issue and not a result of upgrading to Erlang 20.2? From rabbitmq.com/clustering.html : For the RabbitMQ Windows service - %USERPROFILE%\\.erlang.cookie (usually C:\\WINDOWS\\system32\\config\\systemprofile)
-
Albert almost 6 yearsAlso applies to 2008R2, where I installed both erlang (20.3) and rabbitmq (3.7.3) through chocolatey.
-
Daniel Orlan almost 6 yearsCan confirm that this is the proper location for the cookie in Windows Server 2016 aswell.
-
Daniel Orlan almost 6 years
rabbitmqctl status
was returning Authentication failed (rejected by the remote node)effective user's home directory: C:\Users\Administrator
I copied over the .erlang toC:\WINDOWS\system32\config\systemprofile
and it worked. -
DL Narasimhan almost 5 yearsTheir docs are kinda ambiguous across versions! On Windows 10, I now no longer find .erlang.cookie. Looked up both
C:\WINDOWS\system32\config\systemprofile
andc:\windows
with no luck.