我们已经使用 Juju + MAAS 在分布式节点上安装了 Openstack。一切看起来都很好,但 Neutron cli 没有响应。
user@controller:~$ nova list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+
user@controller:~$
user@controller:~$ neutron --version
2.3.4
user@controller:~$
user@controller:~$ neutron net-list
Connection to neutron failed: (504, 'Gateway Timeout')
user@controller:~$
如果我们按下 CRTL+C,我们会得到:
user@controller:~$ neutron net-list
^CTraceback (most recent call last):
File "/usr/bin/neutron", line 10, in <module>
sys.exit(main())
<snip>
File "/usr/lib/python2.7/dist-packages/neutronclient/client.py", line 239, in authenticate
content_type="application/json")
File "/usr/lib/python2.7/dist-packages/neutronclient/client.py", line 146, in _cs_request
resp, body = self.request(*args, **kargs)
File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1569, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1316, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 1251, in _conn_request
conn.connect()
File "/usr/lib/python2.7/dist-packages/httplib2/__init__.py", line 900, in connect
self.sock.connect((self.host, self.port) + sa[2:])
File "/usr/lib/python2.7/dist-packages/httplib2/socks.py", line 424, in connect
self.__negotiatehttp(destpair[0], destpair[1])
File "/usr/lib/python2.7/dist-packages/httplib2/socks.py", line 374, in __negotiatehttp
resp = self.recv(1)
KeyboardInterrupt
连接方面,所有服务都在同一个 LAN 上,我们可以 ping/ssh 到所有节点。一些故障排除日志:
ubuntu@juju-machine-13-lxc-4:~$ cat /var/log/neutron/server.log | grep WARNING
<snip>
2015-05-12 04:21:47.680 32427 WARNING neutron.openstack.common.db.sqlalchemy.session [-] This application has not enabled MySQL traditional mode, which means silent data corruption may occur. Please encourage the application developers to enable this mode.
2015-05-12 04:21:48.386 32427 WARNING neutron.api.extensions [req-42b7d5c5-813d-470d-9a06-21e675c78ae5 None] Extension allowed-address-pairs not supported by any of loaded plugins
2015-05-12 04:21:48.398 32427 WARNING neutron.api.extensions [req-42b7d5c5-813d-470d-9a06-21e675c78ae5 None] Extension flavor not supported by any of loaded plugins
2015-05-12 04:21:48.415 32427 WARNING neutron.api.extensions [req-42b7d5c5-813d-470d-9a06-21e675c78ae5 None] Extension port-security not supported by any of loaded plugins
2015-05-12 04:21:48.419 32427 WARNING neutron.api.extensions [req-42b7d5c5-813d-470d-9a06-21e675c78ae5 None] Extension routed-service-insertion not supported by any of loaded plugins
2015-05-12 04:21:48.420 32427 WARNING neutron.api.extensions [req-42b7d5c5-813d-470d-9a06-21e675c78ae5 None] Extension router-service-type not supported by any of loaded plugins
2015-05-12 04:21:48.424 32427 WARNING neutron.api.extensions [req-42b7d5c5-813d-470d-9a06-21e675c78ae5 None] Extension security-group not supported by any of loaded plugins
2015-05-12 04:21:48.461 32427 WARNING keystoneclient.middleware.auth_token [-] Configuring auth_uri to point to the public identity endpoint is required; clients may not be able to authenticate against an admin endpoint
中子配置:
ubuntu@juju-machine-13-lxc-4:~$ sudo cat /etc/neutron/neutron.conf
# icehouse
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
## Restart trigger None
###############################################################################
<snip>
[keystone_authtoken]
signing_dir = /var/cache/neutron
service_protocol = http
service_host = 10.0.0.21
service_port = 5000
auth_host = 10.0.0.21
auth_port = 35357
auth_protocol = http
admin_tenant_name = services
admin_user = quantum
admin_password = GY4BYj8M5Rx3FymxkJzMmbHcnVBTsxMG35nBJpN8VRcx3zxMbx6F4tBNbL4jTwyP
[database]
connection = mysql://neutron:[email protected]/neutron
max_pool_size = 256
我们注意到 api-paste.ini 上没有 auth_uri
ubuntu@juju-machine-13-lxc-4:~$ sudo cat /etc/neutron/api-paste.ini
<snip>
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
因此我们在 api-paste.ini 中添加了以下内容,清除了 auth_uri 警告。
auth_host = 10.0.0.21
auth_uri = http://10.0.0.21:5000/v2.0
admin_tenant_name = services
admin_user = quantum
admin_password = GY4BYj8M5Rx3FymxkJzMmbHcnVBTsxMG35nBJpN8VRcx3zxMbx6F4tBNbL4jTwyP
在 Horizon 上我们最初有以下网络代理:
- Open vSwitch 代理
我们在网络节点上执行了下列操作:
ubuntu@juju-machine-13-lxc-4:~$ sudo apt-get install neutron-server neutron-dhcp-agent neutron-plugin-openvswitch-agent neutron-l3-agent
Reading package lists… Done
<snip>
其中添加了一些网络代理:
- Open vSwitch 代理
- 元数据代理
- DHCP 代理
但这并没有消除其他警告,我们仍然看不到 L3-agent,也无法执行 Neutron cli 命令。有什么线索吗?
ubuntu@juju-machine-13-lxc-4:~$ dpkg -l | grep neutron
ii neutron-common 1:2014.1.4-0ubuntu2 all Neutron is a virtual network service for Openstack - common
ii neutron-dhcp-agent 1:2014.1.4-0ubuntu2 all Neutron is a virtual network service for Openstack - DHCP agent
ii neutron-l3-agent 1:2014.1.4-0ubuntu2 all Neutron is a virtual network service for Openstack - l3 agent
ii neutron-metadata-agent 1:2014.1.4-0ubuntu2 all Neutron is a virtual network service for Openstack - metadata agent
ii neutron-plugin-ml2 1:2014.1.4-0ubuntu2 all Neutron is a virtual network service for Openstack - ML2 plugin
ii neutron-plugin-openvswitch-agent 1:2014.1.4-0ubuntu2 all Neutron is a virtual network service for Openstack - Open vSwitch plugin agent
ii neutron-server 1:2014.1.4-0ubuntu2 all Neutron is a virtual network service for Openstack - server
ii python-neutron 1:2014.1.4-0ubuntu2 all Neutron is a virutal network service for Openstack - Python library
ii python-neutronclient 1:2.3.4-0ubuntu1 all client - Neutron is a virtual network service for Openstack
ubuntu@juju-machine-13-lxc-4:~$
通过不同的魅力组合,我们得到相同的结果:
运行 nova-cloud-controller charm neutron-api 时,将 quantum-gateway charm 和 network-manager 设置为 Neutron 以及
运行 nova-cloud-controller charm 时,使用或不使用 network-manager 作为 Neutron 的 neutron-openvswitch charm
谢谢