問題描述
環境:Ubuntu
h3d@h3d2107:~$ sudo rabbitmqctl list_queues
Error: unable to connect to node rabbit@h3d2107: nodedown
DIAGNOSTICS===========
attempted to contact: [rabbit@h3d2107]
rabbit@h3d2107:
* connected to epmd (port 4369) on SC-201607101239
* epmd reports node 'rabbit' running on port 25672
* TCP connection succeeded but Erlang distribution failed
* suggestion: hostname mismatch?
* suggestion: is the cookie set correctly?
* suggestion: is the Erlang distribution using TLS?
current node details:
- node name: 'rabbitmq-cli-2296@h3d2107'
- home dir: /var/lib/rabbitmq
- cookie hash: GrEiTedcyLioix0+618jhw==
解決方式:
sudo cp /var/lib/rabbitmq/.erlang.cookie ~/.erlang.cookie
重啓即可
原因:
RabbitMQ的erlang.cookie和用戶的cookie衝突了,需要用rabbitmq的cookie去覆蓋用戶的cookie。