openstack 安装常见配置和错误处理

Posted 张某人ER

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openstack 安装常见配置和错误处理相关的知识,希望对你有一定的参考价值。

问题一:重启机器出现组件没法互通

 

openstack Failed to connect to server code:1006

 

重启后出现组件无法互通,很可能是因为防火墙问题。

简单的方法:iptables-F  


注:不过,还是建议学习iptables,添加相应的规则


问题二:实时查看某些日志的输出:

例如查看实时日志nova-compute.log,以便实时调试组件问题

cd /var/log/nova/
tail-f nova-compute.log


问题三:关闭selinux


修改/etc/selinux/config 文件

SELINUX=enforcing改为SELINUX=disabled

重启机器即可


问题四:启动虚拟机时:

报错信息:

Sending discover...

Sending discover...

Sending discover...

Usage: /sbin/cirros-dhcpc <up|down>

No lease, failing

WARN: /etc/rc3.d/S40-network failed

cirros-ds 'net' up at 181.35

checking http://169.254.169.254/2009-04-04/instance-id

failed 1/20: up 181.37. request failed

failed 2/20: up 183.66. request failed

failed 3/20: up 185.67. request failed

failed 4/20: up 187.68. request failed

failed 5/20: up 189.69. request failed

failed 6/20: up 191.70. request failed

failed 7/20: up 193.71. request failed

failed 8/20: up 195.72. request failed



问题无法获得dhcp的ip

1 检查相关服务,是否正常 neutron ext-list

2 各种服务都正常,考虑防火墙

3 具体查看相关日志

我在安装时,通过查看日志,遇到的主要问题是

以下是日志片段:

packages/nova/virt/libvirt/driver.py", line 4183, in _get_guest_xml

2016-04-28 11:13:55.583 1892 TRACE nova.compute.manager [instance: 0d378398-b6c1-41fd-ac25-98c9ec3c498b]     context)

2016-04-28 11:13:55.583 1892 TRACE nova.compute.manager [instance: 0d378398-b6c1-41fd-ac25-98c9ec3c498b]   File "/usr/lib/python2.7/site-

 

packages/nova/virt/libvirt/driver.py", line 4054, in _get_guest_config

2016-04-28 11:13:55.583 1892 TRACE nova.compute.manager [instance: 0d378398-b6c1-41fd-ac25-98c9ec3c498b]     flavor, virt_type)

2016-04-28 11:13:55.583 1892 TRACE nova.compute.manager [instance: 0d378398-b6c1-41fd-ac25-98c9ec3c498b]   File "/usr/lib/python2.7/site-

 

packages/nova/virt/libvirt/vif.py", line 374, in get_config

2016-04-28 11:13:55.583 1892 TRACE nova.compute.manager [instance: 0d378398-b6c1-41fd-ac25-98c9ec3c498b]     _("Unexpected vif_type=%s") %

 

vif_type)

2016-04-28 11:13:55.583 1892 TRACE nova.compute.manager [instance: 0d378398-b6c1-41fd-ac25-98c9ec3c498b] NovaException: Unexpected

 

vif_type=binding_failed

 

及虚拟机在绑定虚拟tap口出了问题,考虑相关ovs的环境。

首先查看服务


出现ovs agent起不来

systemctl status neutron-openvswitch-agent.service


.neutron-openvswitch-agent.service - OpenStack Neutron Open vSwitch Agent

   Loaded: loaded (/usr/lib/systemd/system/neutron-openvswitch-agent.service; enabled; vendor preset: disabled)

   Active: failed (Result: exit-code) since Fri 2016-04-29 18:59:58 CST; 6 days ago

  Process: 14269 ExecStart=/usr/bin/neutron-openvswitch-agent --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-

 

file /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini --config-dir /etc/neutron/conf.d/neutron-openvswitch-agent --log-file /var/log/neutron/openvswitch-

 

agent.log (code=exited, status=1/FAILURE)

 Main PID: 14269 (code=exited, status=1/FAILURE)

 

Apr 29 18:59:58 compute2 neutron-openvswitch-agent[14269]: File "/usr/lib/python2.7/site-packages/neutron/plugins/openvswitch/agent/ovs_neutron_agent.py",

 

line 1731, in main

Apr 29 18:59:58 compute2 neutron-openvswitch-agent[14269]: common_config.init(sys.argv[1:])

Apr 29 18:59:58 compute2 neutron-openvswitch-agent[14269]: File "/usr/lib/python2.7/site-packages/neutron/common/config.py", line 185, in init

