1.  按照网上的教程修改了 /usr/lib/systemd/system/docerk.service配置后,重启失败。修改/etc/docker/daemon.json 增加hosts后重启也是如此。反复操作了几次之后依旧启动报错。

[root@web-dev1 system]# systemctl daemon-reload
[root@web-dev1 system]# 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.
[root@web-dev1 system]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Thu 2021-09-02 08:51:20 CST; 1min 32s ago
Docs: https://docs.docker.com
Process: 20308 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock (code=exited, status=1/FAILURE)
Main PID: 20308 (code=exited, status=1/FAILURE) Sep 02 08:51:17 web-dev1 systemd[1]: Failed to start Docker Application Container Engine.
Sep 02 08:51:17 web-dev1 systemd[1]: Unit docker.service entered failed state.
Sep 02 08:51:17 web-dev1 systemd[1]: docker.service failed.
Sep 02 08:51:20 web-dev1 systemd[1]: docker.service holdoff time over, scheduling restart.
Sep 02 08:51:20 web-dev1 systemd[1]: Stopped Docker Application Container Engine.
Sep 02 08:51:23 web-dev1 systemd[1]: start request repeated too quickly for docker.service
Sep 02 08:51:23 web-dev1 systemd[1]: Failed to start Docker Application Container Engine.
Sep 02 08:51:23 web-dev1 systemd[1]: Unit docker.service entered failed state.
Sep 02 08:51:23 web-dev1 systemd[1]: docker.service failed.

2. 解决方案,docker.service 14行标红项修改

[root@web-dev1 system]# vim /usr/lib/systemd/system/docker.service

  1 [Unit]
2 Description=Docker Application Container Engine
3 Documentation=https://docs.docker.com
4 After=network-online.target firewalld.service containerd.service
5 Wants=network-online.target
6 Requires=docker.socket containerd.service
7
8 [Service]
9 Type=notify
10 # the default is not to use systemd for cgroups because the delegate issues still
11 # exists and systemd currently does not support the cgroup feature set required
12 # for containers run by docker
13 # ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
14 ExecStart=/usr/bin/dockerd
15 ExecReload=/bin/kill -s HUP $MAINPID
16 TimeoutSec=0
17 RestartSec=2
18 Restart=always
19

然后修改daemon.json,追加hosts配置项

[root@web-dev1 system]# vim /etc/docker/daemon.json 

  1 {
2 "registry-mirrors": ["https://dockerhub.azk8s.cn","https://hub-mirror.c.163.com"],
3 "exec-opts": ["native.cgroupdriver=cgroupfs"],
4 "log-driver": "json-file",
5 "log-opts": {"max-size": "10m","max-file": "10"},
6 "insecure-registries": ["1.1.1.1:2021"],
7 "hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]
8 }

重启

[root@web-dev1 system]# systemctl daemon-reload
[root@web-dev1 system]# systemctl start docker

验证

[root@web-dev1 system]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@web-dev1 system]# vim /etc/docker/daemon.json
[root@web-dev1 system]# lsof -i:2375
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dockerd 30865 root 9u IPv6 285808116 0t0 TCP *:2375 (LISTEN)
[root@web-dev1 system]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-09-02 09:00:45 CST; 2min 24s ago
Docs: https://docs.docker.com
Main PID: 30865 (dockerd)
Tasks: 13
Memory: 28.0M
CGroup: /system.slice/docker.service
└─30865 /usr/bin/dockerd Sep 02 09:00:44 web-dev1 dockerd[30865]: time="2021-09-02T09:00:44.901936855+08:00" level=info msg="ClientConn switching balancer to \"pick_first...dule=grpc
Sep 02 09:00:44 web-dev1 dockerd[30865]: time="2021-09-02T09:00:44.915442870+08:00" level=info msg="[graphdriver] using prior storage driver: overlay2"
Sep 02 09:00:44 web-dev1 dockerd[30865]: time="2021-09-02T09:00:44.924126668+08:00" level=info msg="Loading containers: start."
Sep 02 09:00:45 web-dev1 dockerd[30865]: time="2021-09-02T09:00:45.069987957+08:00" level=info msg="Default bridge (docker0) is assigned with an ... address"
Sep 02 09:00:45 web-dev1 dockerd[30865]: time="2021-09-02T09:00:45.130848024+08:00" level=info msg="Loading containers: done."
Sep 02 09:00:45 web-dev1 dockerd[30865]: time="2021-09-02T09:00:45.167723153+08:00" level=info msg="Docker daemon" commit=75249d8 graphdriver(s)=...n=20.10.8
Sep 02 09:00:45 web-dev1 dockerd[30865]: time="2021-09-02T09:00:45.167817837+08:00" level=info msg="Daemon has completed initialization"
Sep 02 09:00:45 web-dev1 systemd[1]: Started Docker Application Container Engine.
Sep 02 09:00:45 web-dev1 dockerd[30865]: time="2021-09-02T09:00:45.197823106+08:00" level=info msg="API listen on [::]:2375"
Sep 02 09:00:45 web-dev1 dockerd[30865]: time="2021-09-02T09:00:45.202916732+08:00" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.

