Can't change RabbitMQ's .erlang.cookie

920 views
Skip to first unread message

w Day

unread,
Aug 12, 2021, 4:22:01 AM8/12/21
to rabbitmq-users
Hi Team,

I tried many ways to change .erlang.cookie, but RabbitMQ still use previous .erlang.cookie content, not use new cookie. 
could anyone help me?

------------------------------------------------------------
OS: windows 10 enterprise
RabiitMQ: rabbitmq-server-3.8.16
erl: otp_win64_24.0.4
%HOMEDRIVE%%HOMEPATH%:   U:\
%USERPROFILE%  C:\Users\XXXX
------------------------------
after install RabbitMQ, it generated new .erlang.cookie file in U:\.erlang.cookie ( cookie1)
in the RabbitMQ log:
 node           : rabbit@XXXX-XXXX
 home dir       : C:\WINDOWS\system32\config\systemprofile
 cookie hash    : yWFYYsoIQN0E+UKpRPbRfA==

I changed(or add) below position .erlang.cookie with new cookie2.
C:\Windows\System32\config\systemprofile\.erlang.cookie
C:\Windows\SysWOW64\config\systemprofile\.erlang.cookie
C:\Users\XXXX\.erlang.cookie
U:\.erlang.cookie
C:\Windows\.erlang.cookie

then restart computer(also tried to restart service). but seem the RabbitMQ still use previous .erlang.cookie. (cookie1)
1. in the log, cookie hash never changed.
Line 28:  cookie hash    : yWFYYsoIQN0E+UKpRPbRfA==
Line 491:  cookie hash    : yWFYYsoIQN0E+UKpRPbRfA==
.....
Line 3091:  cookie hash    : yWFYYsoIQN0E+UKpRPbRfA==
Line 3366:  cookie hash    : yWFYYsoIQN0E+UKpRPbRfA==
2. CLI with new cookie2 will fail, but CLI with previous cookie1 can success.

rabbitmq-diagnostics status --erlang-cookie "cookie2"
Error: unable to perform an operation on node 'rabbit@ XXXX-XXXX'. Please see diagnostics information and suggestions below.

Most common reasons for this are:

 * Target node is unreachable (e.g. due to hostname resolution, TCP connection or firewall issues)
 * CLI tool fails to authenticate with the server (e.g. due to CLI tool's Erlang cookie not matching that of the server)
 * Target node is not running

In addition to the diagnostics info below:

 * See the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@XXXX-XXXX
 * If target node is configured to use long node names, don't forget to use --longnames with CLI tools

DIAGNOSTICS
===========

attempted to contact: ['rabbit@ XXXX-XXXX  ']

rabbit@ XXXX-XXXX:
  * connected to epmd (port 4369) on XXXX-XXXX
  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
  * TCP connection succeeded but Erlang distribution failed
  * suggestion: check if the Erlang cookie identical for all server nodes and CLI tools
  * suggestion: check if all server nodes and CLI tools use consistent hostnames when addressing each other
  * suggestion: check if inter-node connections may be configured to use TLS. If so, all nodes and CLI tools must do that
   * suggestion: see the CLI, clustering and networking guides on https://rabbitmq.com/documentation.html to learn more


Current node details:
 * node name: 'rabbitmqcli-918-rabbit@XXXX-XXXX'
 * effective user's home directory: U:\
 * Erlang cookie hash: RmzKErjVZUcsMU8wSgBGbA==

rabbitmq-diagnostics status --erlang-cookie "cookie1"
Status of node rabbit@ XXXX-XXXX   ...
←[1mRuntime←[0m

OS PID: 2108
OS: Windows
Uptime (seconds): 14
Is under maintenance?: false
RabbitMQ version: 3.8.16
Node name: rabbit@XXXX-XXXX
Erlang configuration: Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]
Erlang processes: 474 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60
....


w Day

unread,
Aug 14, 2021, 7:09:38 AM8/14/21
to rabbitmq-users
oh, my god. Notepad++ problem. 
I haven't written the new cookie into the file  C:\Windows\System32\config\systemprofile\.erlang.cookie

I saved file and reloaded, notepad++ show new value....
I use notepad to open it today, it show old cookie. after change it, this problem is resolved.
Reply all
Reply to author
Forward
0 new messages