9

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?

Iustinian Olaru
  • 1,231
  • 1
  • 13
  • 33

2 Answers2

19

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.

Iustinian Olaru
  • 1,231
  • 1
  • 13
  • 33
  • 8
    To eliminate the 50/50 chance... To sync: copy the C:\Windows cookie to overwrite the C:\Users\%USER% cookie – theKRAY Aug 03 '17 at 19:48
  • 2
    https://www.rabbitmq.com/install-windows-manual.html, the issue is also described here, with the path for the two cookies given . – William Feb 03 '18 at 23:13
  • @William Yea, the bottom advice I reached when anyone asks me about rabbitmq is "Read the documentation at least 3 times". All the issues I have had with it, I found the solution just by carefully re reading the documentation. – Iustinian Olaru Feb 04 '18 at 21:55
  • Helped me too. RabbitMQ server restart was needed after sync cookies (if it's not obvious). – flam3 Feb 12 '18 at 08:28
6

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)
lapaczo
  • 746
  • 7
  • 10