Another Flat Frog

Welcome to SquashedFrog.Net
Sunday, September 05 2010 @ 02:25 AM BST

Controlling DRBD failover with Redhat Cluster Suite

ClusteringDRBD can be controlled by Redhat Clustering Services to allow you to build failover services. When building our HA system, we had a number of services that we only needed to run on 1 out of 2 nodes at any one time, but which required the same underlying data available on both nodes.

The perfect solution for this is DRBD. We run DRBD in active/passive mode, so that at any one time the services run on just 1 node, but those services can be failed over to the other node and still have all their filesystem based information available.

Firstly get your DRBD up and running, synchronized between the 2 nodes. Once you have this you should be able to easily promote each server to master and demote them back to slave. There is a script which comes with the DRBD distro, found in scripts/drbddisk, that is often installed by an rpm package into /etc/ha.d/resource.d
This script is very useful and allows you start, stop and check the status of your drbd filesystem. So it's a perfect candidate to be used as an init script within the Cluster Services. However there is a bit of a problem. When configuring the cluster services through congo you cannot specify a parameter to a script. This script however requires a parameter (the name of the drbd block device to use). The simple solution to this problem is to write a little wrapper script as follows.


#!/bin/sh
exec /etc/ha.d/resource.d/drbddisk r0 $@
In this case, my underlying DRBD device name is known as r0. All we do here is call the script (which has been installed in /etc/ha.d/resource.d) with the parameter r0 and any other parameters that are passed in. The cluster management infrastructure will call this script with start, stop, or status as a parameter, depending on what action is needed at that time.

Links:
DRBD at linux-ha.org
DRBD homepage

Trackback

Trackback URL for this entry: http://www.squashedfrog.net/trackback.php?id=20070924112306961

Here's what others have to say about 'Controlling DRBD failover with Redhat Cluster Suite':

pierre cardin from pierre cardin
Weet jij precies waar pierre cardin het goedkoopst te koop is? Wij vergelijken dagelijks alle nederlandse parfumwinkels en kunnen precies vertellen welke winkel pierre cardin het goedkoopst aanbied! [read more]
Tracked on Wednesday, August 18 2010 @ 01:03 PM BST

Controlling DRBD failover with Redhat Cluster Suite | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.