1.docker启动失败

root@localhost:~# systemctl daemon-reload && systemctl restart docker.service
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 status docker.service
● docker.service - Docker Application Container EngineLoaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)Drop-In: /etc/systemd/system/docker.service.d└─override.confActive: failed (Result: exit-code) since Fri 2020-09-04 09:31:26 CST; 4s agoDocs: https://docs.docker.comProcess: 19628 ExecStart=/usr/bin/dockerd -H unix:// -H tcp://127.0.0.1:2375 (code=exited, status=1/FAILURE)Main PID: 19628 (code=exited, status=1/FAILURE)Sep 04 09:31:26 kuaiyue systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Sep 04 09:31:26 kuaiyue systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Sep 04 09:31:26 kuaiyue systemd[1]: Stopped Docker Application Container Engine.
Sep 04 09:31:26 kuaiyue systemd[1]: docker.service: Start request repeated too quickly.
Sep 04 09:31:26 kuaiyue systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 04 09:31:26 kuaiyue systemd[1]: Failed to start Docker Application Container Engine.

各种网页查找“docker.service: Service hold-off time over, scheduling restart”,然后并没有找到解决办法!

有说/etc/docker/daemon.json 格式不对,有说/etc/docker/daemon.json 改为/etc/docker/daemon.conf,都没有任何作用。

------------------------------------------------------------分割线------------------------------------------------------------------------------------------

最后找到原因的办法是,启动docker以后,立即执行journalctl -xe或者systemctl status docker.service,找到docker出错的原因。

如果journalctl -xe/systemctl status docker.service执行慢了,只能看到下面这样的

--
-- The result is RESULT.
Sep 04 09:31:26 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Sep 04 09:31:26 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Sep 04 09:31:26 systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.service has finished shutting down.
Sep 04 09:31:26 systemd[1]: Closed Docker Socket for the API.
-- Subject: Unit docker.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has finished shutting down.
Sep 04 09:31:26 systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has begun shutting down.
Sep 04 09:31:26 systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has begun starting up.
Sep 04 09:31:26 systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has finished starting up.
--
-- The start-up result is RESULT.
Sep 04 09:31:26 systemd[1]: docker.service: Start request repeated too quickly.
Sep 04 09:31:26 systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 04 09:31:26 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.service has failed.
--
-- The result is RESULT.
Sep 04 09:31:26 systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.

上面没有说明出错原因。

===================================分割线===================================================

下面这个才写出了出错原因。 systemctl status docker.service

root@localhost:~# systemctl status docker.service
● docker.service - Docker Application Container EngineLoaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)Drop-In: /etc/systemd/system/docker.service.d└─override.confActive: activating (start) since Fri 2020-09-04 09:37:33 CST; 565ms agoDocs: https://docs.docker.comMain PID: 22738 (dockerd)Tasks: 9CGroup: /system.slice/docker.service└─22738 /usr/bin/dockerd -H unix:// -H tcp://127.0.0.1:2375Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.445359792Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x44205ee0e0, CONNECTING" module=grpc
Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.446973762Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x44205ee0e0, READY" module=grpc
Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.447462812Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///run/containerd/containerd.sock 0  <nil>}]" module=grpc
Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.447526483Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.447668423Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x44205ee3f0, CONNECTING" module=grpc
Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.448877970Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x44205ee3f0, READY" module=grpc
Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.453395805Z" level=info msg="[graphdriver] using prior storage driver: overlay2"
Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.468522766Z" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.471128434Z" level=info msg="Loading containers: start."
Sep 04 09:37:33 dockerd[22738]: time="2020-09-04T01:37:33.498476011Z" level=warning msg="Running modprobe xt_conntrack failed with message: `modprobe: ERROR: could not insert 'xt_conntrack': Exec format error\ninsmod /lib/modules

或者

root@localhost:~# journalctl -xe
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has finished starting up.
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Sep 03 17:02:09 localhost systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.service has finished shutting down.
Sep 03 17:02:09 localhost systemd[1]: Closed Docker Socket for the API.
-- Subject: Unit docker.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has finished shutting down.
Sep 03 17:02:09 localhost systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has begun shutting down.
Sep 03 17:02:09 localhost systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.socket has begun starting up.
Sep 03 17:02:09 localhost systemd[1]: Listening on Docker Socket for the API.
--
-- The start-up result is RESULT.
Sep 03 17:02:09 localhost systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit docker.service has begun starting up.
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.110222230Z" level=warning msg="[!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]"
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.116773985Z" level=info msg="systemd-resolved is running, so using resolvconf: /run/systemd/resolve/resolv.conf"
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.118918145Z" level=info msg="parsed scheme: \"unix\"" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.118994581Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.119106894Z" level=info msg="parsed scheme: \"unix\"" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.119299004Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.120061161Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///run/containerd/containerd.sock 0  <nil>}]" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.122263838Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.123354778Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x442015b950, CONNECTING" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.125152357Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x442015b950, READY" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.126387488Z" level=info msg="ccResolverWrapper: sending new addresses to cc: [{unix:///run/containerd/containerd.sock 0  <nil>}]" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.126982855Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.127383233Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x442015bc40, CONNECTING" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.128749117Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0x442015bc40, READY" module=grpc
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.129671905Z" level=info msg="[graphdriver] using prior storage driver: overlay2"
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.140991314Z" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.144513158Z" level=info msg="Loading containers: start."
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.164800986Z" level=warning msg="Running modprobe xt_conntrack failed with message: `modprobe: ERROR: could not insert 'xt_conntrack': ExSep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.140991314Z" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.144513158Z" level=info msg="Loading containers: start."
Sep 03 17:02:10 localhost dockerd[13483]: time="2020-09-03T09:02:10.164800986Z" level=warning msg="Running modprobe xt_conntrack failed with message: `modprobe: ERROR: could not insert 'xt_conntrack': Exec format error\ninsmod /lib/modul

