RabbitMQ报错Error: unable to connect to node rabbit@xxx: nodedown的解决方式

环境:Win10x64+erlang_otp_19.1x64+RabbitMQ3.6.6

刚开始研究RabbitMQ,就遇到问题:

安装好之后,按照官方安装向导执行rabbitmqctl status命令检查状态时,报如下错误:

Bash
Status of node 'rabbit@DESKTOP-RVK1IHE' ...
Error: unable to connect to node 'rabbit@DESKTOP-RVK1IHE': nodedown
DIAGNOSTICS
===========
attempted to contact: ['rabbit@DESKTOP-RVK1IHE']
rabbit@DESKTOP-RVK1IHE:
  * connected to epmd (port 4369) on DESKTOP-RVK1IHE
  * 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-22@DESKTOP-RVK1IHE'
- home dir: C:\Users\TNT
- cookie hash: oVa+k73FyoNB9z87SvbEAQ==

根据提示,应该是Erlang的cookie出现问题。谷歌后找到了两种解决方式(还有集群的解决方案,这里无关就不阐述了):

1、重新安装RabbitMQ的服务

For some reason the service set up by the installer did not configure several registry entries. Running this set them correctly and allowed the service to run.

这是由于某些原因在安装服务时没有正确配置注册项,重新安装服务即可解决:

  • 以管理员身份运行RabbitMQ Command Propmt(开始菜单中)

  • 执行rabbitmq-service remove

  • 执行rabbitmq-service install

然后再测试是否成功。

2、更正Erlang的cookie

Erlang会生成两个cookie文件:C:\Windows\.erlang.cookie 及 C:\用户\你的用户名\.erlang.cookie。检查两个文件内容是否一致,不一致用其中一个替换另一个即可。


我这里用第二种方式解决了问题,正如程序提示是cookie不正确所导致。

目前还不清楚为何会这样,网上查阅的资料很多都是集群才会出现这种情况,可能是bug,有待探究。


参考:http://stackoverflow.com/questions/28258392/rabbitmq-has-nodedown-error

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值