无法在K8S中的CentOS7中重新启动Docker

时间:2018-09-22 01:04:26

标签: docker

执行systemctl start docker后,我得到: 无法启动docker.service:找不到单位。 这是systemctl status docker -l的输出:

docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2018-09-22 08:58:24 CST; 6s ago
     Docs: http://docs.docker.com
  Process: 22573 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 --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
 Main PID: 22573 (code=exited, status=1/FAILURE)

Sep 22 08:58:24 VM_0_3_centos systemd[1]: Starting Docker Application Container Engine...
Sep 22 08:58:24 VM_0_3_centos dockerd-current[22573]: Error starting daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid
Sep 22 08:58:24 VM_0_3_centos systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Sep 22 08:58:24 VM_0_3_centos systemd[1]: Failed to start Docker Application Container Engine.
Sep 22 08:58:24 VM_0_3_centos systemd[1]: Unit docker.service entered failed state.
Sep 22 08:58:24 VM_0_3_centos systemd[1]: docker.service failed.

2 个答案:

答案 0 :(得分:2)

看起来Docker PID文件仍然存在。尝试删除它:

'\0'

然后启动服务

rm -f /var/run/docker.pid

答案 1 :(得分:0)

如果您观察到输出日志

find -name '*.xml' -exec sed 's/\s\+/ /g' {} \;

,请删除Sep 22 08:58:24 VM_0_3_centos dockerd-current[22573]: Error starting daemon: pid file found, ensure docker is not running or delete /var/run/docker.pid 文件,然后重试。

docker.pid