[Experience] CentOS7 docker uses overlay storage, centos7docker
For the advantages of docker overlay storage over device mapper, you can search for related information on google. Overlay storage can be used directly on ubuntu 16.04.2, while overlay storage can be used only after preprocessing on CentOS7.
1. CentOS7 Overlay storage status
The CentOS7 kernel is 3.x. the overlay storage driver is officially built based on the kernel, but cannot be loaded directly. Otherwise, exceptions may occur during running of docker and kubernetes. For example:
- Calico node Reports file operation Error
- Kubernetes calico network failure
- Kube-dns deployment failed
2. How to enable CentOS7 Overlay
To enable Overlay storage correctly in CentOS7, refer to the following RedHat documents:
Https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/7.2_Release_Notes/technology-preview-file_systems.html
To put it simply, there are the following points:
2.1 xfs File System
The-n ftype = 1 parameter must be added when formatting the XFS file system.
Note: this parameter is not added by default during CentOS7 installation and is not modified on the installation page. We recommend that you mount another disk or partition, and format it with the ftype = 1 parameter in xfs format:
mkfs.xfs -n ftype=1 /dev/sdbX
2.2 selinux
/Etc/sysconfig/docker remove -- selinux-enabled
2.3 kernel driver
echo 'overlay' > /etc/modules-load.d/overlayreboot