欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

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

发布时间:2024/9/19 编程问答 54 豆豆
生活随笔 收集整理的这篇文章主要介绍了 【rabbitmq】Authentication failed (rejected by the remote node), please check the Erlang cookie 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

前言

  • erlang 23.1
  • rabbitmq server v3.8.9
  • win 10

问题描述

使用 rabbitmqctl 命令时出现错误:

C:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.9\sbin> rabbitmqctl status Error: unable to perform an operation on node 'rabbit@DESKTOP-1GHM2HM'. 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 https://rabbitmq.com/documentation.html to learn more* Consult server logs on node rabbit@DESKTOP-1GHM2HM* If target node is configured to use long node names, don't forget to use --longnames with CLI toolsDIAGNOSTICS ===========attempted to contact: ['rabbit@DESKTOP-1GHM2HM']rabbit@DESKTOP-1GHM2HM:* connected to epmd (port 4369) on DESKTOP-1GHM2HM* 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: 'rabbitmqcli-20064-rabbit@DESKTOP-1GHM2HM'* effective user's home directory: C:\Users\admin* Erlang cookie hash: 37DhljkMemAT0RSfiJUaUQ==

有用的错误信息:Authentication failed (rejected by the remote node), please check the Erlang cookie

错误分析

官方说明 如下

核心思想是:RabbitMQ Windows service启动时使用的 erlang cookie,与 RabbitMQ 命令行执行时使用的 erlang cookie,位置不一致。

解决办法

官方解决办法是:复制RabbitMQ Windows service启动时使用的 erlang cookie,覆盖掉RabbitMQ 命令行执行时使用的 erlang cookie。

非官方解决办法有:

  • 按照低版本的 erlang。(PS: 这个没试过)
  • 使用命令行启动 RabbitMQ 。(执行 rabbitmq-server.bat 命令启动 RabbitMQ)

参考

https://www.rabbitmq.com/cli.html#erlang-cookie
https://blog.csdn.net/J_Shine/article/details/78833456
https://www.cnblogs.com/hellxz/p/9104028.html
https://blog.csdn.net/yangl1337905751/article/details/80318055
https://www.rabbitmq.com/install-windows-manual.html

总结

以上是生活随笔为你收集整理的【rabbitmq】Authentication failed (rejected by the remote node), please check the Erlang cookie的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。