Rabbitmq: Erlang distribution failed solution

Preface
System version: CentOS Linux release 7.7.1908 (Core)
Adding a user to rabbitmq via the rabbitmqctl add_user admin 12345 command prompts an error.
[[email protected] perl]# rabbitmqctl add_user admin 12345
Error: unable to connect to node [email protected]: nodedown
DIAGNOSTICS
===========
attempted to contact: [[email protected]]
[email protected]:
* connected to epmd (port 4369) on localhost
* 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: ‘[email protected]
– home dir: /root
– cookie hash: BgvEr+lGkDjLTQzT85cpyw==

 

Solution:
1)Search the .erlang.cookie file
[[email protected] mnesia]# find/-name *.cookie
/root/.erlang.cookie
/opt/rabbitmq_server-3.6.10/.erlang.cookie
2)Overwrite the /root/.erlang.cookie file
cp /opt/rabbitmq_server-3.6.10/.erlang.cookie  /root/

Cause:
RabbitMQ’s .erlang.cookie conflicts with the user’s cookie and needs to override the user’s cookie with RabbitMQ’s cookie


Read More: