安装RabbitMQ,创建消息队列用户时报错怎么办???

Posted 龙少。

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装RabbitMQ,创建消息队列用户时报错怎么办???相关的知识,希望对你有一定的参考价值。

安装RabbitMQ,创建消息队列用户时报错怎么办

一.具体报错信息

Error: unable to connect to node rabbit@localhost: nodedown

二.背景介绍

在openstack-T版环境部署的时候,在安装RabbitMQ后,在创建消息队列用户,用于controler和 计算节点连接rabbitmq的认证(关联)时报错

[root@ct ~]# rabbitmqctl add_user openstack RABBIT_PASS
Error: unable to connect to node rabbit@localhost: nodedown

[root@ct ~]# systemctl enable rabbitmq-server.service
[root@ct ~]# systemctl start rabbitmq-server.service
[root@ct ~]# rabbitmqctl add_user openstack RABBIT_PASS
Error: unable to connect to node rabbit@localhost: nodedown

DIAGNOSTICS
===========

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-78@ct'
- home dir: /var/lib/rabbitmq
- cookie hash: sFo8yhXAlgTvkHNQ0wCYbQ==

三.解决办法

杀死mq进程,重启服务

[root@ct ~]# ps -ef | grep rabbitmq | grep -v grep | awk 'print $2' | xargs kill -9
[root@ct ~]# rabbitmq-server -detached
Warning: PID file not written; -detached was passed.
[root@ct ~]# rabbitmqctl status

重新创建成功

以上是关于安装RabbitMQ,创建消息队列用户时报错怎么办???的主要内容,如果未能解决你的问题,请参考以下文章

如何安装消息队列

java---消息队列 RabbitMQ

启动RabbitMq服务时报错

rabbitmq命令和通过网页查看rabbit的消息队列

RabbitMQ 消息队列学习

Linux下安装部署RabbitMQ