socket.error:[Errno 13]权限被拒绝---中子代理列表

时间:2017-07-14 06:15:17

标签: openstack openstack-neutron

首先,在计算节点中,neutron-linuxbridge-agent.service状态处于活动状态,正常。

[root@compute1 neutron]# systemctl status neutron-linuxbridge-agent.service  -l
● neutron-linuxbridge-agent.service - OpenStack Neutron Linux Bridge Agent
   Loaded: loaded (/usr/lib/systemd/system/neutron-linuxbridge-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2017-07-14 13:48:38 CST; 113ms ago
  Process: 116170 ExecStartPre=/usr/bin/neutron-enable-bridge-firewall.sh (code=exited, status=0/SUCCESS)
 Main PID: 116177 (neutron-linuxbr)
   CGroup: /system.slice/neutron-linuxbridge-agent.service
           └─116177 /usr/bin/python2 /usr/bin/neutron-linuxbridge-agent --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/linuxbridge_agent.ini --config-dir /etc/neutron/conf.d/common --config-dir /etc/neutron/conf.d/neutron-linuxbridge-agent --log-file /var/log/neutron/linuxbridge-agent.log

Jul 14 13:48:38 compute1 systemd[1]: Starting OpenStack Neutron Linux Bridge Agent...
Jul 14 13:48:38 compute1 neutron-enable-bridge-firewall.sh[116170]: net.bridge.bridge-nf-call-arptables = 1
Jul 14 13:48:38 compute1 neutron-enable-bridge-firewall.sh[116170]: net.bridge.bridge-nf-call-iptables = 1
Jul 14 13:48:38 compute1 neutron-enable-bridge-firewall.sh[116170]: net.bridge.bridge-nf-call-ip6tables = 1
Jul 14 13:48:38 compute1 systemd[1]: Started OpenStack Neutron Linux Bridge Agent.

但我无法列出中子代理:

[root@compute1 neutron]# neutron agent-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
An auth plugin is required to fetch a token

在计算节点中,我还可以找到/var/log/neutron/linuxbridge-agent.log

的日志
2017-07-14 13:44:58.106 114191 CRITICAL neutron [-] Exception: Failed to spawn rootwrap process.
stderr:
Traceback (most recent call last):
  File "/usr/bin/neutron-rootwrap-daemon", line 10, in <module>
    sys.exit(daemon())
  File "/usr/lib/python2.7/site-packages/oslo_rootwrap/cmd.py", line 57, in daemon
    return main(run_daemon=True)
  File "/usr/lib/python2.7/site-packages/oslo_rootwrap/cmd.py", line 98, in main
    daemon_mod.daemon_start(config, filters)
  File "/usr/lib/python2.7/site-packages/oslo_rootwrap/daemon.py", line 110, in daemon_start
    server = manager.get_server()
  File "/usr/lib64/python2.7/multiprocessing/managers.py", line 493, in get_server
    self._authkey, self._serializer)
  File "/usr/lib64/python2.7/multiprocessing/managers.py", line 162, in __init__
    self.listener = Listener(address=address, backlog=16)
  File "/usr/lib/python2.7/site-packages/oslo_rootwrap/jsonrpc.py", line 66, in __init__
    self._socket.bind(address)
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 13] Permission denied

2017-07-14 13:44:58.106 114191 ERROR neutron Traceback (most recent call last):
2017-07-14 13:44:58.106 114191 ERROR neutron   File "/usr/bin/neutron-linuxbridge-agent", line 10, in <module>
2017-07-14 13:44:58.106 114191 ERROR neutron     sys.exit(main())
2017-07-14 13:44:58.106 114191 ERROR neutron   File "/usr/lib/python2.7/site-
packages/neutron/cmd/eventlet/plugins/linuxbridge_neutron_agent.py", line 21
2017-07-14 13:44:58.106 114191 ERROR neutron   File "/usr/bin/neutron-linuxbridge-agent", line 10, in <module>
2017-07-14 13:44:58.106 114191 ERROR neutron     sys.exit(main())
2017-07-14 13:44:58.106 114191 ERROR neutron   File "/usr/lib/python2.7/site-packages/neutron/cmd/eventlet/plugins/linuxbridge_neutron_agent.py", line 21, in main
2017-07-14 13:44:58.106 114191 ERROR neutron     agent_main.main()
2017-07-14 13:44:58.106 114191 ERROR neutron   File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py", line 921, in main
2017-07-14 13:44:58.106 114191 ERROR neutron     manager = LinuxBridgeManager(bridge_mappings, interface_mappings)
2017-07-14 13:44:58.106 114191 ERROR neutron   File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py", line 81, in __init__
2017-07-14 13:44:58.106 114191 ERROR neutron     self.check_vxlan_support()
2017-07-14 13:44:58.106 114191 ERROR neutron   File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py", line 659, in check_vxlan_support
2017-07-14 13:44:58.106 114191 ERROR neutron     if self.vxlan_ucast_supported():
2017-07-14 13:44:58.106 114191 ERROR neutron   File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py", line 623, in vxlan_ucast_supported
2017-07-14 13:44:58.106 114191 ERROR neutron     test_iface = self.ensure_vxlan(seg_id)
2017-07-14 13:44:58.106 114191 ERROR neutron   File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py", line 300, in ensure_vxlan

/etc/neutron/plugins/ml2/linuxbridge_agent.ini的配置:

[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

[vxlan]
enable_vxlan = True
local_ip = 10.2.2.121
l2_population = True

在我的控制器节点中,我看不到计算机的中子代理:

[root@controller neutron]# neutron agent-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
| id                                   | agent_type         | host       | availability_zone | alive | admin_state_up | binary                    |
+--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
| 18535c11-49ee-4e9e-a889-623a1d324c82 | L3 agent           | controller | nova              | :-)   | True           | neutron-l3-agent          |
| 1c2c3b41-a678-4645-be0d-7d885e4dce7a | DHCP agent         | controller | nova              | :-)   | True           | neutron-dhcp-agent        |
| 7e401de6-f501-447b-aa7a-11f0f74f770a | Linux bridge agent | controller |                   | :-)   | True           | neutron-linuxbridge-agent |
| c9c25e82-11fd-4fce-8bef-91915615620a | Metadata agent     | controller |                   | :-)   | True           | neutron-metadata-agent    |
+--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+

1 个答案:

答案 0 :(得分:0)

最后我解决了这个问题。

首先,确保计算节点安装了openstack-selinux,如果没有:

yum install -y openstack-selinux 

如果仍然无效,请禁用selinux:

setenforce 0