解决dockers无法启动

记录一下 折腾了一天  一台服务器跑代码崩了 重启后,dockers无法使用, 启动docker 报 

Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details

查看相关问题

 docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: start-limit-hit) since 一 2020-04-27 18:47:21 CST; 5min ago
     Docs: https://docs.docker.com
  Process: 7356 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=2)
 Main PID: 7356 (code=exited, status=2)

 systemd[1]: Failed to start Docker Application Container Engine.
 systemd[1]: docker.service: Unit entered failed state.
 systemd[1]: docker.service: Failed with result 'exit-code'.
 systemd[1]: docker.service: Service hold-off time over, scheduling restart.
 systemd[1]: Stopped Docker Application Container Engine.
 systemd[1]: docker.service: Start request repeated too quickly.
 systemd[1]: Failed to start Docker Application Container Engine.
 systemd[1]: docker.service: Unit entered failed state.
 systemd[1]: docker.service: Failed with result 'start-limit-hit'

sudo vim /lib/systemd/system/docker.service

ExecStart=/usr/bin/dockerd -H fd:// 

看了其他几台的配置,默认就是读取该位置  

改为 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

后 sudo systemctl daemon-reload  sudo systemctl start docker

报如下问题 

   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: activating (start) since 一 2020-04-27 18:58:19 CST; 307ms ago
     Docs: https://docs.docker.com
 Main PID: 8479 (dockerd)
    Tasks: 45
   Memory: 37.6M
      CPU: 439ms
   CGroup: /system.slice/docker.service
           ├─8479 /usr/bin/dockerd -H unix:///var/run/docker.sock
           ├─8567 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8883 -container-ip 172.17.0.2 -container-port 8888
           └─8582 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 6007 -container-ip 172.17.0.2 -container-port 6007

4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.786261312+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.786334663+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4201d41a0, CONNECTING" module=grpc
4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.786461206+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4200d3a30, READY" module=grpc
4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.786539867+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc4201d41a0, READY" module=grpc
4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.790487639+08:00" level=info msg="[graphdriver] using prior storage driver: overlay2"
4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.844732996+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.845157944+08:00" level=warning msg="Your kernel does not support swap memory limit"
4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.845237839+08:00" level=warning msg="Your kernel does not support cgroup rt period"
4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.845256923+08:00" level=warning msg="Your kernel does not support cgroup rt runtime"
4月 27 18:58:19 k8s-GVWF48-master dockerd[8479]: time="2020-04-27T18:58:19.846423265+08:00" level=info msg="Loading containers: start."

尝试了很多办法

最后 还是改 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/var/run/docker.sock 后 启动后 

把8883 端口的容器干 

再把 改为 ExecStart=/usr/bin/dockerd -H fd:// 

sudo systemctl daemon-reload  sudo systemctl start docker 重启后 正常

你可能感兴趣的:(docker)