启动请求重复得太快 [英] start request repeated too quickly

查看:31
本文介绍了启动请求重复得太快的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个 bash 脚本,但我经常遇到这个问题.当我尝试 startstop 服务时,我经常得到:

I'm writing a bash-script but I often face this issue. When I try to start or stop a service I often get:

start request repeated too quickly 

我该如何解决这个问题?例如,当我尝试重新启动 docker 或 openshift-origin master 时.

How can I solve this problem? It's for example when I try to restart docker or openshift-origin master.

sudo service origin-master restart

● origin-master.service - Origin Master Service
   Loaded: loaded (/usr/lib/systemd/system/origin-master.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Wed 2016-02-17 08:22:11 UTC; 44s ago
     Docs: https://github.com/openshift/origin
  Process: 2296 ExecStart=/usr/bin/openshift start master --config=${CONFIG_FILE} $OPTIONS (code=exited, status=255)
 Main PID: 2296 (code=exited, status=255)

Feb 17 08:22:10 ip-172-xx-xx-xx.eu-central-1.compute.internal systemd[1]: origin-master.service: main process exited, code=exited, status=255/n/a
Feb 17 08:22:10 ip-172-xx-xx-xx.eu-central-1.compute.internal systemd[1]: Failed to start Origin Master Service.
Feb 17 08:22:10 ip-172-xx-xx-xx.eu-central-1.compute.internal systemd[1]: Unit origin-master.service entered failed state.
Feb 17 08:22:10 ip-172-xx-xx-xx.eu-central-1.compute.internal systemd[1]: origin-master.service failed.
Feb 17 08:22:11 ip-172-xx-xx-xx.eu-central-1.compute.internal systemd[1]: origin-master.service holdoff time over, scheduling restart.
Feb 17 08:22:11 ip-172-xx-xx-xx.eu-central-1.compute.internal systemd[1]: start request repeated too quickly for origin-master.service
Feb 17 08:22:11 ip-172-xx-xx-xx.eu-central-1.compute.internal systemd[1]: Failed to start Origin Master Service.
Feb 17 08:22:11 ip-172-xx-xx-xx.eu-central-1.compute.internal systemd[1]: Unit origin-master.service entered failed state.
Feb 17 08:22:11 ip-172-xx-xx-xx.eu-central-1.compute.internal systemd[1]: origin-master.service failed.

我的脚本正在执行:

if [ $1 = "-u" ]
then
 sudo service origin-master restart
fi

在我执行脚本之前可以手动重启.但是之后它仍然给出错误

A manual restart is possible before I've executed the script. But after it it remains giving the error

推荐答案

这是 systemctl 的一个特性".文件中有一个参数以秒为单位限制重启频率.测试时降低此值.

This is a "feature" of systemctl. There is a parameter in the file that limits the restart frequency in seconds. Lower this while testing.

编辑文件/etc/systemd/system/multi-user.target.wants/<你的服务在这里>

我的例子:

Restart=on-failure
StartLimitBurst=2
# Restart, but not more than once every 10 minutes
#StartLimitInterval=600
# Restart, but not more than once every 30s (for testing purposes)
StartLimitInterval=30

这篇关于启动请求重复得太快的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