docker 启动报错 Operation not permitted
docker 启动报错
·
# systemctl restart docker
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
查看 /var/log/messages ,有如下错误
Feb 7 14:02:33 auth1 systemd: containerd.service holdoff time over, scheduling restart.
Feb 7 14:02:33 auth1 systemd: Stopped containerd container runtime.
Feb 7 14:02:33 auth1 systemd: Starting containerd container runtime...
Feb 7 14:02:33 auth1 systemd: Failed at step LIMITS spawning /sbin/modprobe: Operation not permitted
Feb 7 14:02:33 auth1 systemd: Failed at step LIMITS spawning /usr/bin/containerd: Operation not permitted
Feb 7 14:02:33 auth1 systemd: containerd.service: main process exited, code=exited, status=205/LIMITS
Feb 7 14:02:33 auth1 systemd: Failed to start containerd container runtime.
Feb 7 14:02:33 auth1 systemd: Unit containerd.service entered failed state.
Feb 7 14:02:33 auth1 systemd: containerd.service failed.
检查 ulimit ,设置的非常大了。
# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024000
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
检查 /etc/systemd/system.conf, 也设置的很大
DefaultLimitNOFILE=1024000
DefaultLimitNPROC=infinity
DefaultLimitMEMLOCK=infinity
DefaultLimitCORE=infinity
DefaultLimitSTACK=infinity
DefaultLimitAS=infinity
DefaultLimitFSIZE=infinity
DefaultLimitSIGPENDING=infinity
排查后是 docker 的LimitNOFILE、 LimitNPROC、LimitCORE 这三项不能超过系统设置。
vi /usr/lib/systemd/system/docker.service
LimitNOFILE=1024000
LimitNPROC=infinity
LimitCORE=infinity
vi /usr/lib/systemd/system/containerd.service
LimitNPROC=infinity
LimitCORE=infinity
LimitNOFILE=1024000
修改后,再次启动正常。
systemctl daemon-reload
systemctl restart docker
更多推荐
所有评论(0)