一、问题

服务器重启之后systemctl restart docker始终不成功,网上各种方法都试了一遍,依然没有解决问题。

systemctl restart docker 报错信息:

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

systemctl status docker.service  查看错误信息:

[root@localhost xs-2.0]# systemctl status docker.service
● docker.service - Docker Application Container EngineLoaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: disabled)Drop-In: /etc/systemd/system/docker.service.d└─docker.confActive: failed (Result: exit-code) since Tue 2022-08-16 12:37:33 CST; 36s agoDocs: https://docs.docker.comProcess: 394313 ExecStart=/usr/bin/dockerd --default-ulimit nofile=65535:65535 -H fd:// (code=exited, status=1/FAILURE)Main PID: 394313 (code=exited, status=1/FAILURE)8月 16 12:37:33 localhost.localdomain systemd[1]: docker.service: Service RestartSec=100ms expired, scheduling restart.
8月 16 12:37:33 localhost.localdomain systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
8月 16 12:37:33 localhost.localdomain systemd[1]: Stopped Docker Application Container Engine.
8月 16 12:37:33 localhost.localdomain systemd[1]: docker.service: Start request repeated too quickly.
8月 16 12:37:33 localhost.localdomain systemd[1]: docker.service: Failed with result 'exit-code'.
8月 16 12:37:33 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.

journalctl -xe 查看报错详细信息:

[root@localhost xs-2.0]# journalctl -xe
--
-- An ExecStart= process belonging to unit docker.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
8月 16 12:37:32 localhost.localdomain systemd[1]: docker.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit docker.service has entered the 'failed' state with result 'exit-code'.
8月 16 12:37:32 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: docker.service 单元已失败
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- docker.service 单元已失败。
--
-- 结果为“failed”。
8月 16 12:37:32 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=docker comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
8月 16 12:37:32 localhost.localdomain auditd[1141]: find kylin-root
8月 16 12:37:32 localhost.localdomain auditd[1141]: AUDIT:bfree=500118,threshold_size=75,fs_space_warning=0
8月 16 12:37:33 localhost.localdomain systemd[1]: docker.service: Service RestartSec=100ms expired, scheduling restart.
8月 16 12:37:33 localhost.localdomain 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: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
8月 16 12:37:33 localhost.localdomain systemd[1]: Stopped Docker Application Container Engine.
-- Subject: docker.service 单元已结束停止操作
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- docker.service 单元已结束停止操作。
8月 16 12:37:33 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=docker comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
8月 16 12:37:33 localhost.localdomain audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=docker comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
8月 16 12:37:33 localhost.localdomain systemd[1]: docker.service: Start request repeated too quickly.
8月 16 12:37:33 localhost.localdomain systemd[1]: docker.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit docker.service has entered the 'failed' state with result 'exit-code'.
8月 16 12:37:33 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: docker.service 单元已失败
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- docker.service 单元已失败。
--
-- 结果为“failed”。
8月 16 12:37:33 localhost.localdomain auditd[1141]: find kylin-root
8月 16 12:37:33 localhost.localdomain auditd[1141]: AUDIT:bfree=500118,threshold_size=75,fs_space_warning=0
8月 16 12:37:33 localhost.localdomain auditd[1141]: find kylin-root
8月 16 12:37:33 localhost.localdomain auditd[1141]: AUDIT:bfree=500118,threshold_size=75,fs_space_warning=0
lines 1895-1950/1950 (END)

vi /var/log/messages 查看日志,shift+G定位到末尾,具体报错信息:

