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,而後再執行以前的命令。