📜 ⬆️ ⬇️

GlusterFS snapshots

Installing GlusterFS is not described. Below is a quickstart link. What is snapshots hopefully known. GlusterFS too, on Habré can be read. But here’s an interesting feature, even in the original Quickstart (I recommend shortly and clearly) or it ’s not written here that this configuration does not support snapshots. Let me explain with an example (our server srv1):

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. And what have you not said before? In the documentation further it is, hint that you need to read everything?

Actually, snapshot management is described in the Administrator's Guide. We are talking about the key -T lvcreate creating these thin provisioned LV. You can read here . In fact, what needs to be done. If our disk 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 snapshots.
Just like that, simple and elegant.

Source: https://habr.com/ru/post/334440/


All Articles