1. 程式人生 > >[RabbitMQ]Error: unable to connect to node

[RabbitMQ]Error: unable to connect to node

今天在搭建OpenStack的時候需要安裝RabbitMQ,可是使用yum install rabbitmq-server安裝之後,按照OpenStack官方提供的文件修改guest使用者密碼的時候卻出現瞭如下錯誤:

複製程式碼
[[email protected] ~]# rabbitmqctl change_password guest Rabbit123
Changing password for user "guest" ...
Error: unable to connect to node [email protected]: nodedown

DIAGNOSTICS
=========== nodes in question: [[email protected]] hosts, their running nodes and ports: - controller: [{rabbitmqctl3435,40060}] current node details: - node name: [email protected] - home dir: /var/lib/rabbitmq - cookie hash: KkWnl06AR+v86hEhVTp8/g== [[email protected] ~]#
複製程式碼

  殊不知,這並不是修改密碼的命令除了問題,而是安裝啟動後就出現的問題。在啟動服務後,在命令列輸入:rabbitmqctl status

,同樣出現上述問題,如下:  

複製程式碼
[[email protected] ~]# rabbitmqctl status
Status of node [email protected] ...
Error: unable to connect to node [email protected]: nodedown

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

nodes in question: [[email protected]]

hosts, their running nodes and ports:
- controller: [{rabbitmqctl3560,54352
}] current node details: - node name: [email protected] - home dir: /var/lib/rabbitmq - cookie hash: KkWnl06AR+v86hEhVTp8/g== [[email protected] ~]#
複製程式碼

  網上有人說是hostname的問題,結果測試了一下發現不行呀。

  解決方案:執行如下兩條命令:

    # /sbin/service rabbitmq-server stop
    # /sbin/service rabbitmq-server start
    # rabbitmqctl status 測試正確,結果如下:

複製程式碼
[[email protected] home]# /sbin/service rabbitmq-server stop
Redirecting to /bin/systemctl stop  rabbitmq-server.service
[[email protected] home]# /sbin/service rabbitmq-server start
Redirecting to /bin/systemctl start  rabbitmq-server.service
[[email protected] home]# rabbitmqctl status
Status of node [email protected] ...
[{pid,22133},
 {running_applications,[{rabbit,"RabbitMQ","3.1.5"},
                        {os_mon,"CPO  CXC 138 46","2.2.14"},
                        {mnesia,"MNESIA  CXC 138 12","4.11"},
                        {xmerl,"XML parser","1.3.6"},
                        {sasl,"SASL  CXC 138 11","2.3.4"},
                        {stdlib,"ERTS  CXC 138 10","1.19.4"},
                        {kernel,"ERTS  CXC 138 10","2.16.4"}]},
 {os,{unix,linux}},
 {erlang_version,"Erlang R16B03-1 (erts-5.10.4) [source] [64-bit] [smp:6:6] [async-threads:30] [hipe] [kernel-poll:true]\n"},
 {memory,[{total,36056032},
          {connection_procs,2800},
          {queue_procs,5600},
          {plugins,0},
          {other_proc,13586448},
          {mnesia,59920},
          {mgmt_db,0},
          {msg_index,22280},
          {other_ets,739304},
          {binary,7880},
          {code,16441504},
          {atom,594537},
          {other_system,4595759}]},
 {vm_memory_high_watermark,0.4},
 {vm_memory_limit,6663997030},
 {disk_free_limit,1000000000},
 {disk_free,82596229120},
 {file_descriptors,[{total_limit,924},
                    {total_used,3},
                    {sockets_limit,829},
                    {sockets_used,1}]},
 {processes,[{limit,1048576},{used,127}]},
 {run_queue,0},
 {uptime,7}]
...done.
[[email protected] home]#
複製程式碼

   再次輸入修改密碼命令:rabbitmqctl change_password guest Rabbit123成功

[[email protected] ~]# rabbitmqctl change_password guest Rabbit123
Changing password for user "guest" ...
...done.
[[email protected] ~]#