我们使用centos7.2系统,部署docker daemon, 在yum安装完docker 后默认是loop-lvm ,可以直接使用,但是不适合生产环境见,文档原文“The preferred configuration for production deployments is direct-lvm, 而且默认的 Data Space 也只有 100G,接下来我们就要做2件事情,配置 docker devicemapper 使用 direct-lvm, 并且加大 Data Space至350G.
设备 Boot Start End Blocks Id System
/dev/vdb1 2048 734005247 367001600 83 Linux
/dev/vdb2 734005248 1048575999 157285376 83 Linux
setp 2. 配置 /dev/vdb1分区
pvcreate /dev/vdb1
Physical volume `/dev/vdb1` successfully created
vgcreate docker /dev/xvdf
Volumegroup `docker` successfully created
查看vg相关信息
[root@kuber-minion-60 ~]# vgdisplay
--- Volume group ---
VG Name docker
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 14
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 350.00 GiB
PE Size 4.00 MiB
Total PE 89599
Alloc PE / Size 89524 / 349.70 GiB
Free PE / Size 75 / 300.00 MiB
VG UUID 8eNJFD-OVPF-U1f0-ZQE4-Hk1B-ifAa-0ZSPh7
step 3. 配置/etc/sysconfig/docker-storage-setup
# Edit this file to override any configuration options specified in
# /usr/lib/docker-storage-setup/docker-storage-setup.
#
# For more details refer to "man docker-storage-setup"
VG=docker // 与上面生成的vg名称要一致
DATA_SIZE=349g // 生成逻辑卷的容量大小