openstack排错

1、排错方法:node

一、查看日志路径为/var/log,具体哪一个组件出了问题进入其目录查看。mysql

二、debugsql

root@sc-ctrl01:~# keystone --debug user-list

root@sc-ctrl01:~# nova --debug list

三、grepubuntu

root@sc-ctrl01:~# grep -ri error /var/log/*

 

2、具体错误:服务器

一、登陆dashboard显示错误,ui

查看日志/var/log/upstart/neutron-server.logurl

2015-01-06 17:41:07.571 11110 ERROR neutron.openstack.common.rpc.common [-] AMQP server on localhost:5672 is unreachable: Socket closed. Trying again in 30 seconds.debug

是由于neutron寻找rabbitMQ服务错误,定位到localhost:5672解决:在/etc/neutron/neutron.conf中检查全部和rabbitmq相关配置:rest

rabbit_host =10.1.101.11日志

rabbit_password = password

rabbit_port = 5672

rabbit_hosts =controller:5672

rabbit_userid = guest

而后重启neutron服务和rabbitmq服务。

cd /etc/init.d/; for i in $( ls neutron-* ); do sudo service $i restart; done

service rabbitmq-server restart

------------------------------------

查看rabbitmq服务是否容许在rabbit服务器

# systemctl status rabbitmq-server.service -l

查看rabbitmq状态

#rabbitmqctl status

查看guest是否存在:

# rabbitmqctl list_users |grep guest

修改密码:

#rabbitmqctl change_password guest somepassword

查看compute节点是否能够和rabbit 服务器创建链接

#lsof -i :5672|grep 'compute_node_ip'

二、建立虚拟机失败:错误: 建立实例 "vm001" 失败: 请稍后再试 [错误: No valid host was found. ].

先查看compute是否已经起了,在controller节点执行nova service-list

root@ubuntu:~# nova service-list
+------------------+--------+----------+---------+-------+----------------------------+-----------------+
| Binary           | Host   | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+------------------+--------+----------+---------+-------+----------------------------+-----------------+
| nova-conductor   | ubuntu | internal | enabled | up    | 2015-01-08T01:10:32.000000 | -               |
| nova-cert        | ubuntu | internal | enabled | up    | 2015-01-08T01:10:35.000000 | -               |
| nova-consoleauth | ubuntu | internal | enabled | up    | 2015-01-08T01:10:27.000000 | -               |
| nova-scheduler   | ubuntu | internal | enabled | up    | 2015-01-08T01:10:27.000000 | -               |
+------------------+--------+----------+---------+-------+----------------------------+-----------------+

能够看到nova-compute服务没有起,

我是在Ubuntu虚拟机上部署,由于hypervisor/CPU不支持虚拟化,能够经过命令$ egrep -c '(vmx|svm)' /proc/cpuinfo查看,若是返回0就是不支持。

因此要将/etc/nova/nova-compute.conf内容替换为:

[DEFAULT]
compute_driver=libvirt.LibvirtDriver
[libvirt]
virt_type=qemu

 而后重启service nova-compute restart,如今nova-compute就up了。

三、建立虚拟机失败: 错误: 建立实例 "vm001" 失败: 请稍后再试 [错误: Virtual Interface creation failed].
修改controller节点的/etc/neutron/neutron.conf

nova_url = http://10.1.101.11:8774/v2/v2为nova_url = http://10.1.101.11:8774/v2

由于我部署时用命令sed -i -e s/# nova_url = http:\/\/127.0.0.1:8774/nova_url = http:\/\/$MASTER:8774\/v2/g /etc/neutron/neutron.conf

致使的,没有好好检查。

 四、建立虚拟机失败:Error: 建立实例 "vmtest" 失败: 请稍后再试 [错误: Timed out waiting for a reply to message ID c13fc53762ca47ce8e5253e5afb753c8].

 应该是nova服务挂掉了

复制代码
root@sc-ctrl01:~# nova-manage service list
Binary           Host                                 Zone             Status     State Updated_At
nova-cert        sc-ctrl01                            internal         enabled    :-)   2015-03-17 05:30:01
nova-consoleauth sc-ctrl01                            internal         enabled    :-)   2015-03-17 05:30:01
nova-scheduler   sc-ctrl01                            internal         enabled    :-)   2015-03-17 05:30:00
nova-conductor   sc-ctrl01                            internal         enabled    :-)   2015-03-17 05:29:59
nova-compute     sc-com01                             nova             enabled    XXX   2015-03-17 05:18:37
复制代码

重启nova-compute服务

五、Authorization Failed: [Errno 111] Connection refused

多是环境变量设置错误

租户不存在

OS_AUTH_URL写错

六、ERROR 2006 (HY000) at line 1: MySQL server has gone away

客户机和服务器之间的链接断开了,多是由于sql操做时间过长,或者传输数据太大(例如使用insert...value语句过长,这种状况将/etc/mysql/my.cf中的max_allowed_packet修改成64M或更大,也能够在程序中将数据分批插入)

七、start: Rejected send message, 1 matched rules; type="method_call", sender=":1.6" (uid=1001 pid=2153 comm="start mysql ") interface
="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1
 comm="/sbin/init")

须要root权限才行

sudo -i到root,而后再执行以前的命令。

相关文章
相关标签/搜索