好人
分类: 云计算
2015-12-29 20:44:32
按照官方文档做到添加compute服务时,列出服务组件以验证是否每个进程都成功启动:$ nova service-list
发现如下结果:(缺少nova-compute的服务)
[root@controller ~]# nova service-list
+----+------------------+------------------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+----+------------------+------------------------+----------+---------+-------+----------------------------+-----------------+
| 1 | nova-conductor | controller.localdomain | internal | enabled | up | 2015-11-11T10:09:18.000000 | - |
| 2 | nova-consoleauth | controller.localdomain | internal | enabled | up | 2015-11-11T10:09:11.000000 | - |
| 3 | nova-cert | controller.localdomain | internal | enabled | up | 2015-11-11T10:09:16.000000 | - |
| 4 | nova-scheduler | controller.localdomain | internal | enabled | up | 2015-11-11T10:09:18.000000 | - |
+----+------------------+------------------------+----------+---------+-------+----------------------------+-----------------+
首先看看是不是各个节点的ntp服务没有同步,时间间隔太长导致的服务down掉 很常见。
如果不是ntp的原因的话那就在看看以下原因
在这里卡了好几天,网上查原因,发现查看相关日志
计算节点的nova-compute日志如下
[root@compute1 ~]# tail -f /var/log/nova/nova-compute.log
...
2015-11-11 18:05:02.355 4808 INFO oslo.messaging._drivers.impl_rabbit [req-5a3faf3b-ff10-40e2-a2ba-688ca9bfa187 ] Delaying reconnect for 1.0 seconds...
2015-11-11 18:05:03.357 4808 INFO oslo.messaging._drivers.impl_rabbit [req-5a3faf3b-ff10-40e2-a2ba-688ca9bfa187 ] Connecting to AMQP server on controller:5672
2015-11-11 18:05:03.382 4808 ERROR oslo.messaging._drivers.impl_rabbit [req-5a3faf3b-ff10-40e2-a2ba-688ca9bfa187 ] AMQP server on controller:5672 is unreachable: [Errno 113] EHOSTUNREACH. Trying again in 15 seconds.
启用iptables,在rabbitmq server端加入如下规则,开放rabbitmq端口(5672),允许其他主机访问rabbitmq server:
# iptables -I INPUT -p tcp --dport 5672 -j ACCEPT
#添加规则
# service iptables save
#保存设置
# service iptables restart
# 重启iptables,生效规则
现在再次重启nova-compute服务,发现他可以起来了,问题解决
[root@controller ~]# nova service-list
+----+------------------+------------------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+----+------------------+------------------------+----------+---------+-------+----------------------------+-----------------+
| 1 | nova-conductor | controller.localdomain | internal | enabled | up | 2015-11-11T10:12:58.000000 | - |
| 2 | nova-consoleauth | controller.localdomain | internal | enabled | up | 2015-11-11T10:13:01.000000 | - |
| 3 | nova-cert | controller.localdomain | internal | enabled | up | 2015-11-11T10:12:57.000000 | - |
| 4 | nova-scheduler | controller.localdomain | internal | enabled | up | 2015-11-11T10:12:58.000000 | - |
| 5 | nova-compute | compute1.localdomain | nova | enabled | up | 2015-11-11T10:12:56.000000 | - |
+----+------------------+------------------------+----------+---------+-------+----------------------------+-----------------+