docker无法正常启动

本文全部摘自以下链接

https://blog.csdn.net/qq_35904833/article/details/74189383

此台机器为香港服务器,为的是方便快速pull公共镜像,之前作为kubernetes集群之一。后因种种原因,此机器退出集群。

之后再用到docker时,发现docker启动不了了,查看报错如下:

[root@ALY-HKC-PRO-001 ~]# 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@ALY-HKC-PRO-001 ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2017-07-03 10:12:16 CST; 5s ago
     Docs: http://docs.docker.com
  Process: 16172 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=1/FAILURE)
 Main PID: 16172 (code=exited, status=1/FAILURE)

Jul 03 10:12:15 ALY-HKC-PRO-001 systemd[1]: Starting Docker Application Container Engine...
Jul 03 10:12:15 ALY-HKC-PRO-001 dockerd-current[16172]: time="2017-07-03T10:12:15.812330534+08:00" level=info msg="libcontainerd: new containerd process, pid: 16180"
Jul 03 10:12:16 ALY-HKC-PRO-001 dockerd-current[16172]: time="2017-07-03T10:12:16.823237678+08:00" level=warning msg="devmapper: Usage of loopback devices is strongly discourage...v section."
Jul 03 10:12:16 ALY-HKC-PRO-001 dockerd-current[16172]: time="2017-07-03T10:12:16.838204058+08:00" level=error msg="[graphdriver] prior storage driver \"devicemapper\" failed: d...run failed"
Jul 03 10:12:16 ALY-HKC-PRO-001 dockerd-current[16172]: time="2017-07-03T10:12:16.838278116+08:00" level=fatal msg="Error starting daemon: error initializing graphdriver: devmap...run failed"
Jul 03 10:12:16 ALY-HKC-PRO-001 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Jul 03 10:12:16 ALY-HKC-PRO-001 systemd[1]: Failed to start Docker Application Container Engine.
Jul 03 10:12:16 ALY-HKC-PRO-001 systemd[1]: Unit docker.service entered failed state.
Jul 03 10:12:16 ALY-HKC-PRO-001 systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
  • 我们可以看到此处它提示是Failed to start Docker Application Container Engine.

于是在网上找各种类似错误,有说是需要把firewalld.service及selinux关闭。呃,这个的话是能够导致docker启动不了,可博主这块儿不是因为这个原因导致。

博主第一时间能想到的只有重装docker,可反复删除几次后仍为解决问题。(期间以为会是kubernetes当时设置有关,于是将kubernetes的所有软件也删除,问题同样是没有解决)。

最后突然想起很早的时候有看到文章说docker的engine 基于Device Mapper提供的一种存储驱动,而它又依赖与 devicemapper。于是乎我将它给删除并重启服务,解决了docker无法正常启动的问题。

# rm -rf /var/lib/docker/
# 添加如下内容
# vim /etc/docker/daemon.json
{
    "graph": "/mnt/docker-data",
    "storage-driver": "overlay"
}
  •  
[root@ALY-HKC-PRO-001 ~]# systemctl restart docker
[root@ALY-HKC-PRO-001 ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2017-07-03 10:26:19 CST; 15s ago
     Docs: http://docs.docker.com
 Main PID: 17167 (dockerd-current)
   CGroup: /system.slice/docker.service
           ├─17167 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userlan...
           └─17175 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim --metrics-interval=0 --start-timeout 2m -...

Jul 03 10:26:18 ALY-HKC-PRO-001 dockerd-current[17167]: time="2017-07-03T10:26:18.961963315+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Jul 03 10:26:18 ALY-HKC-PRO-001 dockerd-current[17167]: time="2017-07-03T10:26:18.962211996+08:00" level=warning msg="mountpoint for pids not found"
Jul 03 10:26:18 ALY-HKC-PRO-001 dockerd-current[17167]: time="2017-07-03T10:26:18.962703210+08:00" level=info msg="Loading containers: start."
Jul 03 10:26:19 ALY-HKC-PRO-001 dockerd-current[17167]: .........time="2017-07-03T10:26:19.230715822+08:00" level=info msg="Firewalld running: false"
Jul 03 10:26:19 ALY-HKC-PRO-001 dockerd-current[17167]: time="2017-07-03T10:26:19.379894482+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.30...IP address"
Jul 03 10:26:19 ALY-HKC-PRO-001 dockerd-current[17167]: time="2017-07-03T10:26:19.435937423+08:00" level=info msg="Loading containers: done."
Jul 03 10:26:19 ALY-HKC-PRO-001 dockerd-current[17167]: time="2017-07-03T10:26:19.436016788+08:00" level=info msg="Daemon has completed initialization"
Jul 03 10:26:19 ALY-HKC-PRO-001 dockerd-current[17167]: time="2017-07-03T10:26:19.436052792+08:00" level=info msg="Docker daemon" commit="1398f24/1.12.6" graphdriver=devicemappe...sion=1.12.6
Jul 03 10:26:19 ALY-HKC-PRO-001 dockerd-current[17167]: time="2017-07-03T10:26:19.441788942+08:00" level=info msg="API listen on /var/run/docker.sock"
Jul 03 10:26:19 ALY-HKC-PRO-001 systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
展开阅读全文

没有更多推荐了,返回首页