[RabbitMQ]Error: unable to connect to node rabbit@compute1: nodedown(CentOS7.0)

  今天在搭建OpenStack的时候需要安装RabbitMQ,可是使用yum install rabbitmq-server安装之后,按照OpenStack官方提供的文档修改guest用户密码的时候却出现了如下错误:

[root@controller ~]# rabbitmqctl change_password guest Rabbit123
Changing password for user "guest" ...
Error: unable to connect to node rabbit@controller: nodedown DIAGNOSTICS
=========== nodes in question: [rabbit@controller] hosts, their running nodes and ports:
- controller: [{rabbitmqctl3435,}] current node details:
- node name: rabbitmqctl3435@controller
- home dir: /var/lib/rabbitmq
- cookie hash: KkWnl06AR+v86hEhVTp8/g== [root@controller ~]#

  殊不知,这并不是修改密码的命令除了问题,而是安装启动后就出现的问题。在启动服务后,在命令行输入:rabbitmqctl status,同样出现上述问题,如下:  

[root@controller ~]# rabbitmqctl status
Status of node rabbit@controller ...
Error: unable to connect to node rabbit@controller: nodedown DIAGNOSTICS
=========== nodes in question: [rabbit@controller] hosts, their running nodes and ports:
- controller: [{rabbitmqctl3560,}] current node details:
- node name: rabbitmqctl3560@controller
- home dir: /var/lib/rabbitmq
- cookie hash: KkWnl06AR+v86hEhVTp8/g== [root@controller ~]#

  网上有人说是hostname的问题,结果测试了一下发现不行呀。

  解决方案:执行如下两条命令:

    # /sbin/service rabbitmq-server stop
    # /sbin/service rabbitmq-server start
    # rabbitmqctl status 测试正确,结果如下:

[root@compute1 home]# /sbin/service rabbitmq-server stop
Redirecting to /bin/systemctl stop rabbitmq-server.service
[root@compute1 home]# /sbin/service rabbitmq-server start
Redirecting to /bin/systemctl start rabbitmq-server.service
[root@compute1 home]# rabbitmqctl status
Status of node rabbit@compute1 ...
[{pid,},
{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,},
{connection_procs,},
{queue_procs,},
{plugins,},
{other_proc,},
{mnesia,},
{mgmt_db,},
{msg_index,},
{other_ets,},
{binary,},
{code,},
{atom,},
{other_system,}]},
{vm_memory_high_watermark,0.4},
{vm_memory_limit,},
{disk_free_limit,},
{disk_free,},
{file_descriptors,[{total_limit,},
{total_used,},
{sockets_limit,},
{sockets_used,}]},
{processes,[{limit,},{used,}]},
{run_queue,},
{uptime,}]
...done.
[root@compute1 home]#

  再次输入修改密码命令:rabbitmqctl change_password guest Rabbit123成功

[root@controller ~]# rabbitmqctl change_password guest Rabbit123
Changing password for user "guest" ...
...done.
[root@controller ~]#
上一篇:Boostarp-响应式


下一篇:Kafka源码环境搭建