相关文章: centos 7.8.2003版本docker安装失败问题记录

出现的原因是因为我在上一篇文章(Linux 的 open file 限制)修改了/etc/systemd/system.conf, 随后在重启后发现 Docker 无法启动, 查看对应日志:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[root@jh-java ~]# systemctl start docker
Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details.
[root@jh-java ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-09-18 17:25:33 CST; 6min ago
Docs: https://docs.docker.com
Process: 10174 ExecStart=/usr/bin/dockerd (code=exited, status=205/LIMITS)
Main PID: 10174 (code=exited, status=205/LIMITS)

Sep 18 17:25:33 jh-java systemd[1]: Starting Docker Application Container Engine
Sep 18 17:25:33 jh-java systemd[10174]: Failed at step LIMITS spawning /usr/bin/dockerd: Operation not permitted
Sep 18 17:25:33 jh-java systemd[1]: docker.service: main process exited, code=exited, status=205/LIMITS
Sep 18 17:25:33 jh-java systemd[1]: Failed to start Docker Application Container Engine.
Sep 18 17:25:33 jh-java systemd[1]: Unit docker.service entered failed state.
Sep 18 17:25:33 jh-java systemd[1]: docker.service failed.

在经过查询后得知是因为 open file 限制的问题, 需要修改/lib/systemd/system/<服务名>.serviceLimitNOFILE=unlimitedLimitNOFILE=<对应上限>即可解决