启动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.service
和journalctl -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失败
我是时生,一个正在努力的小白。欢迎批评,欢迎指正,欢迎共享。
如果这篇文章对你有帮助,麻烦点个赞呗!