首页 > 代码库 > [RabbitMQ]Error: unable to connect to node rabbit@compute1: nodedown(CentOS7.0)

[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 Rabbit123Changing password for user "guest" ...Error: unable to connect to node rabbit@controller: nodedownDIAGNOSTICS===========nodes in question: [rabbit@controller]hosts, their running nodes and ports:- controller: [{rabbitmqctl3435,40060}]current node details:- node name: rabbitmqctl3435@controller- home dir: /var/lib/rabbitmq- cookie hash: KkWnl06AR+v86hEhVTp8/g==[root@controller ~]# 

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

[root@controller ~]# rabbitmqctl statusStatus of node rabbit@controller ...Error: unable to connect to node rabbit@controller: nodedownDIAGNOSTICS===========nodes in question: [rabbit@controller]hosts, their running nodes and ports:- controller: [{rabbitmqctl3560,54352}]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 stopRedirecting to /bin/systemctl stop  rabbitmq-server.service[root@compute1 home]# /sbin/service rabbitmq-server startRedirecting to /bin/systemctl start  rabbitmq-server.service[root@compute1 home]# rabbitmqctl statusStatus of node rabbit@compute1 ...[{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.[root@compute1 home]#

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

[root@controller ~]# rabbitmqctl change_password guest Rabbit123Changing password for user "guest" ......done.[root@controller ~]# 

 

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