The problem that daemon.json cannot start after adding "exec-opts": ["native.cgroupdriver=systemd"]

Error diversion
Job for docker.service failed because the control process exited with error
docker cannot start after modifying "exec-opts": ["native.cgroupdriver=systemd"]
the following directives are specified both as a flag and in the configura…

Preface
When installing a k8s cluster, you need to change the cgroup of docker to systemd. After the modification, an error is reported. After searching Baidu and Google, I found that there is no article that solves this problem, so I wrote this article to help novices like me.

Solution
to the reason for startup failure: If you start docker directly, an error will be reported because there is a configuration in docker.service that conflicts with the "exec-opts" just added.

solution:

Solve the error

# 解决报错
# 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