完毕!一点点试出来的,但我并没有弄清楚什么原理,对docker的部署问题还处于初级阶段。

docker开启remote-api 2375端口后,Failed to start Docker Application Container Engine,重启docker失败的问题解决的更多相关文章

  1. docker 开启remote api

    docker官方文档上有相关说明(Configure and run Docker on various distributions),ubuntu上是可行的 sudo vi /etc/default ...

  2. Docker开启Remote API 访问 2375端口

    Docker常见端口 我看到的常见docker端口包括: 2375:未加密的docker socket,远程root无密码访问主机2376:tls加密套接字,很可能这是您的CI服务器4243端口作为h ...

  3. Centos7系统下Docker开启认证的远程端口2376配置教程

    docker开启2375会存在安全漏洞 暴露了2375端口的Docker主机.因为没有任何加密和认证过程,知道了主机IP以后,,任何人都可以管理这台主机上的容器和镜像,以前贪图方便,只开启了没有认证的 ...

  4. [问题] docker: Failed to start Docker Application Container Engine.

    docker无法启动: # systemctl restart docker Job for docker.service failed because the control process exi ...

  5. Failed to start Docker Application Container Engine.

    [root@dockertest ~]# systemctl status docker.service● docker.service - Docker Application Container ...

  6. 启动docker报Failed to start Docker Application Container Engine.解决

    [root@docker ~]# systemctl status docker.service● docker.service - Docker Application Container Engi ...

  7. docker起不来报错:Failed to start Docker Application Container Engine.

    报错信息如下: [root@localhost localdisk]# systemctl restart docker Job for docker.service failed because t ...

  8. Docker容器启动失败 Failed to start Docker Application Container Engine

    1.在k8s mster节点执行 1.kubectl get nodes 发现node节点没起来 [root@guanbin-k8s-master ~]# kubectl get nodes NAME ...

  9. 【docker】开启remote api访问,并使用TLS加密

    背景: docker默认是能使用本地的socket进行管理,这个在集群中使用的时候很不方便,因为很多功能还是需要链接docker服务进行操作,docker默认也可以开启tcp访问,但是这就相当于把整个 ...

随机推荐

  1. SourceTree 3.1.3版本跳过注册

    1.进入文件夹 %LocalAppData%\Atlassian\SourceTree\ 找到SourceTree的目录 2.里面添加一个json文件 accounts.json 内容如下: [{&q ...

  2. windows10激活方法

    原文转自:http://www.ylmfwin100.com/ylmf/8643.html 现在市面上大致有两种主流激活方法,一种是通过激活码来激活,另外一种是通过激活工具来激活.但是激活工具有个弊端 ...

  3. SoundPool概率性无声问题

    public class SoundManager { private static SoundManager instance; private SoundPool mSoundPool; priv ...

  4. 手写Pascal解释器(三)

    目录 一.part7 抽象语法树和具体语法树(解析树) 代码实现 二.part8 一.part7 资料来源:https://ruslanspivak.com/lsbasi-part7/ 看作者博客的标 ...

  5. (数据科学学习手札126)Python中JSON结构数据的高效增删改操作

    本文示例代码及文件已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes 1 简介 在上一期文章中我们一起学习了在Python ...

  6. Java架构师-十项全能学习笔记(1)

    Java架构师-十项全能学习笔记(1) @Configuration @EnableStateMachine public class OrderStateMachineConfig extends ...

  7. Python实现猜数字游戏

    Python中实现猜数字游戏代码如下: import random # 引入随机数标准库-random # 定义数字上下限和最大游戏次数 min_num = 1 max_num = 10 guess_ ...

  8. Apache解析漏洞

    多解析特性 在Apache1.x,2.x中Apache 解析文件的规则是从右到左开始判断解析,如果后缀名为不可识别文件解析,就再往左判断.因此对于apache而言,一个test.php.qwea文件依 ...

  9. CentOS帮助类语法

    目录 一.man获取帮助信息 二.help获得shell内置命令的帮助信息 三.history查看所有命令历史 补充:Linux常用快捷键 一.man获取帮助信息 基本语法:man [命令或配置文件] ...

  10. Python3中dict字典的相关操作函数

    字典对象的内建函数 1. clear() 清空字典. 例: >>> a = {1:3, 2:4} >>> a.clear() >>> a {} 2 ...