根据上面的信息可以看到是加载内核模块xt_conntrack出错了。

至于加载失败的原因,我这边是缺少xt_conntrack模块,导致加载失败。

在网上看到另一种原因,xt_conntrack有,但是也加载失败了,

原因是xt_conntrack模块被加入到黑名单里面了。

重新编译内核,自动加载xt_conntrack,或者手动加载xt_conntrack以后,再启动docker,就没有报错了。

docker启动失败原因相关推荐

  1. 【Java面试题】docker启动失败原因

    对于面试大厂的朋友,一些建议 阿里 阿里面试官一般都是P7/P8岗,对标到普通互联网公司相当于就是技术专家那种类型!他们对于没有经验的毕业生面试问的比较浅一点,大多数问题问的集合.锁.JVM调优,线程 ...

  2. centos7下docker启动失败解决

    centos7下docker启动失败解决 docker安装成功却启动失败,查看docker服务,systemctl status docker.service, 服务日志提示Failed to sta ...

  3. Docker启动失败提示【exec user process caused: exec format error】

    Docker启动失败提示[exec user process caused: exec format error] Docker版本不支持Arm64,可在网络上查找ARM64的版本

  4. docker启动失败问题之/var/lib/docker/overlay

    最近在工作中遇到了服务器无法进入docker容器的问题,提示no space left on device 问题现象 从提示上看,是没有磁盘空间了.于是乎想当然觉得可能是服务器上有些什么缓存之类的,重 ...

  5. Docker启动异常之服务器非法重启,导致Docker启动失败

    场景还原: 服务器更新安全控件, 没有关闭docker  直接重启了. 重启之后就启动不开了. 如果是如下错误 ,直接重启服务即可, 当然我也看到了一些比较好的文章 解决docker 启动失败,在下, ...

  6. MongoDB启动失败原因

    MongoDB启动失败原因 今天某个项目突然登录不了,查看服务器发现是后端出现异常,停掉后端重新启动的时候失败,显示是数据库连接失败,然后接着查看数据库,发现数据库连接失败,原因是数据库挂掉了. 数据 ...

  7. SELinux 引起的 Docker 启动失败

    问题描述 Linux OS 版本 CentOS Linux release 7.2.1511 (Core) 启动Docker service docker start 启动失败信息 原因分析 Erro ...

  8. docker启动失败,报docker dead but pid file exists,处理方式

    Linux服务器异常,自动重启了,发现再启动docker时,启动失败,没有任何提示: 1. 查看docker的启动状态: sudo service docker status 2. 查看状态发现提示: ...

  9. [转] 常见WinCE启动失败原因分析

    *********************************************** 一般情况下,为设计中的IC开发SW方案,难免会碰到Bootloader/EBoot/OS启动失败的情况, ...

最新文章

  1. 全球链界科技发展大会_如何成为科技界的团队合作者
  2. SAP MM公司间STO里的一步法转库?
  3. 二维数组更改vue_使用vue中的v-for遍历二维数组的方法
  4. python数据处理实例-python数据分析实例(1)
  5. 码龄超过20年,依然对生活和编程充满激情,这是三位70后“老”程序员的故事
  6. 免费获取 Kaspersky Small Office Security 90 天授权
  7. 这个 MySQL bug 让我大开眼界
  8. linux中spawn远程执行,linux 远程登录执行命令
  9. jozj4010-我才不是萝莉控呢【哈夫曼树】
  10. 每周送新书:Android软件安全、深入浅出Istio、软件架构设计
  11. centos7配置IP地址
  12. 例题:最高响应比优先调度算法
  13. 办公室学什么计算机,(计算机)办公室文员、助理都可以学学,留着迟早用得着
  14. 结合实际案例讲解系统分析方法
  15. poscms统计数据调用
  16. PC浏览器无法浏览网页的解决教程
  17. util.Date和sql.Date之间的转换
  18. Python中的arg,*args,**kwargs用法
  19. urlencode、unquote
  20. “MPX4115型压力传感器+PCF8591型AD+模拟IIC总线”的Proteus仿真

热门文章

  1. suds对接web service
  2. python图片转为64位编码形式
  3. 穷爸爸,富爸爸学习笔记
  4. 卷积神经网络(CNN):乳腺癌识别
  5. 渲染02-内置Uniform
  6. 2、JDK,JRE,JVM关系
  7. 5G 的三大场景:eMBB、URLLC、mMTC
  8. 谈一谈Restful接口设计风格
  9. 【第十章 线性代数之 特征向量与特征值】3Blue1Brown
  10. python下载详细教程