daemon.json添加“exec-opts“: [“native.cgroupdriver=systemd“]后无法启动的问题

报错引流
Job for docker.service failed because the control process exited with error
docker修改"exec-opts": [“native.cgroupdriver=systemd”]后启动不了
the following directives are specified both as a flag and in the configura…

前言
在安装k8s集群时,需要把docker的cgroup改成systemd,修改完后报错,经百度,谷歌,发现没有一篇解决这个问题的文章,故写此文,帮助跟我一样的小白

解决
启动失败原因:直接启动docker会报错,因为docker.service里有一条配置,和刚才添加的"exec-opts"冲突了

解决方案:

解决报错

# 解决报错
# vi /lib/systemd/system/docker.service
# 找到并删除下面这句话,保存退出,即可解决
# --exec-opt native.cgroupdriver=cgroupfs \

[root@master ~]# systemctl daemon-reload
[root@master ~]# systemctl restart docker

猜你喜欢

转载自blog.csdn.net/m0_52896752/article/details/133964730
今日推荐