Job for docker.service failed because start of the service was attempted too often(docker 无法正常启动)

参考:http://www.fanliugen.com/?p=663

1、问题如下:
cnentos 7.0 为了加速下载docker的镜像库,选择使用阿里在云的镜像。官方后台有下面的配置说明

修改daemon配置文件/etc/docker/daemon.json来使用加速器,
我也就自己新建了相应的json文件,加入了registry-mirrors的地址,但是启动docker时,出现了下面的错误。

[root@localhost ~]# systemctl restart docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.

[root@localhost ~]# systemctl start docker
Job for docker.service failed because start of the service was attempted too often. See "systemctl status docker.service" and "journalctl -xe" for details.
To force a start use "systemctl reset-failed docker.service" followed by "systemctl start docker.service" again.

[root@localhost ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since 二 2019-06-04 17:00:08 CST; 5min ago
     Docs: https://docs.docker.com
  Process: 62996 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 62996 (code=exited, status=1/FAILURE)

6月 04 17:00:06 localhost.localdomain systemd[1]: docker.service failed.
6月 04 17:00:08 localhost.localdomain systemd[1]: docker.service holdoff time over....
6月 04 17:00:08 localhost.localdomain systemd[1]: Stopped Docker Application Conta....
6月 04 17:00:08 localhost.localdomain systemd[1]: start request repeated too quick...e
6月 04 17:00:08 localhost.localdomain systemd[1]: Failed to start Docker Applicati....
6月 04 17:00:08 localhost.localdomain systemd[1]: Unit docker.service entered fail....
6月 04 17:00:08 localhost.localdomain systemd[1]: docker.service failed.
6月 04 17:00:40 localhost.localdomain systemd[1]: start request repeated too quick...e
6月 04 17:00:40 localhost.localdomain systemd[1]: Failed to start Docker Applicati....
6月 04 17:00:40 localhost.localdomain systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.


2、解决方式一:(不建议,因为修改文件后缀,配置的加速就会无效)

把daemon.json改为daemon.conf。使用mv命令修改后,docker启动正常。

[root@localhost docker]# mv daemon.json daemon.conf
[root@localhost docker]# systemctl restart docker
[root@localhost docker]# docker version
Client:
 Version:           18.09.6
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        481bc77156
 Built:             Sat May  4 02:34:58 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.6
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       481bc77
  Built:            Sat May  4 02:02:43 2019
  OS/Arch:          linux/amd64
  Experimental:     false
[root@localhost docker]# 


3、解决方式二 (建议用此方式)

检查daemon.json文件中的内容格式,本地编辑以后再上传到服务器文件对应位置即可解决。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值