Required deployment k8s docker environmental problems encountered summary

Ali cloud deployment uses a one-click deployment script:

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

Create the required directories:

mkdir -p /etc/docker /data/docker

Docker then modify the configuration file:

/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 docker main processes:

systemctl start docker

Given as follows:

-- Unit docker.service has begun starting up.
3月 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月 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月 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月 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月 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月 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月 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月 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月 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月 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月 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月 23 15:57:25 hdss7-200.host.com systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE

Various versions of the posts under the 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 upgrade the system is unable to restart

But docker storage drive I replaced devicemapper can start: "Storage-Driver": " devicemapper "

Overlay2 because the performance is much higher than devicemapper, whether production or docker communities are recommended to use this drive, this is a problem around, but

Baidu a bit, we look down the file system supports the ftype, 1 represents the open, 0 is off

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

Since I was a PD mac virtual machine out of the virtual machine, windows use VM may not encounter this problem, ftype not turned on, then reformat the disk, plus support to this parameter

I have here added a new one disk, designed to mount the storage directory docker, open the virtual machine configuration, the new disk

image.png

[root@test-docker ~]# fdisk  -l
Disk / dev / sda: 9663 MB, 9663676416 bytes, 18,874,368 Sector
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical / physical): 512 bytes / 4096 bytes
I / O Size (minimal / optimal): 4096 bytes / 4096 bytes
Disk Label Type: dos
Disk identifier: 0x00012036
   设备 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, 8,388,608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical / physical): 512 bytes / 4096 bytes
I / O Size (minimal / optimal): 4096 bytes / 4096 bytes

We can see that already have a new disk, then the disk format

[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 finobt = = 1 = 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, 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

Check whether to support ftype:

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

Docker start the process again, you can


Guess you like

Origin blog.51cto.com/13520772/2481067