When creating a message queue user in OpenStack: Error: unable to connect to node rabbit@localhost: nodedown

One, the problem

At the end of the installation of RadditMQ, a message queue user is created, which appears when the controller and node node are connected to rabbitmq.

[root@controller ~]#  rabbitmqctl add_user openstack RABBIT_PASS
Error: unable to connect to node rabbit@localhost: nodedown    无法连接到节点rabbit

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@controller" believes its host is different. Please ensure that hostnames resolve the same way locally and on "rabbit@controller"


current node details:
- node name: 'rabbitmq-cli-13@controller'
- home dir: /var/lib/rabbitmq
- cookie hash: gwGz2ppxNd17Sx4omtwyZw==

According to the error message and some of the following tips, you can probably see that it is a cookie problem

Two, the solution

This may be due to some reasons that the registration items are not correctly configured when installing the service. Generally, the RabbitMQ service is reinstalled

1. Before reinstalling the RabbitMQ service, we need to kill the mq process

ps -ef | grep rabbitmq | grep -v grep | awk '{print $2}' | xargs kill -9 

2. Install RabbitMQ service

3. Restart the mq process

rabbitmq-server -detached

4. View the status of the mq process

[root@ct ~]#rabbitmqctl status
Status of node rabbit@ct
[{
    
    pid,27550},
 {
    
    running_applications,
     [{
    
    rabbitmq_management,"RabbitMQ Management Console","3.6.16"},
      {
    
    rabbitmq_management_agent,"RabbitMQ Management Agent","3.6.16"},
      {
    
    rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.6.16"},
      {
    
    rabbit,"RabbitMQ","3.6.16"},
      {
    
    amqp_client,"RabbitMQ AMQP Client","3.6.16"},
      {
    
    rabbit_common,
          "Modules shared by rabbitmq-server and rabbitmq-erlang-client",
          "3.6.16"},
      {
    
    xmerl,"XML parser","1.3.14"},
      {
    
    cowboy,"Small, fast, modular HTTP server.","1.0.4"},
      {
    
    ranch,"Socket acceptor pool for TCP protocols.","1.3.2"},
      {
    
    mnesia,"MNESIA  CXC 138 12","4.14.3"},
      {
    
    syntax_tools,"Syntax tools","2.1.1"},
      {
    
    ssl,"Erlang/OTP SSL application","8.1.3.1"},
      {
    
    os_mon,"CPO  CXC 138 46","2.4.2"},
      {
    
    compiler,"ERTS  CXC 138 10","7.0.4.1"},
      {
    
    cowlib,"Support library for manipulating Web protocols.","1.0.2"},
      {
    
    public_key,"Public key infrastructure","1.4"},
      {
    
    crypto,"CRYPTO","3.7.4"},
      {
    
    asn1,"The Erlang ASN1 compiler version 4.0.4","4.0.4"},
      {
    
    recon,"Diagnostic tools for production use","2.3.2"},
      {
    
    inets,"INETS  CXC 138 49","6.3.9"},
      {
    
    sasl,"SASL  CXC 138 11","3.0.3"},
      {
    
    stdlib,"ERTS  CXC 138 10","3.3"},
      {
    
    kernel,"ERTS  CXC 138 10","5.2"}]},
 {
    
    os,{
    
    unix,linux}},
 {
    
    erlang_version,
     "Erlang/OTP 19 [erts-8.3.5.3] [source] [64-bit] [smp:4:4] [async-threads:64] [hipe] [kernel-poll:true]\n"},
 {
    
    memory,
...............

You can see that there is no error message in the current process status

5. Create the message queue user again

[root@ct ~]#  rabbitmqctl add_user openstack RABBIT_PASS                                                      
Creating user "openstack"    创建用户"openstack"

The creation is successful and the problem is solved.

Guess you like

Origin blog.csdn.net/F2001523/article/details/113964402