记一次openstack维护经历—-openstack-dashboard 500

  • Post author:
  • Post category:其他


背景:

清明节放假期间,公司有项目问题,需要紧急处理,结果物业停电,公司所有服务器都断电了,再次上电后,好多机器的自启没做,只好让同事到公司手动开启,但是公司的openstack服务器起来后,访问不了网页。

问题现象:

登录openstack,报error 500, Internal server error

经过:

之前没有玩过openstack,更别提解决问题了,只好百度;

1、先检查openstack 服务启动情况

查到命令 nova-manage service list

[root@localhost ~]# nova-manage service list
Option "verbose" from group "DEFAULT" is deprecated for removal.  Its value may be silently ignored in the future.
Option "notification_topics" from group "DEFAULT" is deprecated. Use option "topics" from group "oslo_messaging_notifications".
DEPRECATED: Use the nova service-* commands from python-novaclient instead or the os-services REST resource. The service subcommand will be removed in the 14.0 release.
Binary           Host                                 Zone             Status     State Updated_At
nova-osapi_compute 0.0.0.0                              internal         enabled    XXX   None      
nova-metadata    0.0.0.0                              internal         enabled    XXX   None      
nova-cert        localhost.localdomain                internal         enabled    :-)   2020-04-10 00:01:40
nova-consoleauth localhost.localdomain                internal         enabled    :-)   2020-04-10 00:01:40
nova-scheduler   localhost.localdomain                internal         enabled    :-)   2020-04-10 00:01:40
nova-conductor   localhost.localdomain                internal         enabled    :-)   2020-04-10 00:01:39
nova-compute     localhost.localdomain                nova             enabled    :-)   2020-04-10 00:01:36
[root@localhost ~]# 

根据描述state为XXX的表示没有启动成功,当时也没多少经验,就一直在研究这两个XXX的服务为啥没起来

2、检查metadata、osapi_compute为啥没起来

从/usr/lib/systemd/system目录查看openstack服务

[root@localhost ~]# ll /usr/lib/systemd/system/openstack*
-rw-r--r-- 1 root root 326 Feb 16  2016 /usr/lib/systemd/system/openstack-cinder-api.service
-rw-r--r-- 1 root root 335 Feb 16  2016 /usr/lib/systemd/system/openstack-cinder-backup.service
-rw-r--r-- 1 root root 344 Feb 16  2016 /usr/lib/systemd/system/openstack-cinder-scheduler.service
-rw-r--r-- 1 root root 335 Feb 16  2016 /usr/lib/systemd/system/openstack-cinder-volume.service
-rw-r--r-- 1 root root 248 Mar 21  2016 /usr/lib/systemd/system/openstack-glance-api.service
-rw-r--r-- 1 root root 256 Mar 21  2016 /usr/lib/systemd/system/openstack-glance-glare.service
-rw-r--r-- 1 root root 258 Mar 21  2016 /usr/lib/systemd/system/openstack-glance-registry.service
-rw-r--r-- 1 root root 254 Mar 21  2016 /usr/lib/systemd/system/openstack-glance-scrubber.service
-rw-r--r-- 1 root root 242 May 25  2016 /usr/lib/systemd/system/openstack-keystone.service
-rw-r--r-- 1 root root 571 Aug  9  2016 /usr/lib/systemd/system/openstack-losetup.service
-rw-r--r-- 1 root root 230 Jun 17  2016 /usr/lib/systemd/system/openstack-nova-api.service
-rw-r--r-- 1 root root 232 Jun 17  2016 /usr/lib/systemd/system/openstack-nova-cert.service
-rw-r--r-- 1 root root 302 Jun 17  2016 /usr/lib/systemd/system/openstack-nova-compute.service
-rw-r--r-- 1 root root 242 Jun 17  2016 /usr/lib/systemd/system/openstack-nova-conductor.service
-rw-r--r-- 1 root root 251 Jun 17  2016 /usr/lib/systemd/system/openstack-nova-consoleauth.service
-rw-r--r-- 1 root root 244 Jun 17  2016 /usr/lib/systemd/system/openstack-nova-console.service
-rw-r--r-- 1 root root 248 Jun 17  2016 /usr/lib/systemd/system/openstack-nova-metadata-api.service
-rw-r--r-- 1 root root 304 Jun 18  2016 /usr/lib/systemd/system/openstack-nova-novncproxy.service
-rw-r--r-- 1 root root 248 Jun 18  2016 /usr/lib/systemd/system/openstack-nova-os-compute-api.service
-rw-r--r-- 1 root root 242 Jun 17  2016 /usr/lib/systemd/system/openstack-nova-scheduler.service
-rw-r--r-- 1 root root 216 Jun 18  2016 /usr/lib/systemd/system/openstack-nova-xvpvncproxy.service

找到对应的openstack-nova-metadata-api和openstack-nova-os-compute-api服务,然后

疯狂的重启这俩服务


,虽然最后证明跟他俩没关系

重启metadata-api时,提示端口被占用,又是该端口,又是改配置,没招了,换个思路,从源头查找,开始去找日志

3、检查openstack-dashboard的服务

根据百度【openstack登录error 500, Internal server error】,都是让设置openstack-dashboard.conf

WSGIApplicationGroup %{GLOBAL}

但是都没用;

后来看到有说到权限问题

各种方法没用的情况,只能试一试,

chown apache:apache /usr/share/openstack-dashboard

bingo!

奇迹发生了,500错误神奇的消失了,取而代之的期待已久的登录界面!

泪奔啊!

两天啊!

终于解决了!!!

通过这次的问题发现到解决,说起来不是啥大问题,但是对于一个不熟悉openstack的来说,找个日志在哪里都要百度一下,思路都混乱了,没有去找到一个解决办法。

解决问题,重要的是思路



版权声明:本文为fly_520原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。