HowTo create mirror LVM with pacemaker HA-cluster RHEL 7
Par nicolas le mercredi 4 mai 2016, 17:57 - Bugs resolves - astuces - Lien permanent
hi,
here about a tips to add / remove an LV using raid mirror with multiple slice and all that with HA-cluster RHEL 7.1
HA-cluster is monitored by Pacemaker
why this ticket ?
Just becaus there is a redhat bug implementation and RedHat support don't find alone solution.
So, first the need is : (we have already 4 PV using multipath, and 1 VG "vgtest" already using pacemaker resource)
lvcreate -m1 -i2 -I 128 -L 200m -n test4 vgtest /dev/mapper/pv1-1 /dev/mapper/pv2-1 /dev/mapper/pv1-2 /dev/mapper/pv2-2
First, we have to stop resource onto active node
pcs resource disable $resource_name_vgtest
then we need to reconfigure /etc/lvm/lvm.conf
locking_type = 1
ignore_lvm_mirrors = 0 => (set 1 if ou need remove a failed or inactive LV/VG)
use_lvmetad = 1
## Add the VG into locale volume list group:
volume_list = [ "vgroot", "vgtest" ]
reload lvm :
systemctl restart lvm2-lvmetad
# create your LV with raid 1 onto 4 slice #
lvcreate -m1 -i2 -I 128 -L 200m -n test4 vgtest /dev/mapper/pv1-1 /dev/mapper/pv2-1 /dev/mapper/pv1-2 /dev/mapper/pv2-2
# format it - default xfs under RHEL 7 #
mkfs.xfs /dev/vgtest/test4 or /dev/mapper/vgtest-test4
## backoff local LV to cluster ##
edit /etc/lvm/lvm.conf and change to this properties
volume_list = [ "vgroot" ]
# reload lvm service
systemctl restart lvm2-lvmetad
# enable pacemaker resource
pcs resource enable $resource_name_vgtest
You can check it :
pcs resource || pcs status
## all have to be "started" ##
## Then you can mount this Lv as any other FileSystem mount method ##
## If not all started, use a clean to purge all failed and redetect status
pcs resource cleanup $Resource_name