Snapshots GlusterFS
GlusterFS installation is not described. Below is a link to Quickstart. What snapshots I hope is known. GlusterFS too, on Habré can be read. But here is an interesting feature, even in the original Quickstart (I recommend it shortly and clearly) or it is not written here that this configuration does not support snapshots. Let me explain with an example (our server srv1):
Oops. But what have you not said before? In the documentation there is it further, a hint that everything should be read?
As a matter of fact, the management of snapshots is described in the “Administrator's Guide”. It's about the -T lvcreate key that creates these thinner provisioned LVs. You can read it here . Strictly speaking, what needs to be done. If our drive is / dev / sdb:
on each host (srv1, srv2):
On srv1
Now:
Long names are just snapshots.
So, simple and elegant.
mkdir /tmp/1
mkdir /tmp/2
gluster
gluster> v create vol-test replica 2 transport tcp srv1:/tmp/1 srv1:/tmp2 force
volume create: vol-test: success: please start the volume to access data
gluster> v start vol-test
volume start: vol-test: success
gluster> snapshot create snap-test vol-test
snapshot create: failed: Snapshot is supported only for thin provisioned LV. Ensure that all bricks of vol-test are thinly provisioned LV.
Snapshot command failed
Oops. But what have you not said before? In the documentation there is it further, a hint that everything should be read?
As a matter of fact, the management of snapshots is described in the “Administrator's Guide”. It's about the -T lvcreate key that creates these thinner provisioned LVs. You can read it here . Strictly speaking, what needs to be done. If our drive is / dev / sdb:
on each host (srv1, srv2):
pvcreate /dev/sdb
vgcreate vg_gluster /dev/sdb
lvcreate -L 1G -T vg_gluster/thpool
lvcreate -V 1G -T vg_gluster/thpool -n thinv1
mkfs.xfs /dev/vg_gluster/thinv1
mkdir /bricks/brick1
mount /dev/vg_gluster/thinv1 /bricks/brick1
(после тестов можно внести в /etc/fstab)
On srv1
mkdir /bricks/brick1/brick
gluster
gluster> v create gv0 replica 2 transport tcp srv1:/bricks/brick1/brick srv2:/bricks/brick1/brick
gluster> v start gv0
volume start: vol-test: success
Now:
gluster> snapshot create snap-gv0 gv0
snapshot create: success: Snap snap-gv0_GMT-2017.07.30-13.09.48 created successfully
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos_centos7 -wi-ao---- 6.47g
swap centos_centos7 -wi-ao---- 820.00m
2abab110584d4a04adb7fab814a7e698_0 vg_gluster Vwi-aotz-- 900.00m thpool thinv1 11.09
97e5811fd5ac493b9140fb3a6422f480_0 vg_gluster Vwi-aotz-- 900.00m thpool thinv1 11.09
c4b97c29042c4fd5a072962e4a80966c_0 vg_gluster Vwi-aotz-- 900.00m thpool thinv1 11.09
thinv1 vg_gluster Vwi-aotz-- 900.00m thpool 11.09
thpool vg_gluster twi-aotz-- 900.00m 12.21 3.52
Long names are just snapshots.
So, simple and elegant.