1. 复现问题
今天登录rabbitMq
后台管理,输入用户名和密码后,却报出这个错误:Not management user
,如下图所示:
于是,决定执行命令rabbitmqctl list_users
查看是否有这个用户。
- 首先在
D:\Software\rabbitmq\rabbitmq_server-3.8.15\sbin
目录下输入cmd
:
- 在
cmd
命令窗口执行如下指令:
rabbitmqctl list_users
却报出如下错误:
D:\Software\rabbitmq\rabbitmq_server-3.8.15\sbin>rabbitmqctl list_users
Error: unable to perform an operation on node 'rabbit@DESKTOP-UVTEHFR'. 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 https://rabbitmq.com/documentation.html to learn more
* Consult server logs on node rabbit@DESKTOP-UVTEHFR
* If target node is configured to use long node names, don't forget to use --longnames with CLI tools
DIAGNOSTICS
===========
attempted to contact: ['rabbit@DESKTOP-UVTEHFR']
rabbit@DESKTOP-UVTEHFR:
* connected to epmd (port 4369) on DESKTOP-UVTEHFR
* epmd reports: node 'rabbit' not running at all
no other nodes on DESKTOP-UVTEHFR
* suggestion: start the node
Current node details:
* node name: 'rabbitmqcli-999-rabbit@DESKTOP-UVTEHFR'
* effective user's home directory: C:\Users\zxy
* Erlang cookie hash: pkFzX53V7Ok1QDOYqiMzXg==
2. 分析问题
将上述错误信息中这句话Error: unable to perform an operation on node 'rabbit@DESKTOP-UVTEHFR'.
翻译成中文为错误:无法在节点 'rabbit@DESKTOP-UVTEHFR 上执行操作
。
为什么无法在节点'rabbit@DESKTOP-UVTEHFR
上之心操作呢?
于是去查找资料,网上说错误的原因是Erlang
的cookie
出现问题,Erlang
会生成两个cookie
文件,文件目录如下所示:
C:\Windows\System32\config\systemprofile\.erlang.cookie
,但我的C:\Windows\System32\config\systemprofile\
目录下并没有这个.erlang.cookie
文件:
C:\用户\你的用户名\.erlang.cookie
,比如我的地址为C:\Users\zxy\.erlang.cookie
,如下图所示:
用后者的文件替换掉前者的文件。
3. 解决问题
将C:\用户\你的用户名\
目录下的.erlang.cookie
文件复制到C:\Windows\System32\config\systemprofile\
目录,如下图所示:
如果C:\Windows\System32\config\systemprofile\
已经存在.erlang.cookie
文件,使用C:\用户\你的用户名\
目录下的.erlang.cookie
文件替换掉即可。
双击rabbitmq-server.bat
重启rabbitmq
服务,如下图所示:
在cmd
命令行窗口再次输入rabbitmqctl list_users
即可:
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之家整理,本文链接:https://www.bmabk.com/index.php/post/99138.html