docker开启remote-api 2375端口后,Failed to start Docker Application Container Engine,重启docker失败的问题解决
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失败的问题解决的更多相关文章
- docker 开启remote api
docker官方文档上有相关说明(Configure and run Docker on various distributions),ubuntu上是可行的 sudo vi /etc/default ...
- Docker开启Remote API 访问 2375端口
Docker常见端口 我看到的常见docker端口包括: 2375:未加密的docker socket,远程root无密码访问主机2376:tls加密套接字,很可能这是您的CI服务器4243端口作为h ...
- Centos7系统下Docker开启认证的远程端口2376配置教程
docker开启2375会存在安全漏洞 暴露了2375端口的Docker主机.因为没有任何加密和认证过程,知道了主机IP以后,,任何人都可以管理这台主机上的容器和镜像,以前贪图方便,只开启了没有认证的 ...
- [问题] docker: Failed to start Docker Application Container Engine.
docker无法启动: # systemctl restart docker Job for docker.service failed because the control process exi ...
- Failed to start Docker Application Container Engine.
[root@dockertest ~]# systemctl status docker.service● docker.service - Docker Application Container ...
- 启动docker报Failed to start Docker Application Container Engine.解决
[root@docker ~]# systemctl status docker.service● docker.service - Docker Application Container Engi ...
- docker起不来报错:Failed to start Docker Application Container Engine.
报错信息如下: [root@localhost localdisk]# systemctl restart docker Job for docker.service failed because t ...
- Docker容器启动失败 Failed to start Docker Application Container Engine
1.在k8s mster节点执行 1.kubectl get nodes 发现node节点没起来 [root@guanbin-k8s-master ~]# kubectl get nodes NAME ...
- 【docker】开启remote api访问,并使用TLS加密
背景: docker默认是能使用本地的socket进行管理,这个在集群中使用的时候很不方便,因为很多功能还是需要链接docker服务进行操作,docker默认也可以开启tcp访问,但是这就相当于把整个 ...
随机推荐
- Deepin V20.1 解决安装Edge浏览器后更新系统报错的方法
问题描述:有些人在deepin系统上安装完edge浏览器后采用sudo apt update命令更新系统,却报出了错误,更新失败.原因是更新deepin系统的时候,最好把其它的源禁用了,不然会有各样的 ...
- 新建一个DJango项目
好长时间没有用过DJango了,都忘记了怎么使用,哈哈哈,看到一篇讲的很好的博客,直接附链接了. https://blog.csdn.net/woo_home/article/details/9645 ...
- 深入刨析tomcat 之---第4篇 tomcat4.0连接池 实现原理
writedby 张艳涛
- npx的使用方法、场景
目录 npx使用教程 npm与npx的概念 npx的使用场景(对比npm的一些优势) 使用场景1: 想用项目中已经安装好的某个包, 但是不能直接执行(因为没有全局安装, 涉及环境变量的问题) 使用场景 ...
- solr(CVE-2019-0193)远程命令执行
影响版本 Apache Solr < 8.2.0 并且开启了DataImportHandler模块(默认情况下该模块不被启用) 安装 重启daoker 更新配置文件 systemctl dae ...
- ACM金牌选手讲解LeetCode算法《哈希》
大家好,我是编程熊. 往期文章介绍了<线性表>中的数组.链表.栈.队列,以及单调栈和滑动窗口. ACM金牌选手讲解LeetCode算法<线性表> ACM金牌选手讲解LeetCo ...
- HCNA Routing&Switching之STP基础
前文我们了解了VLAN动态注册协议GVRP相关话题,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/15113770.html:今天我们来讨论下二层环路和STP相 ...
- 【Android面试查漏补缺】之事件分发机制详解
前言 查漏补缺,查漏补缺,你不知道哪里漏了,怎么补缺呢?本文属于[Android面试查漏补缺]系列文章第一篇,持续更新中,感兴趣的朋友可以[关注+收藏]哦~ 本系列文章是对自己的前段时间面试经历的总结 ...
- matplotlib.pyplot设置画布主题
import matplotlib.pyplot as plt # 定义一个画图函数 def sinplot(flip = 1): x = np.linspace(0,10,100) for i in ...
- Eclipse带参数调试的方法
下面是体现带参数调试的一个代码demo,首先输出参数的数量,然后依次输出每个参数. public class ArgsEx { public static void main(String[] arg ...