部署k8s啓動docker報錯

通過journalctl -xe查看日誌記錄,有如下提示
Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boo…ed=false)

[root@centos-minion yum.repos.d]# 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 六 2019-05-11 20:41:34 CST; 7s ago
     Docs: http://docs.docker.com
  Process: 13532 ExecStart=/usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current --init-path=/usr/libexec/docker/docker-init-current --seccomp-profile=/etc/docker/seccomp.json $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES (code=exited, status=1/FAILURE)
 Main PID: 13532 (code=exited, status=1/FAILURE)

5月 11 20:41:32 centos-minion systemd[1]: Starting Docker Application Container Engine...
5月 11 20:41:32 centos-minion dockerd-current[13532]: time="2019-05-11T20:41:32.254279015+08:00" level=warning msg="could not change group /var/run/docker.sock...ot found"
5月 11 20:41:32 centos-minion dockerd-current[13532]: time="2019-05-11T20:41:32.259190066+08:00" level=info msg="libcontainerd: new containerd process, pid: 13538"
5月 11 20:41:34 centos-minion dockerd-current[13532]: Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boo...ed=false)
5月 11 20:41:34 centos-minion systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
5月 11 20:41:34 centos-minion systemd[1]: Failed to start Docker Application Container Engine.
5月 11 20:41:34 centos-minion systemd[1]: Unit docker.service entered failed state.
5月 11 20:41:34 centos-minion systemd[1]: docker.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

原因分析:
根據報錯信息“Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disabl…nabled=false)”的提示,這臺機器的linux的內核中的SELinux不支持 overlay2 graph driver 。
解決方法有兩個,要麼啓動一個新內核,要麼就在docker配置文件裏面裏禁用selinux,–selinux-enabled=false

解決方法
沒有啓動新的內核,修改的docker配置文件。將配置文件的“–selinux-enabled”改成“–selinux-enabled=false”,然後再重啓docker。

[root@centos-minion ~]# cat /etc/sysconfig/docker
# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS='--selinux-enabled=false --log-driver=journald --signature-verification=false'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi

歡迎查閱《centos部署k8s搭建kubernetes集羣》
https://blog.csdn.net/qq_23598037/article/details/90116334

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章