docker daemon.json 新增
“exec-opts”: [“native.cgroupdriver=systemd”],重启docker 私有仓库服务报RT错误
[root@k8s k8s]#cat daemon.json
{
"exec-opts": ["native.cgroupdriver=systemd"],
"insecure-registries": ["k8s.node.master.01:5000"]
}
[root@k8s k8s]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ede2561282af registry:latest "/entrypoint.sh /etc…" 31 minutes ago Exited (2) 9 minutes ago 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp registry
[root@k8s k8s]# docker start ed
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:385: applying cgroup configuration for process caused: Cannot set property TasksAccounting, or unknown property.: unknown
Error: failed to start containers: ed
[root@k8s k8s]# journalctl -fu docker
-- Logs begin at Tue 2021-12-14 19:07:19 CST. --
...
Dec 14 19:50:00 k8s.node.master.01 dockerd[17671]: time="2021-12-14T19:50:00.814179231+08:00" level=error msg="Handler for POST /v1.41/containers/ed/start returned error: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:385: applying cgroup configuration for process caused: Cannot set property TasksAccounting, or unknown property.: unknown"
^C
[root@k8s k8s]#
更新 systemd
###
[root@k8s module]# ll
total 18048004
-rw-r--r--. 1 root root 8280604672 Dec 14 16:01 CentOS-7-x86_64-Everything-1611.iso
-rw-r--r--. 1 root root 10200547328 Dec 14 19:51 CentOS-7-x86_64-Everything-2009.iso
drwxr-xr-x. 2 root root 4096 Dec 14 18:53 docker
drwxr-xr-x. 2 root root 6 Dec 14 18:54 images
drwxr-xr-x. 4 root root 56 Dec 14 19:37 k8s
drwxr-xr-x. 2 root root 177 Dec 14 16:21 rpm
[root@k8s module]# mount -o loop CentOS-7-x86_64-Everything-2009.iso /var/www/html/centos7/
mount: /dev/loop0 is write-protected, mounting read-only
[root@k8s module]# yum clean all
[root@k8s module]# yum makecache
### 更新前 ###
[root@k8s module]# yum info systemd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Installed Packages
Name : systemd
Arch : x86_64
Version : 219
Release : 30.el7
Size : 21 M
Repo : installed
From repo : anaconda
Summary : A System and Service Manager
URL : http://www.freedesktop.org/wiki/Software/systemd
License : LGPLv2+ and MIT and GPLv2+
Description : systemd is a system and service manager for Linux, compatible with
: SysV and LSB init scripts. systemd provides aggressive parallelization
: capabilities, uses socket and D-Bus activation for starting services,
: offers on-demand starting of daemons, keeps track of processes using
: Linux cgroups, supports snapshotting and restoring of the system
: state, maintains mount and automount points and implements an
: elaborate transactional dependency-based service control logic. It can
: work as a drop-in replacement for sysvinit.
Available Packages
Name : systemd
Arch : x86_64
Version : 219
Release : 78.el7
Size : 5.1 M
Repo : base
Summary : A System and Service Manager
URL : http://www.freedesktop.org/wiki/Software/systemd
License : LGPLv2+ and MIT and GPLv2+
Description : systemd is a system and service manager for Linux, compatible with
: SysV and LSB init scripts. systemd provides aggressive parallelization
: capabilities, uses socket and D-Bus activation for starting services,
: offers on-demand starting of daemons, keeps track of processes using
: Linux cgroups, supports snapshotting and restoring of the system
: state, maintains mount and automount points and implements an
: elaborate transactional dependency-based service control logic. It can
: work as a drop-in replacement for sysvinit.
[root@k8s module]#
### 更新后 ###
[root@k8s module]# yum update systemd
[root@k8s module]# yum info systemd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Installed Packages
Name : systemd
Arch : x86_64
Version : 219
Release : 78.el7
Size : 23 M
Repo : installed
From repo : base
Summary : A System and Service Manager
URL : http://www.freedesktop.org/wiki/Software/systemd
License : LGPLv2+ and MIT and GPLv2+
Description : systemd is a system and service manager for Linux, compatible with
: SysV and LSB init scripts. systemd provides aggressive parallelization
: capabilities, uses socket and D-Bus activation for starting services,
: offers on-demand starting of daemons, keeps track of processes using
: Linux cgroups, supports snapshotting and restoring of the system
: state, maintains mount and automount points and implements an
: elaborate transactional dependency-based service control logic. It can
: work as a drop-in replacement for sysvinit.
[root@k8s module]# docker start ed
ed
[root@k8s module]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ede2561282af registry:latest "/entrypoint.sh /etc…" 36 minutes ago Up 7 seconds 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp registry
[root@k8s module]#