1.错误提示
使用systemctl stop docker停止docker后,再次启动docker发现无法启动报错如下
[root@localhost ~]# service docker start
Redirecting to /bin/systemctl start docker.service
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
2.解决方法
①使用systemctl daemon-reload命令重新加载
[root@localhost ~]# systemctl daemon-reload
启动docker时依然失败报错
[root@localhost ~]# systemctl restart docker
Job for docker.service failed because start of the service was attempted too often. See "systemctl status docker.service" and "journalctl -xe" for details.
To force a start use "systemctl reset-failed docker.service" followed by "systemctl start docker.service" again.
②由于博主自己添加了镜像加速的源,也是因为这个问题导致docker启动时失败,解决方法如下
[root@localhost docker]# ll
total 8
-rw-r--r--. 1 root root 59 Jan 17 23:26 daemon.json
-rw-------. 1 root root 244 Jan 13 23:22 key.json
[root@localhost docker]# mv daemon.json daemon.conf
[root@localhost docker]# ll
total 8
-rw-r--r--. 1 root root 59 Jan 17 23:26 daemon.conf
-rw-------. 1 root root 244 Jan 13 23:22 key.json
[root@localhost docker]# systemctl restart docker
查看docker启动状态
[root@localhost ~]# 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 Sat 2020-01-18 08:23:49 EST; 7min ago
Docs: https://docs.docker.com
Main PID: 10831 (dockerd)
Tasks: 13
Memory: 58.7M
CGroup: /system.slice/docker.service
└─10831 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Jan 18 08:23:48 localhost.localdomain dockerd[10831]: time="2020-01-18T08:23:48.530931325-05:00" level=info msg="ccResolverWrapper: sending update to cc: {[{un...dule=grpc
Jan 18 08:23:48 localhost.localdomain dockerd[10831]: time="2020-01-18T08:23:48.530939296-05:00" level=info msg="ClientConn switching balancer to \"pick_first\...dule=grpc
Jan 18 08:23:48 localhost.localdomain dockerd[10831]: time="2020-01-18T08:23:48.555568826-05:00" level=info msg="[graphdriver] using prior storage driver: overlay2"
Jan 18 08:23:48 localhost.localdomain dockerd[10831]: time="2020-01-18T08:23:48.606285244-05:00" level=info msg="Loading containers: start."
Jan 18 08:23:49 localhost.localdomain dockerd[10831]: time="2020-01-18T08:23:49.135891060-05:00" level=info msg="Default bridge (docker0) is assigned with an I... address"
Jan 18 08:23:49 localhost.localdomain dockerd[10831]: time="2020-01-18T08:23:49.336634972-05:00" level=info msg="Loading containers: done."
Jan 18 08:23:49 localhost.localdomain dockerd[10831]: time="2020-01-18T08:23:49.372806318-05:00" level=info msg="Docker daemon" commit=633a0ea graphdriver(s)=o...n=19.03.5
Jan 18 08:23:49 localhost.localdomain dockerd[10831]: time="2020-01-18T08:23:49.373243437-05:00" level=info msg="Daemon has completed initialization"
Jan 18 08:23:49 localhost.localdomain dockerd[10831]: time="2020-01-18T08:23:49.389523181-05:00" level=info msg="API listen on /var/run/docker.sock"
Jan 18 08:23:49 localhost.localdomain systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.