Aug 16 12:37:32 localhost systemd[1]: Starting Docker Application Container Engine...
Aug 16 12:37:32 localhost dockerd[394274]: time="2022-08-16T12:37:32.368689600+08:00" level=info msg="Starting up"
Aug 16 12:37:32 localhost dockerd[394274]: failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Aug 16 12:37:32 localhost systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 12:37:32 localhost systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 16 12:37:32 localhost systemd[1]: Failed to start Docker Application Container Engine.
Aug 16 12:37:32 localhost audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=docker comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Aug 16 12:37:32 localhost auditd[1141]: find kylin-root
Aug 16 12:37:32 localhost auditd[1141]: AUDIT:bfree=500118,threshold_size=75,fs_space_warning=0
Aug 16 12:37:32 localhost systemd[1]: docker.service: Service RestartSec=100ms expired, scheduling restart.
Aug 16 12:37:32 localhost systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.
Aug 16 12:37:32 localhost systemd[1]: Stopped Docker Application Container Engine.
Aug 16 12:37:32 localhost audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=docker comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Aug 16 12:37:32 localhost audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=docker comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Aug 16 12:37:32 localhost systemd[1]: Starting Docker Application Container Engine...
Aug 16 12:37:32 localhost dockerd[394298]: time="2022-08-16T12:37:32.602459047+08:00" level=info msg="Starting up"
Aug 16 12:37:32 localhost dockerd[394298]: failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Aug 16 12:37:32 localhost systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 12:37:32 localhost systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 16 12:37:32 localhost systemd[1]: Failed to start Docker Application Container Engine.
Aug 16 12:37:32 localhost audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=docker comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Aug 16 12:37:32 localhost systemd[1]: docker.service: Service RestartSec=100ms expired, scheduling restart.
Aug 16 12:37:32 localhost systemd[1]: docker.service: Scheduled restart job, restart counter is at 2.
Aug 16 12:37:32 localhost systemd[1]: Stopped Docker Application Container Engine.
Aug 16 12:37:32 localhost audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=docker comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Aug 16 12:37:32 localhost audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=docker comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Aug 16 12:37:32 localhost auditd[1141]: find kylin-root
Aug 16 12:37:32 localhost auditd[1141]: AUDIT:bfree=500118,threshold_size=75,fs_space_warning=0
Aug 16 12:37:32 localhost auditd[1141]: find kylin-root
Aug 16 12:37:32 localhost auditd[1141]: AUDIT:bfree=500118,threshold_size=75,fs_space_warning=0
Aug 16 12:37:32 localhost systemd[1]: Starting Docker Application Container Engine...
Aug 16 12:37:32 localhost dockerd[394313]: time="2022-08-16T12:37:32.853072407+08:00" level=info msg="Starting up"
Aug 16 12:37:32 localhost dockerd[394313]: failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd
Aug 16 12:37:32 localhost systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 12:37:32 localhost systemd[1]: docker.service: Failed with result 'exit-code'.
Aug 16 12:37:32 localhost systemd[1]: Failed to start Docker Application Container Engine.

关键报错信息:

failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd

二、解决

在网上找了各种解决方案,都没有解决问题。

大多都是让修改docker.service文件中的配置,但是很遗憾我的始终不起作用。

后面看到一篇博客说可以覆盖docker.service中的配置,于是尝试自己创建override配置文件,最终成功解决问题。

具体步骤:

vi /etc/systemd/system/docker.service.d/override.conf

如果目录不存在,先手动创建目录

override.conf中输入:

# Disable flags to dockerd, all settings are done in /etc/docker/daemon.json
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
systemctl daemon-reload
systemctl restart docker

启动成功

如何覆盖docker.service文件中的配置,解决一次docker.service启动不成功的问题相关推荐

  1. 【MyBatis学习05】SqlMapConfig.xml文件中的配置总结

    经过上两篇博文的总结,对mybatis中的dao开发方法和流程基本掌握了,这一节主要来总结一下mybatis中的全局配置文件SqlMapConfig.xml在开发中的一些常用配置,首先看一下该全局配置 ...

  2. 请说明一下web.xml文件中可以配置哪些内容?

    ● 请说明一下web.xml文件中可以配置哪些内容? web.xml用于配置Web应用的相关信息,如:监听器(listener).过滤器(filter). Servlet.相关参数.会话超时时间.安全 ...

  3. java面试(二十五)--(1)redis为什么读写速率快性能好(2)说说web.xml文件中可以配置哪些内容(3)和的区别(4)扑克牌顺子

    1. redis为什么读写速率快性能好? 1.Redis将数据存储在内存上,避免了频繁的IO操作 2.Redis其本身采用字典的数据结构,时间复杂度为O(1),且其采用渐进式的扩容手段 3.Redis ...

  4. error:LNK2005 已经在*.obj文件中定义的解决办法

    有B和A两个代码,在文件B.obj中报错"已经在A.obj文件中定义的解决办法XXX" 报错原因是重复定义 把A或者B 里面任意一方的XXX注释掉即可解决.

  5. 根据Spring上下文对象xxxContext获得*.properties属性文件中的配置属性值

    最近写了一个文件上传和下载的简单测试demo,对于这种需要部署在服务器上的,而不是随便在本机上跑跑的那种,对于上传和下载的目录路径的选择和配置尤为重要,这个不能在代码里面写死,必须是灵活可配置的. 一 ...

  6. 深度学习项目中在yaml文件中定义配置,以及使用的python的PyYAML库包读取解析yaml配置文件

    文章目录: 1 yaml说明介绍 1.1 yaml介绍 1.2 YAML 相关网址 2 YAML的python包PyYAML的使用 2.1 关于PyYAML的相关网址 2.2 安装PyYAML 2.3 ...

  7. web.xml文件中可以配置哪些内容?

    web.xml用于配置Web应用的相关信息,如:监听器(listener).过滤器(filter).Servlet.相关参数. 会话超时时间.错误页面等①配置Spring上下文加载监听器,加载Spri ...

  8. web.xml 文件中的配置节的加载顺序

    为什么80%的码农都做不了架构师?>>>    web.xml 文件中一般包括 servlet, filter, listener 等的配置,那么它们是按照一个什么顺序加载呢? 首先 ...

  9. maven 打包时动态替换properties资源文件中的配置值

    pom build节点下面添加resource配置: [html] view plaincopy <resources> <resource> <directory> ...

最新文章

  1. iis web.config 配置 经典模式_部署IIS+PHP+Oracle环境
  2. mysql update w3c_PHP MySQL Update
  3. Linux下的GitHub安装与简单配置教程
  4. 关于Outlook删除原邮箱邮件的解决办法
  5. PHP中通过Web 执行C/C++应用程序
  6. OC之description
  7. 计算机系十周年聚会邀请函,毕业十周年同学聚会邀请函
  8. 05-树9 Huffman Codes (30 分)
  9. Mysql 查询当月时间数据
  10. ZYNQ7020 FPGA如何从Flash启动的详细步骤
  11. 算法 第四版 2.1.25 不需要交换的插入排序
  12. 软件测试的重要性与必要性,软件测试的目的和意义
  13. Windows 序列号查看
  14. 算法之BFS算法框架
  15. 刘夏真的简历中国科学院计算机所,计算所智能计算机研究中心党支部正式成立...
  16. classname库的使用
  17. 数据链路层的PPP协议
  18. 互联网最大谣言:程序员35岁必淘汰?今天我就来击碎他!
  19. python火车票票价_Python火车票机
  20. Python全局变量及Global关键字( Global variable in Python)

热门文章

  1. 学会记录生活的每件小事
  2. google翻译网页不错
  3. 官方也无力回天?“SharedPreferences 存在什么问题?”
  4. tableau:表计算
  5. java进程、线程知识扩充
  6. Devops 开发运维基础篇之使用Maven构建项目
  7. 浙大计算机学院辅导员,浙大博士应聘辅导员被指丢脸 月薪仅1000元
  8. 计算机网络1255,国家开放大学电大本科《计算机网络》2024期末试题及答案(试卷号:1255).docx...
  9. 杂谈:中华英才裁员事件
  10. 给生活添加更多乐趣!便携实用的迷你打印机-咕咕机GT1体验