![nova-compute 和 nova cloud controller 之间的关系错误](https://linux22.com/image/967206/nova-compute%20%E5%92%8C%20nova%20cloud%20controller%20%E4%B9%8B%E9%97%B4%E7%9A%84%E5%85%B3%E7%B3%BB%E9%94%99%E8%AF%AF.png)
我已经根据文档成功设置了 Open Stack 云:Ubuntu 云基础设施。
我的 Juju 环境文件:
environments:
maas:
type: maas
maas-server: 'http://192.168.122.4:80/MAAS'
maas-oauth: 'np2beDGZye5ktAGHZC:xEN8GM5BDtWj2ChAW4:rnX9DBQs7Cv2rRZ9g9jxncpYg4uSkTbL'
admin-secret: 'nothing'
default-series: precise
Juju 为 OpenStack 准备的所有节点都有一张 LAN 卡。我的 MAAS 服务器有一张 LAN 卡,并且有 DHCP 服务器。我没有使用任何 DNS,因为我正在使用文件/etc/hosts
来修复它。
问题来了:
当我运行 Juju status 时,我看到 cloud-compute 与 nova-cloud-controller 之间存在关系错误。我可以登录 OpenStack 仪表板,并且可以在除管理计算部分之外的所有部分中移动,这可能是由于这两个服务器之间存在错误。
当我运行 Juju debug-log 时,看到以下结果:
2013-05-06 21:02:53,108 unit:nova-cloud-controller/1: hook.output DEBUG: Flushed values for hook 'cloud-compute-relation-joined' on 'cloud-compute:22'
Setting changed: u'ec2_host'=u'node-aabbccddeef4.localdomain' (was unset)
Setting changed: u'network_manager'=u'FlatDHCPManager' (was unset)
Setting changed: u'volume_service'=u'nova-volume' (was unset)
2013-05-06 21:02:53,108 unit:nova-cloud-controller/1: hook.executor DEBUG: Hook complete: /var/lib/juju/units/nova-cloud-controller-1/charm/hooks/cloud-compute-relation-joined
2013-05-06 21:02:53,115 unit:nova-cloud-controller/1: hook.scheduler DEBUG: executing hook for nova-compute/0:modified
2013-05-06 21:02:53,116 unit:nova-cloud-controller/1: unit.relation.lifecycle DEBUG: Executing hook cloud-compute-relation-changed
2013-05-06 21:02:53,116 unit:nova-cloud-controller/1: hook.executor DEBUG: Running hook: /var/lib/juju/units/nova-cloud-controller-1/charm/hooks/cloud-compute-relation-changed
2013-05-06 21:02:53,375 unit:nova-compute/0: hook.scheduler DEBUG: settings changed: (('nova-cloud-controller/1', 1),)
2013-05-06 21:02:53,378 unit:nova-compute/0: hook.scheduler DEBUG: executing hook for nova-cloud-controller/1:modified
2013-05-06 21:02:53,378 unit:nova-compute/0: unit.relation.lifecycle DEBUG: Executing hook cloud-compute-relation-changed
2013-05-06 21:02:53,379 unit:nova-compute/0: hook.executor DEBUG: Running hook: /var/lib/juju/units/nova-compute-0/charm/hooks/cloud-compute-relation-changed
2013-05-06 21:02:54,133 unit:nova-cloud-controller/1: hook.output DEBUG: hook cloud-compute-relation-changed exited, exit code 0.
2013-05-06 21:02:54,161 unit:nova-cloud-controller/1: hook.executor DEBUG: Hook complete: /var/lib/juju/units/nova-cloud-controller-1/charm/hooks/cloud-compute-relation-changed
2013-05-06 21:02:54,555 unit:nova-compute/0: hook.output INFO: /var/lib/juju/units/nova-compute-0/charm/hooks/cloud-compute-relation-changed: configuring FlatDHCPManager network manager
2013-05-06 21:02:55,193 unit:nova-compute/0: unit.hook.api DEBUG: Get unit setting: 'private-address'
2013-05-06 21:03:25,361 unit:nova-compute/0: hook.output ERROR: Traceback (most recent call last):
2013-05-06 21:03:25,361 unit:nova-compute/0: hook.output ERROR: File "<string>", line 10, in <module>
2013-05-06 21:03:25,361 unit:nova-compute/0: hook.output ERROR: File "/usr/lib/python2.7/dist-packages/dns/resolver.py", line 770, in query
2013-05-06 21:03:25,362 unit:nova-compute/0: hook.output ERROR:
2013-05-06 21:03:25,362 unit:nova-compute/0: hook.output ERROR: raise_on_no_answer)
2013-05-06 21:03:25,363 unit:nova-compute/0: hook.output ERROR: File "/usr/lib/python2.7/dist-packages/dns/resolver.py", line 698, in query
2013-05-06 21:03:25,363 unit:nova-compute/0: hook.output ERROR:
2013-05-06 21:03:25,366 unit:nova-compute/0: hook.output ERROR: timeout = self._compute_timeout(start)
File "/usr/lib/python2.7/dist-packages/dns/resolver.py", line 568, in _compute_timeout
raise Timeout
dns.exception.Timeout
2013-05-06 21:03:25,589 unit:nova-compute/0: unit.hook.api INFO: Unable to resolve local IP address
2013-05-06 21:03:25,611 unit:nova-compute/0: hook.output DEBUG: hook cloud-compute-relation-changed exited, exit code Traceback (most recent call last):
Failure: juju.errors.CharmInvocationError: Error processing '/var/lib/juju/units/nova-compute-0/charm/hooks/cloud-compute-relation-changed': exit code 1.
.
2013-05-06 21:03:25,611 unit:nova-compute/0: hook.executor DEBUG: Hook error: /var/lib/juju/units/nova-compute-0/charm/hooks/cloud-compute-relation-changed Error processing '/var /lib/juju/units/nova-compute-0/charm/hooks/cloud-compute-relation-changed': exit code 1.
2013-05-06 21:03:25,612 unit:nova-compute/0: unit.relation.lifecycle WARNING: Error in cloud-compute-relation-changed hook: Error processing '/var/lib/juju/units/nova-compute-0/c harm/hooks/cloud-compute-relation-changed': exit code 1.
2013-05-06 21:03:25,612 unit:nova-compute/0: unit.relation.lifecycle INFO: Invoked error handler for cloud-compute-relation-changed hook
2013-05-06 21:03:25,811 unit:nova-compute/0: statemachine DEBUG: relationworkflowstate: transition error (up -> error) {'error_message': "Error processing '/var/lib/juju/units/no va-compute-0/charm/hooks/cloud-compute-relation-changed': exit code 1.", 'change_type': 'modified'}
2013-05-06 21:03:25,811 unit:nova-compute/0: statemachine DEBUG: relationworkflowstate: execute action do_error
2013-05-06 21:03:25,812 unit:nova-compute/0: hook.scheduler DEBUG: stopping
2013-05-06 21:03:25,813 unit:nova-compute/0: unit.relation.lifecycle DEBUG: stopped relation:cloud-compute lifecycle
2013-05-06 21:03:25,944 unit:nova-compute/0: statemachine DEBUG: relationworkflowstate: transition complete error (state error) {'error_message': "Error processing '/var/lib/juju /units/nova-compute-0/charm/hooks/cloud-compute-relation-changed': exit code 1.", 'change_type': 'modified'}
2013-05-06 21:03:25,949 unit:nova-compute/0: hook.scheduler DEBUG: hook error, stopping scheduler execution
2013-05-06 21:03:25,949 unit:nova-compute/0: hook.scheduler INFO: stopped
我是否需要通过定义 OpenStack 的环境对 OpenStack 的 Juju 环境文件进行一些添加?
为了解决上述问题,我尝试使用另一个系统上的 DNS 服务器,而不是用来/etc/hosts
解析 DNS 名称。
我在此新服务器上配置的域名是“ malik.net
”。名称解析工作正常,但 juju 为每个节点安装的服务分配不同的公共地址。例如 juju-status 报告:public-address: node-aab2ccddeeff.localdomain
而它应该是public-address: node-aab2ccddeeff.malik.net
。
节点无法识别 juju 创建的公共地址。然后我必须/etc/hosts
在每个节点上输入节点 IP 和 each_node_name.localdomain。我遇到了同样的关系错误问题。
通过告诉 Juju 使用正确的域名可能会解决这个问题,但我不知道如何做到这一点。
答案1
nova-compute charm 依赖于 IP 地址的 DNS 解析;OpenStack 中的几个功能依赖于 IP 地址而不是主机名,并且 charm 包含直接查询 DNS 来解析主机名 -> IP 地址的代码。
不幸的是,在库存的 cloud-init 构建实例上使用 /etc/hosts 将始终导致主机名 -> IP 地址映射到 127.0.1.1 - 除了本地访问外没有多大用处。
我鼓励您启动并运行 DNS;我不认为 DNS 在 charm 执行环境中发挥作用是一个疯狂的假设。