前言node
系統版本:CentOS Linux release 7.7.1908 (Core)cookie
經過rabbitmqctl add_user admin 12345指令,給rabbitmq添加用戶提示出錯:ide
[root@localhost perl]# rabbitmqctl add_user admin 12345
Error: unable to connect to node rabbit@localhost: nodedownserver
DIAGNOSTICS
===========rabbitmq
attempted to contact: [rabbit@localhost]rem
rabbit@localhost:
* connected to epmd (port 4369) on localhost
* epmd reports node 'rabbit' running on port 25672
* TCP connection succeeded but Erlang distribution failedhash
* Authentication failed (rejected by the remote node), please check the Erlang cookieit
current node details:
- node name: 'rabbitmq-cli-49@localhost'
- home dir: /root
- cookie hash: BgvEr+lGkDjLTQzT85cpyw==io
解決方案class
1)搜索.erlang.cookie文件
[root@localhost mnesia]# find / -name *.cookie
/root/.erlang.cookie
/opt/rabbitmq_server-3.6.10/.erlang.cookie
2)覆蓋掉/root/.erlang.cookie文件
cp /opt/rabbitmq_server-3.6.10/.erlang.cookie /root/
緣由
RabbitMQ的.erlang.cookie和用戶的cookie衝突了,須要用RabbitMQ的cookie去覆蓋用戶的cookie