Python /usr/bin/systemctl启动openstack nova api失败

Python /usr/bin/systemctl启动openstack nova api失败,python,openstack,openstack-nova,openstack-neutron,Python,Openstack,Openstack Nova,Openstack Neutron,安装packstack时出错 ERROR : Error appeared during Puppet run: x.x.x.x_api_nova.pp Error: Could not start Service[nova-api]: Execution of '/usr/bin/systemctl start openstack-nova-api' returned 1: Job for openstack-nova-api.service failed because the contro

安装packstack时出错

ERROR : Error appeared during Puppet run: x.x.x.x_api_nova.pp
Error: Could not start Service[nova-api]: Execution of '/usr/bin/systemctl start openstack-nova-api' returned 1: Job for openstack-nova-api.service failed because the control process exited with error code. See "systemctl status openstack-nova-api.service" and "journalctl -xe" for details.
You will find full trace in log /var/tmp/packstack/20160426-103906-Zre0yo/manifests/x.x.x.x_api_nova.pp.log'


Apr 26 10:50:13 localhost.localdomain systemd[1]: Unit openstack-nova-api.service entered failed state.
Apr 26 10:50:13 localhost.localdomain systemd[1]: openstack-nova-api.service failed.
Apr 26 10:50:13 localhost.localdomain setroubleshoot[6359]: SELinux is preventing /usr/bin/python2.7 from getattr access on the file /usr/bin/rpm. For comple
Apr 26 10:50:13 localhost.localdomain python[6359]: SELinux is preventing /usr/bin/python2.7 from getattr access on the file /usr/bin/rpm.

                                                    *****  Plugin catchall (100. confidence) suggests   **************************

                                                    If you believe that python2.7 should be allowed getattr access on the rpm file by default.
                                                    Then you should report this as a bug.
                                                    You can generate a local policy module to allow this access.
                                                    Do
                                                    allow this access for now by executing:
                                                    # grep nova-novncproxy /var/log/audit/audit.log | audit2allow -M mypol
                                                    # semodule -i mypol.pp

Apr 26 10:50:13 localhost.localdomain systemd[1]: openstack-nova-api.service holdoff time over, scheduling restart.
Apr 26 10:50:13 localhost.localdomain systemd[1]: Starting OpenStack Nova API Server...
-- Subject: Unit openstack-nova-api.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit openstack-nova-api.service has begun starting up.
Apr 26 10:50:15 localhost.localdomain python2[9047]: detected unhandled Python exception in '/usr/bin/nova-api'
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: error: cannot open Packages database in /var/lib/rpm
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: Traceback (most recent call last):
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: File "/usr/bin/nova-api", line 10, in <module>
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: sys.exit(main())
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: File "/usr/lib/python2.7/site-packages/nova/cmd/api.py", line 41, in main
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: config.parse_args(sys.argv)
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: File "/usr/lib/python2.7/site-packages/nova/config.py", line 65, in parse_args
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: default_config_files=default_config_files)
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2171, in __call__
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: self._namespace._files_permission_denied)
Apr 26 10:50:15 localhost.localdomain nova-api[9047]: oslo_config.cfg.ConfigFilesPermissionDeniedError: Failed to open some config files: /etc/nova/nova.conf
Apr 26 10:50:15 localhost.localdomain setroubleshoot[6359]: SELinux is preventing /usr/bin/python2.7 from getattr access on the file /usr/bin/rpm. For comple
Apr 26 10:50:15 localhost.localdomain python[6359]: SELinux is preventing /usr/bin/python2.7 from getattr access on the file /usr/bin/rpm.

                                                    *****  Plugin catchall (100. confidence) suggests   **************************

                                                    If you believe that python2.7 should be allowed getattr access on the rpm file by default.
                                                    Then you should report this as a bug.
                                                    You can generate a local policy module to allow this access.
                                                    Do
                                                    allow this access for now by executing:
                                                    # grep nova-novncproxy /var/log/audit/audit.log | audit2allow -M mypol
                                                    # semodule -i mypol.pp

