Summary of problems encountered in docker environment required for k8s deployment

Alibaba cloud's one click deployment script is used for deployment:

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

Create the required directory:

mkdir -p /etc/docker /data/docker

Then modify the configuration file of docker:

/etc/docker/daemon.json
{
  "graph": "/data/docker",
  "storage-driver": "overlay2",
  "insecure-registries": ["registry.access.redhat.com","quay.io","harbor.od.com"],
  "registry-mirrors": ["https://q2gr04ke.mirror.aliyuncs.com"],
  "bip": "172.7.21.1/24",
  "exec-opts": ["native.cgroupdriver=systemd"],
  "live-restore": true
}

Start the docker main process:

systemctl start docker

The error is reported as follows:

-- Unit docker.service has begun starting up.
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.461032341+08:00" level=warning msg="The \"graph\" config file option is deprecated. Please use \"data-
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.461139245+08:00" level=info msg="Starting up"
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.462111770+08:00" level=info msg="parsed scheme: \"unix\"" module=grpc
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.462133686+08:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=gr
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.462156382+08:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/co
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.462170319+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.463849163+08:00" level=info msg="parsed scheme: \"unix\"" module=grpc
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.463873948+08:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=gr
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.463891615+08:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/co
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: time="2020-03-23T15:57:25.463901258+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
3 month 23 15:57:25 hdss7-200.host.com dockerd[4420]: failed to start daemon: error initializing graphdriver: overlay2: the backing <unknown> filesystem is formatted without d_type s
3 month 23 15:57:25 hdss7-200.host.com systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE

Versions of the post environment:

[root@hdss7-200 ~]# rpm -qa |grep docker
docker-ce-cli-19.03.8-3.el7.x86_64
docker-ce-19.03.8-3.el7.x86_64
[root@hdss7-200 ~]# uname -a
Linux hdss7-200.host.com 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@hdss7-200 ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

yum update -y upgraded the system and failed to restart

But when I change the docker storage driver to devicemapper, I can start: "storage driver": "devicemapper"

Because the performance of overlay 2 is much higher than that of device mapper, it is recommended to use this driver in both the production environment and the docker community. This problem cannot be solved

Baidu, let's see if the file system supports ftype. 1 means on, 0 means off

[root@hdss7-200 ~]# xfs_info /|grep ftype
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0

Because I am a virtual machine of mac's PD virtual machine, windows may not encounter this problem when using VM. If ftype is not turned on, reformat the disk and add the support of this parameter

I have added a new disk here, which is specially used to mount the storage directory of docker, open the virtual machine configuration, and add a new disk

[root@test-docker ~]# fdisk  -l
 Disk / dev/sda: 9663 MB, 9663676416 bytes, 18874368 sectors
 Units = sector of 1 * 512 = 512 bytes
 Sector size (logical / physical): 512 bytes / 4096 bytes
 I/O size (min / best): 4096 bytes / 4096 bytes
 Disk label type: dos
 Disk identifier: 0x00012036
 Device Boot Start End Blocks Id System
/dev/sda1   *        2048     1050623      524288   83  Linux
/dev/sda2         1050624     2099199      524288   82  Linux swap / Solaris
/dev/sda3         2099200    18868223     8384512   83  Linux
 Disk / dev/sdb: 4294 MB, 4294967296 bytes, 8388608 sectors
 Units = sector of 1 * 512 = 512 bytes
 Sector size (logical / physical): 512 bytes / 4096 bytes
 I/O size (min / best): 4096 bytes / 4096 bytes

We can see that there is a new disk. Next, format the disk

[root@test-docker ~]# mkfs.xfs -n ftype=1 /dev/sdb
meta-data=/dev/sdb               isize=512    agcount=4, agsize=262144 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=1048576, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

View UUID and write fstab to mount:

[root@test-docker ~]# blkid /dev/sdb
/dev/sdb: UUID="19c3255a-1cfe-4636-b6fd-a3773b8c0dd4" TYPE="xfs"
[root@test-docker ~]# cat /etc/fstab
UUID=d267d18d-f3c2-4f41-9569-1e7b14c9bab9 /                       xfs     defaults        0 0
UUID=b0c55bef-7339-4fe9-a3aa-a07a83b14796 /boot                   xfs     defaults        0 0
UUID=cd27ca37-2d74-4276-b9bc-18e330da344d swap                    swap    defaults        0 0
UUID=19c3255a-1cfe-4636-b6fd-a3773b8c0dd4 /data/docker            xfs     defaults        0 0
[root@test-docker ~]# mount -a

To see if ftype is supported:

[root@test-docker ~]# xfs_info  /data/docker|grep ftype
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1

Start the docker process again


Keywords: Linux Docker Unix ascii

Added by zenag on Mon, 23 Mar 2020 11:23:01 +0200