从虚拟机无法启动(HTTP500)到rabbitMQ的错误:Error: unable to connect to node 'rabbit@linux-node1': nodedown

我的问题的起因是在看赵班长的视频中,当启动虚拟机的时候报错(由于无法上传图片,我就把错误截图内容打字出来了),报错内容如下:
Error:The server has either erred or is incapable of performing the requested operation.(HTTP 500)(Request-ID:req-0e531ab4-0a80-473b-bb90-e937865b7a65)
Error: Unable to launch instance named "demo"
 然后,查看nova的api.log日志,内容如下:
...(发贴子后,在提交时告诉我不允许发送站外链接,所以这部分的内容删除掉了,这里是些日志内容)

2018-06-22 19:08:25.208 2260 ERROR nova.api.openstack [req-0e531ab4-0a80-473b-bb90-e937865b7a65 84ee8ed4a5154ceb891c3f5921abfa6e ce967fbddc0b4be08718773d0b1e68bc] Caught error: Timed out waiting for a reply to message ID 060a620bbf0448d6bb05a91c6647cf7f

... (发贴子后,在提交时告诉我不允许发送站外链接,所以这部分的内容删除掉了,这里是些日志内容)

上面粗体内容,说明是等待超时了,我怀疑是消息队列是否有问题,然后就查看rabbitMQ的相关内容。
下面是rabbitMQ日志文件内容:
...
=ERROR REPORT==== 22-Jun-2018::19:10:19 ===
** Connection attempt from disallowed node 'rabbitmqctl2606@linux-node1' ** 

 
日志里有个不允许的节点
然后我执行rabbitmqctl status后,报错如下:
[root@linux-node1 ~]# rabbitmqctl status           
Status of node 'rabbit@linux-node1' ...
Error: unable to connect to node 'rabbit@linux-node1': nodedown

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

nodes in question: ['rabbit@linux-node1']

hosts, their running nodes and ports:
- linux-node1: [{rabbit,60831},{rabbitmqctl2606,19038}]

current node details:
- node name: 'rabbitmqctl2606@linux-node1'
- home dir: /root
- cookie hash: FYA1RzbUK6Toom04BLiG6Q==
 
 下面是我的hosts文件内容:
[root@linux-node1 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.149  linux-node1.example.com linux-node1
 我在网上查找各种引起Error: unable to connect to node 'rabbit@linux-node1': nodedown
的原因,重启rabbitMQ、卸载重装rabbitMQ均无效,始终出现这个Error错误。
 现在,想请教赵班长,这个问题要如何解决呢??
已邀请:
你好,赵班长,以下内容是nova配置文件中关于rabbit相关的配置:
 
[root@linux-node1 ~]# grep 'rabbit' /etc/nova/nova.conf 
# Deprecated group;name - DEFAULT;rabbit_durable_queues
rabbit_host=10.0.0.149
rabbit_port=5672
#rabbit_hosts=$rabbit_host:$rabbit_port
rabbit_use_ssl=false
rabbit_userid=guest
rabbit_password=guest
#rabbit_login_method=AMQPLAIN
#rabbit_virtual_host=/
#rabbit_retry_interval=1
#rabbit_retry_backoff=2
#rabbit_max_retries=0
#rabbit_ha_queues=false
#fake_rabbit=false
# The messaging driver to use, defaults to rabbit. Other
rpc_backend=rabbit
下面是nova日志目录下的api.log文件内容,
2018-06-22 19:07:25.165 2260 INFO oslo.messaging._drivers.impl_rabbit [-] Connected to AMQP server on 10.0.0.149:5672
2018-06-22 19:07:25.190 2260 INFO oslo.messaging._drivers.impl_rabbit [-] Connected to AMQP server on 10.0.0.149:5672
2018-06-22 19:08:25.208 2260 ERROR nova.api.openstack [req-0e531ab4-0a80-473b-bb90-e937865b7a65 84ee8ed4a5154ceb891c3f5921abfa6e ce967fbddc0b4be08718773d0b1e68bc] Caught error: Timed out waiting for a reply to message ID 060a620bbf0448d6bb05a91c6647cf7f
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack Traceback (most recent call last):
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/api/openstack/__init__.py", line 125, in __call__
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return req.get_response(self.application)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/webob/request.py", line 1296, in send
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     application, catch_exc_info=False)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/webob/request.py", line 1260, in call_application
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     app_iter = application(self.environ, start_response)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return resp(environ, start_response)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/keystoneclient/middleware/auth_token.py", line 679, in __call__
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return self.app(env, start_response)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return resp(environ, start_response)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return resp(environ, start_response)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/routes/middleware.py", line 131, in __call__
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     response = self.app(environ, start_response)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return resp(environ, start_response)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     resp = self.call_func(req, *args, **self.kwargs)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return self.func(req, *args, **kwargs)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/api/openstack/wsgi.py", line 919, in __call__
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     content_type, body, accept)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/api/openstack/wsgi.py", line 985, in _process_stack
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     action_result = self.dispatch(meth, request, action_args)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/api/openstack/wsgi.py", line 1072, in dispatch
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return method(req=request, **action_args)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/api/openstack/compute/servers.py", line 956, in create
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     legacy_bdm=legacy_bdm)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/hooks.py", line 103, in inner
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     rv = f(*args, **kwargs)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/compute/api.py", line 1357, in create
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     legacy_bdm=legacy_bdm)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/compute/api.py", line 984, in _create_instance
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     max_count)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/compute/api.py", line 737, in _validate_and_build_base_options
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     requested_networks, max_count)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/compute/api.py", line 464, in _check_requested_networks
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     max_count)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/network/api.py", line 101, in wrapped
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return func(self, context, *args, **kwargs)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/network/api.py", line 452, in validate_networks
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     requested_networks)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/nova/network/rpcapi.py", line 225, in validate_networks
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return self.client.call(ctxt, 'validate_networks', networks=networks)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/client.py", line 361, in call
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return self.prepare().call(ctxt, method, **kwargs)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/oslo/messaging/rpc/client.py", line 150, in call
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     wait_for_reply=True, timeout=timeout)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/oslo/messaging/transport.py", line 90, in _send
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     timeout=timeout)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/oslo/messaging/_drivers/amqpdriver.py", line 412, in send
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     return self._send(target, ctxt, message, wait_for_reply, timeout)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/oslo/messaging/_drivers/amqpdriver.py", line 403, in _send
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     result = self._waiter.wait(msg_id, timeout)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/oslo/messaging/_drivers/amqpdriver.py", line 267, in wait
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     reply, ending = self._poll_connection(msg_id, timeout)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack   File "/usr/lib/python2.6/site-packages/oslo/messaging/_drivers/amqpdriver.py", line 217, in _poll_connection
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack     % msg_id)
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack MessagingTimeout: Timed out waiting for a reply to message ID 060a620bbf0448d6bb05a91c6647cf7f
2018-06-22 19:08:25.208 2260 TRACE nova.api.openstack 

wpaccp - 80后IT男

rabbitmq的故障,重新检查一下rabbitmq的配置文件,

赵班长 - 不忘初心,方得始终!

这个就是rabbitmq没有启动,1.主机名是否能够解析 ping linux-node    ping linux-node1.example.com   2.查看/var/log/messages日志
谢谢赵班长。。谢谢wpaccp

要回复问题请先登录注册