Apr 26 10:50:15 localhost.localdomain systemd[1]: openstack-nova-api.service: main process exited, code=exited, status=1/FAILURE
Apr 26 10:50:15 localhost.localdomain systemd[1]: Failed to start OpenStack Nova API Server.
-- Subject: Unit openstack-nova-api.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit openstack-nova-api.service has failed.
--
-- The result is failed.
Apr 26 10:50:15 localhost.localdomain systemd[1]: Unit openstack-nova-api.service entered failed state.
Apr 26 10:50:15 localhost.localdomain systemd[1]: openstack-nova-api.service failed.
'
错误:Puppet运行期间出现错误:x.x.x.x_api_nova.pp
错误:无法启动服务[nova api]:执行“/usr/bin/systemctl start openstack nova api”返回1:openstack-nova-api的作业。服务失败,因为控制进程已退出,并显示错误代码。有关详细信息,请参阅“systemctl状态openstack nova api.service”和“journalctl-xe”。
您将在log/var/tmp/packstack/20160426-103906-Zre0yo/manifests/x.x.x_api_nova.pp.log'中找到完整跟踪信息
Apr 26 10:50:13 localhost.localdomain systemd[1]:单元openstack-nova-api.service进入失败状态。
4月26日10:50:13 localhost.localdomain systemd[1]:openstack-nova-api.service失败。
四月26日10:50:13 localhost.localdomain setroubleshoot[6359]:SELinux正在阻止/usr/bin/python2.7对文件/usr/bin/rpm的getattr访问。复杂的
Apr 26 10:50:13 localhost.localdomain python[6359]:SELinux正在阻止/usr/bin/python2.7对文件/usr/bin/rpm的getattr访问。
*****插件catchall(100.confidence)建议**************************
如果您认为默认情况下应该允许python2.7对rpm文件进行getattr访问。
然后,您应该将其报告为bug。
您可以生成本地策略模块以允许此访问。
做
通过执行以下操作暂时允许此访问:
#grep nova novncproxy/var/log/audit/audit.log | audit2allow-M mypol
#semodule-i mypol.pp
4月26日10:50:13 localhost.localdomain systemd[1]:openstack-nova-api.service延迟时间结束,计划重新启动。
Apr 26 10:50:13 localhost.localdomain systemd[1]:正在启动OpenStack Nova API服务器。。。
--主题:openstack-nova-api.service单元已开始启动
--定义人:systemd
--支持:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
--openstack-nova-api.service单元已开始启动。
Apr 26 10:50:15 localhost.localdomain python2[9047]:在“/usr/bin/nova api”中检测到未处理的Python异常
Apr 26 10:50:15 localhost.localdomain nova api[9047]:错误:无法在/var/lib/rpm中打开包数据库
Apr 26 10:50:15 localhost.localdomain nova api[9047]:回溯(最近一次调用):
四月26日10:50:15 localhost.localdomain nova api[9047]:文件“/usr/bin/nova api”,第10行,在
Apr 26 10:50:15 localhost.localdomain nova api[9047]:sys.exit(main())
4月26日10:50:15 localhost.localdomain nova api[9047]:文件“/usr/lib/python2.7/site packages/nova/cmd/api.py”,第41行,主目录
Apr 26 10:50:15 localhost.localdomain nova api[9047]:config.parse_args(sys.argv)
Apr 26 10:50:15 localhost.localdomain nova api[9047]:文件“/usr/lib/python2.7/site packages/nova/config.py”,第65行,在parse_args中
四月26日10:50:15 localhost.localdomain nova api[9047]:默认配置文件=默认配置文件)
4月26日10:50:15 localhost.localdomain nova api[9047]:文件“/usr/lib/python2.7/site packages/oslo_config/cfg.py”,第2171行,在调用中__
Apr 26 10:50:15 localhost.localdomain nova api[9047]:self.\u名称空间.\u文件\u权限\u被拒绝)
4月26日10:50:15 localhost.localdomain nova api[9047]:oslo_config.cfg.configfilespmissiondeniedror:无法打开某些配置文件:/etc/nova/nova.conf
四月26日10:50:15 localhost.localdomain setroubleshoot[6359]:SELinux正在阻止/usr/bin/python2.7对文件/usr/bin/rpm的getattr访问。复杂的
Apr 26 10:50:15 localhost.localdomain python[6359]:SELinux正在阻止/usr/bin/python2.7对文件/usr/bin/rpm的getattr访问。
*****插件catchall(100.confidence)建议**************************
如果您认为默认情况下应该允许python2.7对rpm文件进行getattr访问。
然后,您应该将其报告为bug。
您可以生成本地策略模块以允许此访问。
做
通过执行以下操作暂时允许此访问:
#grep nova novncproxy/var/log/audit/audit.log | audit2allow-M mypol
#semodule-i mypol.pp
Apr 26 10:50:15 localhost.localdomain systemd[1]:openstack-nova-api.service:主进程退出,代码=退出,状态=1/失败
Apr 26 10:50:15 localhost.localdomain systemd[1]:无法启动OpenStack Nova API服务器。
--主题:单元openstack-nova-api.service失败
--定义人:systemd
--支持:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
--单元openstack-nova-api.service失败。
--
--结果是失败的。
Apr 26 10:50:15 localhost.localdomain systemd[1]:单元openstack-nova-api.service进入失败状态。
4月26日10:50:15 localhost.localdomain systemd[1]:openstack-nova-api.service失败。
'

从日志中看,似乎是SELinux问题:
SELinux正在阻止/usr/bin/python2.7对文件/usr/bin/rpm的getattr访问

您可以禁用selinux或使用audit2allow获取它所需的权限,并使用
sedmodule
添加它。它说明了在日志中运行什么:

# grep nova-novncproxy /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

请阅读您的日志转储是如何呈现的。此外,这个网站是为编程问题,而你的不是。最后,在不显示任何努力的情况下(见启发性问题指南),你可能不会在任何社区得到帮助,所以考虑雇佣一个专业人员。试着阅读和理解这一行:<代码>