当前位置: 代码迷 >> 综合 >> RabbitMQ报错 Error: unable to connect to node rabbit@localhost: nodedown
  详细解决方案

RabbitMQ报错 Error: unable to connect to node rabbit@localhost: nodedown

热度:9   发布时间:2023-12-15 23:21:30.0

执行创建消息队列用户时:

[root@ct ~]# rabbitmqctl add_user openstack RABBIT_PASS

出现报错信息:

Error: unable to connect to node rabbit@localhost: nodedownDIAGNOSTICS
===========attempted to contact: [rabbit@localhost]rabbit@localhost:* connected to epmd (port 4369) on localhost* epmd reports node 'rabbit' running on port 25672* TCP connection succeeded but Erlang distribution failed* Hostname mismatch: node "rabbit@ct" believes its host is different. Please ensure that hostnames resolve the same way locally and on "rabbit@ct"current node details:
- node name: 'rabbitmq-cli-70@ct'
- home dir: /var/lib/rabbitmq
- cookie hash: JUOSnyAarD/iR1GN1NJGTQ==

解决方法:

方法一

无其他问题,原来是由于# bash 环境的问题又开了一个shell,# exit 退出到原来的shell执行就行,

[root@ct ~]# exit
exit
[root@localhost yum.repos.d]# exit
登出Connection closed by foreign host.Disconnected from remote host(最小化1) at 13:46:32.Type `help' to learn how to use Xshell prompt.
[c:\~]$ Connecting to 192.168.247.11:22...  #重新连接
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.WARNING! The remote SSH server rejected X11 forwarding request.
Last login: Fri Dec 11 19:42:30 2020
[root@ct ~]# rabbitmqctl add_user openstack RABBIT_PASS
Creating user "openstack"   #创建成功

方法二

查询mq的进程ps -ef | grep rabbitmq
将mq的进程杀掉ps -ef | grep rabbitmq | grep -v grep | awk '{print $2}' | xargs kill -9
启动mqrabbitmq-server -detached
查询mq的状态rabbitmqctl status
  相关解决方案