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

来源:互联网 发布:软件开发基础知识 编辑:程序博客网 时间:2024/06/06 02:32

安装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 runningIn 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-SDG10LINDIAGNOSTICS===========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 cookieCurrent 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
这里写图片描述

阅读全文
0 0