openstack-glance-api.service start request repeated too quickly, refusing to start

Posted gcczhongduan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openstack-glance-api.service start request repeated too quickly, refusing to start相关的知识,希望对你有一定的参考价值。

问题描写叙述

openstack J版 centos7部署
重新启动服务时起不来,日志也不报错。以glance服务为例,例如以下:

#  systemctl start openstack-glance-api.service openstack-glance-registry.service 
Job for openstack-glance-api.service failed. See ‘systemctl status openstack-glance-api.service‘ and ‘journalctl -xn‘ for details.



# systemctl status openstack-glance-api.service 
openstack-glance-api.service - OpenStack Image Service (code-named Glance) API server
   Loaded: loaded (/usr/lib/systemd/system/openstack-glance-api.service; enabled)
   Active: failed (Result: start-limit) since Sat 2015-07-11 22:25:43 EDT; 19s ago
  Process: 11841 ExecStart=/usr/bin/glance-api (code=exited, status=1/FAILURE)
 Main PID: 11841 (code=exited, status=1/FAILURE)

Jul 11 22:25:43 node-82 systemd[1]: Failed to start OpenStack Image Service (code-named Glance) API server.
Jul 11 22:25:43 node-82 systemd[1]: Unit openstack-glance-api.service entered failed state.
Jul 11 22:25:43 node-82 systemd[1]: openstack-glance-api.service holdoff time over, scheduling restart.
Jul 11 22:25:43 node-82 systemd[1]: Stopping OpenStack Image Service (code-named Glance) API server...
Jul 11 22:25:43 node-82 systemd[1]: Starting OpenStack Image Service (code-named Glance) API server...
Jul 11 22:25:43 node-82 systemd[1]: openstack-glance-api.service start request repeated too quickly, refusing to start.
Jul 11 22:25:43 node-82 systemd[1]: Failed to start OpenStack Image Service (code-named Glance) API server.
Jul 11 22:25:43 node-82 systemd[1]: Unit openstack-glance-api.service entered failed state.

错误分析

之前mariadb起不来也是相似错误,可是输入journalctl -xn 后,会显示配置错误。订正my.cnf 就能够但glance报这个错误怎么解决?我还没做什么呢,他说连接过快。无奈之下想起了“重新启动试试,不行就分”。重新启动吧,重新启动也没用,那就卸掉glance组件,删掉数据库,删掉keystone链接重来吧,结果还是没卵用。

相似这样的服务起不来的情况,依个人经历作例如以下总结

1.配置文档有错,订正配置文档,再次启动

2.相关目录/文件的权限有问题。查看权限,改动权限

错误解决

由于我都是root权限操作的,所以同步数据库经经常使用用的是glance-manage db_sync 这次也没什么问题,同步是成功的,问题找不到原因就仅仅能乱撞了。google也没找到。当我输入了su -s /bin/sh -c "glance-manage db_sync" glance 狐狸尾巴最终露出来了。同步出错,错误信息:

Traceback (most recent call last):
  File "/usr/bin/glance-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/glance/cmd/manage.py", line 273, in main
    log.setup(‘glance‘)
  File "/usr/lib/python2.7/site-packages/glance/openstack/common/log.py", line 460, in setup
    _setup_logging_from_conf(product_name, version)
  File "/usr/lib/python2.7/site-packages/glance/openstack/common/log.py", line 529, in _setup_logging_from_conf
    filelog = logging.handlers.WatchedFileHandler(logpath)
  File "/usr/lib64/python2.7/logging/handlers.py", line 392, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib64/python2.7/logging/__init__.py", line 902, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python2.7/logging/__init__.py", line 925, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: ‘/var/log/glance/api.log‘

api.log 权限有问题,查看之

# ll /var/log/glance/api.log                                                          
-rw-r--r--. 1 root root 14783 Jul 11 22:25 /var/log/glance/api.log

果然,将它改成glance组glance的,再次同步。再次重新启动。ok

# chown -R glance:glance /var/log/glance/api.log
# su -s /bin/sh -c "glance-manage db_sync" glance
#  systemctl start openstack-glance-api.service 

以上是关于openstack-glance-api.service start request repeated too quickly, refusing to start的主要内容,如果未能解决你的问题,请参考以下文章