F.2. Configuring HA-LVM Failover with Tagging
To set up HA-LVM failover by using tags in the
/etc/lvm/lvm.conf file, perform the following steps:
- In the global section of the
/etc/lvm/lvm.conffile, ensure that thelocking_typeparameter is set to the value '1' and theuse_lvmetadparameter is set to the value '0'.Note
As of Red Hat Enterprise Linux 6.7, you can use the--enable-halvmoption of thelvmconfto set the locking type to 1 and disablelvmetad. For information on thelvmconfcommand, see thelvmconfman page. - Create the logical volume and file system using standard LVM and file system commands, as in the following example.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For information on creating LVM logical volumes, refer to Logical Volume Manager Administration. - Edit the
/etc/cluster/cluster.conffile to include the newly created logical volume as a resource in one of your services. Alternately, you can use Conga or theccscommand to configure LVM and file system resources for the cluster. The following is a sample resource manager section from the/etc/cluster/cluster.conffile that configures a CLVM logical volume as a cluster resource:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
If there are multiple logical volumes in the volume group, then the logical volume name (lv_name) in thelvmresource should be left blank or unspecified. Also note that in an HA-LVM configuration, a volume group may be used by only a single service. - Edit the
volume_listfield in the/etc/lvm/lvm.conffile. Include the name of your root volume group and your host name as listed in the/etc/cluster/cluster.conffile preceded by @. The host name to include here is the machine on which you are editing thelvm.conffile, not any remote host name. Note that this string MUST match the node name given in thecluster.conffile. Below is a sample entry from the/etc/lvm/lvm.conffile:volume_list = [ "VolGroup00", "@neo-01" ]
volume_list = [ "VolGroup00", "@neo-01" ]Copy to Clipboard Copied! Toggle word wrap Toggle overflow This tag will be used to activate shared VGs or LVs. DO NOT include the names of any volume groups that are to be shared using HA-LVM. - Update the
initramfsdevice on all your cluster nodes:dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)
# dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Reboot all nodes to ensure the correct
initramfsimage is in use.