openstack(Ussuri版)问题及处理方法(持续更新中)
1.无法删除实例
在控制节点执行下列命令
#以管理员身份登陆openstack
. admin-openrc
#列出实例,查看实例的uuid
openstack server list
输出如下
在终端输入以下,将下面的$1
替换为想要删除的实例的uuid
mysql -uroot -p <<EOF
use nova;
delete from security_group_instance_association where instance_uuid='$1';
delete from instance_info_caches where instance_uuid ='$1';
delete from block_device_mapping where instance_uuid='$1';
update fixed_ips set instance_uuid=NULL where instance_uuid ='$1';
delete A from instance_actions_events as A inner join instance_actions as B on A.action_id = B.id where B.instance_uuid = '$1';
delete from instance_actions where instance_uuid = '$1';
delete from instance_faults where instance_uuid='$1';
delete from instance_extra where instance_uuid="$1";
delete from instance_system_metadata where instance_uuid='$1';
delete from virtual_interfaces where instance_uuid='$1';
delete from instances where uuid='$1';
EOF
2.某个cinder service 的状态为 down
考虑是时间不同步的问题
在controller和存储节点查看系统时间
date
若输出的时间差大于50秒,则考虑是系统时间不同步的问题。
-
50秒是系统配置的时候设置的,具体在以下文档里。
-
(1)看看是不是在 cinder.conf 中 report_interval 配置项的值是多少,如果超过了 service_down_time 配置项默认的 60 秒,那么该service 的状态肯定就是 ‘down’ 了。
(2)看 service 所在节点的时间,它的时间和 controller 节点的时间误差必须在 [service_down_time - report_interval ] 之内,也就是在使用默认配置情况下,时间差必须在 50 秒之内。
若是系统时间不同步的问题,那么在存储节点修改系统时间
date -s "YYYY-MM-DD hh:mm:ss"
将系统时间写进BIOS
hwclock -w
3.登陆界面点击登录后显示出错了
进入/var/log/apache2/
文件夹,查看error.log
文件
若出现
RuntimeError: Unable to create a new session key. It is likely that the cache is unavailable
这一句错误,则进行如下操作。
首先修改配置文件
vim /etc/openstack-dashboard/local_settings.py
将 SESSION_ENGINE = 'XXX.cache'
修改为 SESSION_ENGINE = 'XXX.file'
然后重启服务
systemctl restart apache2.service memcached.service
然后就可以登录dashboard啦!(但是恶心的是所有的实例全停了,需要重新开启。。。。。)