记一次故障系列:docker 启动失败

启动报错:

]# systemctl start 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.

]# journalctl  -xe
2月 25 17:48:31 host-flb systemd[1]: docker.service holdoff time over, scheduling restart.
2月 25 17:48:31 host-flb systemd[1]: Stopped Docker Application Container Engine.
-- Subject: Unit docker.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has finished shutting down.
2月 25 17:48:31 host-flb systemd[1]: Closed Docker Socket for the API.
-- Subject: Unit docker.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has finished shutting down.
2月 25 17:48:31 host-flb systemd[1]: Stopping Docker Socket for the API.
-- Subject: Unit docker.socket has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has begun shutting down.
2月 25 17:48:31 host-flb systemd[1]: Starting Docker Socket for the API.
-- Subject: Unit docker.socket has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has begun starting up.
2月 25 17:48:31 host-flb systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.socket has finished starting up.
-- 
-- The start-up result is done.
2月 25 17:48:31 host-flb systemd[1]: Starting Docker Application Container Engine...
-- Subject: Unit docker.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has begun starting up.
2月 25 17:48:31 host-flb dockerd[29067]: unable to configure the Docker daemon with file /etc/docker/daemon.json: EOF
2月 25 17:48:31 host-flb systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
2月 25 17:48:31 host-flb systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit docker.service has failed.
-- 
-- The result is failed.
2月 25 17:48:31 host-flb systemd[1]: Unit docker.service entered failed state.
2月 25 17:48:31 host-flb systemd[1]: docker.service failed.

  

问题原因:

  创建了配置文件/etc/docker/daemon.json,但此文件为空

 

解决方案:

  1、删除/etc/docker/daemon.json文件,执行systemctl reset-failed docker.service;systemctl start docker

  2、向/etc/docker/daemon.json文件中写入如下内容

  

   然后执行ystemctl reset-failed docker.service;systemctl start docker

posted @ 2021-02-25 17:56  NorthFeng  阅读(4934)  评论(0编辑  收藏  举报