High-Availability Storage with HA-LVM

On all servers, restart the cman service to enable the new configuration:


$ sudo /etc/rc.d/init.d/cman restart

Also, on all servers, start the rgmanager and clvmd services:


$ sudo /etc/rc.d/init.d/rgmanager start
Starting Cluster Service Manager:           [  OK  ]

$ sudo /etc/rc.d/init.d/clvmd start
Starting clvmd:                             [  OK  ]

Assuming that no errors were observed, you now should have a running cluster configured in an active/passive configuration. You can validate this by checking the accessibility of the shared volume on all servers. It should be seen, enabled and mounted on serv-0001 and not on serv-0002. Now comes the moment of truth—that is, testing the failover. Manually power down serv-0001. You will notice the rgmanager kicking in and enabling/mounting the volume on serv-0002.

Note:

To enable these services automatically on reboot, use chkconfig to start the services on all appropriate runlevels.

Summary

In an ideal configuration, fencing agents will need to be configured in the /etc/cluster/cluster.conf file. The purpose of the fencing agent is to handle a problematic node before it causes noticeable issues to the cluster. For example, if a server suffers from a kernel panic, is not communicating with the other servers in the cluster, or something else just as devastating, the IPMI utilities can be configured to reboot the server in question:


<clusternode name="serv-0001" nodeid="1">
     <fence>
         <method name="1">
             <device name="ipmirecover1"/>
         </method>
     </fence>
 </clusternode>
 <clusternode name="serv-0002" nodeid="2">
     <fence>
         <method name="1">
             <device name="ipmirecover2"/>
         </method>
     </fence>
 </clusternode>

[ ... ]

   <fencedevices>
       <fencedevice agent="fence_ipmilan" ipaddr="192.168.1.50" 
        ↪login="ADMIN" passwd="ADMIN" name="ipmirecover1"/>
       <fencedevice agent="fence_ipmilan" ipaddr="192.168.10" 
        ↪login="ADMIN" passwd="ADMIN" name="ipmirecover2"/>
   </fencedevices>

The primary objective of HA-LVM is to provide the data center with enterprise-class fault tolerance at a fraction of the price. No one ever wants to experience server downtimes, and with an appropriate configuration, no one has to. From the data center to your home office, this solution can be deployed almost anywhere.

Resources

clvmd(8): Linux man page

Appendix F. High Availability LVM (HA-LVM): https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/ap-ha-halvm-CA.html

______________________

Petros Koutoupis is a software developer at IBM for its Cloud Object Storage division (formerly Cleversafe). He is also the creator and maintainer of the RapidDisk Project. Petros has worked in the data storage industry for more than a decade.