安装RabbitMQ过程请参看http://blog.youkuaiyun.com/chwshuang/article/details/50543878
安装环境- RabbitMQ 3.7.2
- Erlang20.2
- Windows10
安装成功之后使用rabbitmqctl status命令之后出现如下错误
Status of node rabbit@GuoGuo-PC ...
Error: unable to perform an operation on node 'rabbit@GuoGuo-PC'. 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@GuoGuo-PC
DIAGNOSTICS
===========
attempted to contact: ['rabbit@GuoGuo-PC']
rabbit@GuoGuo-PC:
* connected to epmd (port 4369) on GuoGuo-PC
* 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
网上查了很多没有找到解决办法,最后注意到最后两行的内容,然后去官网的安装教程点击打开链接查看发现其中有这么一段
To ensure Erlang cookie files contain the same string,copy the .erlang.cookie file from the Windowsservice directory listed above to replace the user .erlang.cookie.
意思是要确保.erlang.cookie文件的一致性,问题就出在这里,不知道什么原因导致了C:\Users\{UserName}\.erlang.cookie和默认情况下C:\WINDOWS\System32\config\systemprofile\.erlang.cookie不一致了,将Windows目录下的拷贝到用户目录下就可以了。