9
votes

I have multiple RabbitMQ nodes running on different machines. After installing each node I failed to specify a common cookie for each of them to use so I had to go back and manually change the file .erlang.cookie . My issue is that after doing this I get conflicting error messages. If i do rabbitmqctl status I get the following error:

DIAGNOSTICS

attempted to contact: ['rabbit@nc-mso-test01']

rabbit@nc-mso-test01: * connected to epmd (port 4369) on nc-mso-test01 * epmd reports node 'rabbit' running on port 25672 * TCP connection succeeded but Erlang distribution failed

  • Authentication failed (rejected by the remote node), please check the Erlang cookie

current node details: - node name: 'rabbitmq-cli-45@nc-mso-test01' - home dir: C:\Users\jol - cookie hash: 9/Hx6l+wLQv3NkmSDFqBog==

Whatever script I call, I get the same error. I tried restarting the service, removing and installing it through rabbitmq-service. The error persists. From what I can gather from other posts, the reason might be that the node and the erlang broker are running on separate users and each of them have a different version of the cookie, one is stuck with the old one.

How can I make the server and node restart, so that both of them use the new cookie file?

2

2 Answers

19
votes

I solved my issue. I missed the fact that the RabbitMQ setup has two cookie files, one in c:\Windows for the erlang component, and one in C:\Users\%USER%. From what I understand, if the erlan VM is started on it's own application user and the RabbitMQ node is started on a different user, which would have been my case, then the two cookie files were different and I had to sync those up before syncing the cluster cookies.

6
votes

Documentation says:

The cookie file used by the Windows service account and the user running CLI tools must be synchronised. RabbitMQ-Clustering Guide

On Erlang versions starting with 20.2, the cookie file locations are:

  • For user running CLI tools - usually C:\Users\%USERNAME%\.erlang.cookie for user %USERNAME%
  • For the RabbitMQ Windows service - %USERPROFILE%\.erlang.cookie (usually C:\WINDOWS\system32\config\systemprofile)

On Erlang versions prior to 20.2 (e.g. 19.3 or 20.1), the cookie file locations are:

  • For user running CLI tools - usually C:\Users\%USERNAME%\.erlang.cookie for user %USERNAME%
  • For the RabbitMQ Windows service - %WINDIR%\.erlang.cookie (usually C:\Windows\.erlang.cookie)