全部博文(150)
分类: 系统运维
2017-03-23 15:23:51
这是docker的一个坑,2015年底遇到并解决了,核心是创建thinpool,用两个逻辑卷来分别存储元数据和实际数据,今天又遇到群里朋友说该问题,翻出来供其参考。
lvcreate --name ThinData --size 200g centos Logical volume "ThinData" created
lvcreate --name ThinMeta --size 20G centos Logical volume "ThinMeta" created
lvconvert --thinpool centos/ThinData --poolmetadata centos/ThinMeta WARNING: Maximum size used by metadata is 16.00 GiB, rest is unused. Logical volume "lvol0" created Converted centos/ThinData to thin pool.
lvcreate --name meta1 --virtualsize 200G --thinpool centos/ThinData Logical volume "meta1" created lvcreate --name data1 --virtualsize 800G --thinpool centos/ThinData Logical volume "data1" created
[root@osd1 ~]# cat /etc/sysconfig/docker-storage DOCKER_STORAGE_OPTIONS= --storage-opt dm.metadatadev=/dev/centos/meta1 --storage-opt dm.datadev=/dev/centos/data1 --storage-opt dm.fs=xfs' /etc/sysconfig/docker-storage
systemctl restart docker