Authentication failed (rejected by the remote node), please check the Erlang cookie

安装RabbitMQ出现的问题记录:

命令行D:\soft\Rabbitmq\rabbitmq_server-3.7.0\sbin>rabbitmqctl status

提示:

Status of node rabbit@LAPTOP-SDG10LIN ...
Error: unable to perform an operation on node 'rabbit@LAPTOP-SDG10LIN'. 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 http://rabbitmq.com/documentation.html to learn more
 * Consult server logs on node rabbit@LAPTOP-SDG10LIN

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

attempted to contact: ['rabbit@LAPTOP-SDG10LIN']

rabbit@LAPTOP-SDG10LIN:
  * connected to epmd (port 4369) on LAPTOP-SDG10LIN
  * epmd reports node 'rabbit' uses port 25672 for inter-node and CLI tool traffic
  * TCP connection succeeded but Erlang distribution failed

  * Authentication failed (rejected by the remote node), please check the Erlang cookie


Current node details:
 * node name: 'rabbitmqcli79@LAPTOP-SDG10LIN'
 * effective user's home directory: C:\Users\lujie
 * Erlang cookie hash: Jx59lsGpH45Mhu5eAkFMGQ==

解决办法:
网上提供的两种方法:
1、重装RabbitMQ服务。我试了,没成功
2、官网提供的解决方法

http://www.rabbitmq.com/install-windows-manual.html

Synchronise Erlang Cookies (when running a manually installedWindows Service) Erlang Security Cookies used by the service account and the userrunning rabbitmqctl.bat must besynchronised for rabbitmqctl.bat tofunction.
To ensure Erlang cookie files contain the same string, copy the.erlang.cookie file from the Windowsdirectory (normallyC:\WINDOWS\.erlang.cookie) to replace the user.erlang.cookie. The user cookie will bein the user's home directory (%HOMEDRIVE%%HOMEPATH%),e.g.C:\Documents and Settings\%USERNAME%\.erlang.cookie or C:\Users\%USERNAME%\.erlang.cookie (Windows Vista andlater).

即使C:\Windows\.erlang.cookie 和C:\User\lujie\.erlang.cookie两个文件内容一致。
但是我的C:\Windows下没有这个文件,我开始是直接把lujie下的文件拷贝到C:\Windows下,但是还是报同样的错误。
然后我用搜索工具对电脑文件系统进行检索,找到C:\Windows\System32\config\systemprofile下有个.erlang.cookie文件,内容与C:\User\lujie\.erlang.cookie不一样,后来修改其中一个文件的内容,使两个文件内容一样。
再次执行命令rabbitmqctl status,成功
这里写图片描述

接下来就可以顺利访问http://localhost:15672
默认的用户名和密码都是guest
这里写图片描述

  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值