Openshift 错误解决 "修改docker cgroup driver"

一、Openshift 错误解决 "修改docker cgroup driver"

一、错误如下

failed to run Kubelet: failed to create kubelet: misconfiguration: kubelet cgroup driver: "systemd" is different from docker cgroup driver: "cgroupfs"

二、系统环境

  1、系统信息

# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
# uname -a
Linux jumpserver 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

  2、OpenShift版本

# openshift version
openshift v3.9.0+191fece
kubernetes v1.9.1+a0ce1bc657
etcd 3.2.

  3、oc版本

# oc version
oc v3.9.0+191fece
kubernetes v1.9.1+a0ce1bc657
features: Basic-Auth GSSAPI Kerberos SPNEGO

  4、docker版本

# docker version
Client:
Version: 18.03.-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr ::
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm Server:
Engine:
Version: 18.03.-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr ::
OS/Arch: linux/amd64
Experimental: false

  docker info信息

# docker info
Containers:
Running:
Paused:
Stopped:
Images:
Server Version: 18.03.-ce
Storage Driver: devicemapper
Pool Name: docker-:--pool
Pool Blocksize: .54kB
Base Device Size: .74GB
Backing Filesystem: xfs
Udev Sync Supported: true
Data file: /dev/loop0
Metadata file: /dev/loop1
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Data Space Used: .586GB
Data Space Total: .4GB
Data Space Available: 11GB
Metadata Space Used: .355MB
Metadata Space Total: .147GB
Metadata Space Available: .144GB
Thin Pool Minimum Free Space: .74GB
Deferred Removal Enabled: true
Deferred Deletion Enabled: true
Deferred Deleted Device Count:
Library Version: 1.02.-RHEL7 (--)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.-.el7.x86_64
Operating System: CentOS Linux (Core)
OSType: linux
Architecture: x86_64
CPUs:
Total Memory: .608GiB
Name: jumpserver
ID: JMUS:EDNQ:FY7N:3PJJ:IK6K:FUSS:HTCC:VJME:T7NI:CE6M:4UUH:AYYY
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/
Live Restore Enabled: false WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.

docker info

三、解决方法

  1、更改docker的启动参数

  vim /usr/lib/systemd/system/docker.service

#ExecStart=/usr/bin/dockerd
ExecStart=/usr/bin/dockerd --exec-opt native.cgroupdriver=systemd

  2、重启docker

systemctl daemon-reload
systemctl restart docker
上一篇:READ TABLE 的用法


下一篇:Springboot 4.Springboot 集成SwaggerUi