CentOS 7. x docker uses overlay2 storage

  • 2021-09-12 02:41:12
  • OfStack

Edit/etc/docker/daemon. json to add the following:


{
 "storage-driver": "overlay2",
 "storage-opts": [
  "overlay2.override_kernel_check=true"
 ]
}

Installation dependencies:

yum install yum-plugin-ovl -y

Otherwise, the following error will be reported:

May 05 18:20:45 node1 dockerd[49605]: Error starting daemon: error initializing graphdriver: /var/lib/docker contains several valid graphdrivers: overlay2, overlay; Please cleanup or explicitly choose storage driver (-s )

Finally, restart docker

systemctl restart docker

Supplementary knowledge: centos7 compiles and loads toa module

1. To install the kernel-devel package, you need to match the current kernel version 1

yum install kernel-devel

yum update kernel

2. After update kernel, you need to restart the system for it to take effect

3. Get the toa source


cd /usr/local/src/
git clone https://github.com/huaweicloud/elb-toa.git
cd elb-toa/src
make

4. If it is normal, it should generate toa. ko. Under the load test,

insmod toa.ko

lsmod |grep toa

Deploy under nginx test

Add boot-up self-loading

cd /lib/modules/uname -r/kernel/net/

cp /usr/local/src/elb-toa/src/toa.ko .

Add the following sentence to rc. local

insmod /lib/modules/3.10.0-957.21.3.el7.x86_64/kernel/net/toa.ko

Ensure that/etc/rc. d/rc. local has execute permission, otherwise rc. local does not take effect


Related articles: