错误信息:
Error: unable to perform an operation on node 'rabbit@iZ2vc8p9xf24t7go83ppkfZ'. 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@iZ2vc8p9xf24t7go83ppkfZ
* If target node is configured to use long node names, don't forget to use --longnames with CLI tools
DIAGNOSTICS
===========
attempted to contact: [rabbit@iZ2vc8p9xf24t7go83ppkfZ]
rabbit@iZ2vc8p9xf24t7go83ppkfZ:
* connected to epmd (port 4369) on iZ2vc8p9xf24t7go83ppkfZ
* epmd reports: node 'rabbit' not running at all
no other nodes on iZ2vc8p9xf24t7go83ppkfZ
* suggestion: start the node
Current node details:
* node name: 'rabbitmqcli-40-rabbit@iZ2vc8p9xf24t7go83ppkfZ'
* effective user's home directory: /root
* Erlang cookie hash: 5tN0So9quBc8H6Rd6j5QTg==
我看到网上说了几种方式:
1:2个erlang.cookie 位置不准确 需进行替换啥的
2:本机host问题
以上都没解决我的问题,且我在用第一种方法时都没搜索到我系统中有2个erlang.cookie,只搜索到root/.erlang.cookie这一个文件。
我的问题是因为我在启动rabbitmq后 使用ctrl+c 退出来了,导致rabbitmq整个程序就关闭了,然后添加用户就报错了。
最后使用后台运行的方式,再添加用户就OK了