Docker服务启动失败,重启请求频繁被拒绝

2024-01-03 02:51:55

启动Docker时突然报错

[root@master ]# 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.

根据提示需要执行systemctl status docker.servicejournalctl -xe命令,查看错误原因

[root@master ]# journalctl -xe -u docker.service
12月 29 16:46:08 master 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.
12月 29 16:46:08 master dockerd[2277]: unable to configure the Docker daemon with file /etc/docker/daemon.json: invalid character '"' after object key:value pair
12月 29 16:46:08 master systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
12月 29 16:46:08 master 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.

根据提示错误在,docker中daemon.json中的配置,少了一个引号
进入daemon.json查看内容

[root@master etc]# cd docker/
[root@master docker]# ls
daemln.jsonl
[root@master docker]# cat daemon.json
{
"registry-mirrors": ["https://jkbijt1h.mirror.aliyuncs.com"]
"insecure-registries":["http://192.168.90.3:8080"]
}

看出问题了吗,json字符串中间少了一个逗号,加上之后重启就没有问题了,
重新启动Docker

 [root@master docker]# systemctl start docker
    [root@master docker]# docker ps
    CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

启动成功,原因是配置文件时不仔细,导致启动docker失败


我是时生,一个正在努力的小白。欢迎批评,欢迎指正,欢迎共享。
如果这篇文章对你有帮助,麻烦点个赞呗!

文章来源:https://blog.csdn.net/qq_41883461/article/details/135349218
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。