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

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Moolight_shadow/article/details/46848771

问题描述

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 
展开阅读全文

没有更多推荐了,返回首页