Apr 29 18:59:58 compute2 neutron-openvswitch-agent[14269]: **kwargs)

Apr 29 18:59:58 compute2 neutron-openvswitch-agent[14269]: File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 1860, in __call__

Apr 29 18:59:58 compute2 neutron-openvswitch-agent[14269]: self._namespace._files_permission_denied)

Apr 29 18:59:58 compute2 neutron-openvswitch-agent[14269]: oslo_config.cfg.ConfigFilesPermissionDeniedError: Failed to open some config files:

 

/etc/neutron/neutron.conf

Apr 29 18:59:58 compute2 systemd[1]: neutron-openvswitch-agent.service: main process exited, code=exited, status=1/FAILURE

Apr 29 18:59:58 compute2 systemd[1]: Unit neutron-openvswitch-agent.service entered failed state.

Apr 29 18:59:58 compute2 systemd[1]: neutron-openvswitch-agent.service failed.


 

同时,ovs-vsctl list-br,发现没有初始的网桥br-int 和br-tun,重新安装openvswitch


问题五:

出现如下错误:

ERROR oslo_messaging.rpc.dispatcher[req-aebb7256-1ff5-46ee-a7e4-675ffc12da38 0b9a1adea1484c6e811992526d07e9616f49fbf57719406dbe14996a7f1a7a2e - - -] Exception during message handling:[Errno 13] Permission denied:u'/var/lock/cinder/cinder-d44ed535-d4f0-4e0b-83d1-f2c211397b66'

2016-05-20 14:34:24.519 12949 ERRORoslo_messaging._drivers.common [req-aebb7256-1ff5-46ee-a7e4-675ffc12da380b9a1adea1484c6e811992526d07e961 6f49fbf57719406dbe14996a7f1a7a2e - - -]Returning exception [Errno 13] Permission denied:u'/var/lock/cinder/cinder-d44ed


关键字:Permission denied

mkdir /var/lock/cinder 
chmod 777/var/lock/cinder/ 
chown -R cinder:cinder /var/lock/cinder/


在安装openstack启动组件时,会出现很多因为配置文件权限问题导致组件启动不了,查看相关日志,一般都可以看到是哪个日志的权限问题,修改即可。


相似的问题:

glance-api服务起不来

 日志显示:

Loaded: loaded(/usr/lib/systemd/system/openstack-glance-api.service; enabled; vendor preset:disabled

 解决办法:

chown -R glance:glance /var/log/glance/api.log

 

执行nova-managedb sync出错,查看日志,又是权限问题:

 解决方案:

chown -R nova:nova /var/log/nova/nova-manage.log

chown -R nova:nova /etc/nova/nova.conf

 

问题六:

You must providea username via either --os-username or env[OS_USERNAME]

 

source admin-openrc.sh 一下即可

 admin-openrc.sh文件内容:

#export OS_PROJECT_DOMAIN_ID=default

#export OS_USER_DOMAIN_ID=default

export OS_PROJECT_NAME=admin

export OS_TENANT_NAME=admin

export OS_USERNAME=admin

export OS_PASSWORD=admin

export OS_AUTH_URL=http://controller:35357/v2.0/

#export OS_IMAGE_API_VERSION=2

export OS_TOKEN=openstack

export OS_URL=http://controller:35357/v2.0/

export OS_REGION_NAME=RegionOne



注:然而笔者在进行下面组件的安装时,会出现AUTH_URL版本错乱的问题,后面组件的相关配置文件(官方文档中),认证URL均是v2版,如果source这个文件,会出现无法找到认证服务的错误。


问题七:

出现信息:

The request you have made requires authentication. (HTTP401)ERROR: openstack The request you have made requires authentication. (HTTP401) (Request-ID: req-47b824f1-61af-448b-af62-47e96d98513f)

 

解决办法:

unset OS_TOKEN OS_URL

openstack --os-auth-url http://controller:35357 \\

--os-project-name admin --os-username admin--os-auth-typepassword \\

token issue

 

以上是关于openstack 安装常见配置和错误处理的主要内容,如果未能解决你的问题,请参考以下文章

PackStack一键安装OpenStack

常见发运错误

安装配置好openstack环境的虚拟机,须要改动ip时,在数据库中同步改动ip的方法

安装M版本错误问题及解决

安装openstack验证keystone时出现错误怎么处理,求大神处理

Untunbu下postgresql安装及常见错误处理