RHCS and drbd integration (was Re: [Linux-cluster] High Availability option)

Werner Saar saar at pop-dresden.de
Fri Jul 14 16:36:18 UTC 2006

Quoting Riaan van Niekerk <riaan at obsidian.co.za>:

>> Hi Stephen,
>> We've build a very similar HA Cluster with multiple network RAID1 block
>> devices some month ago with RHES 4U3 / RHCS 6.1 and DRBD.  After some
>> fight with the start scripts of RHCS we're now in production with a
>> postgresql DB, some application servers and also a huge NFS share
>> exported to a front end RHCS cluster. All the 'services' use its own
>> block devices  mirrored by DRBD to a second machine. Till now 
>> everything is running very well and speedy.
>> There is only one thing to mention, if you have multiple DRBD block
>> devices to replicate you should have different mirror groups for the
>> replication in the DRBD config. Otherwise it is very easy to saturate
>> even a gig eth.
>> Greetings
>> 	Andreas
> hi Andreas
> Would you care to share you startup scripts? I have looked at drbd as 
> a shared storage replacement in RHCS 4. However the fact that drbd 
> expects promote and demote as script/service parameters (for the 
> heartbeat package drbd resource scripts) and RHCS only understands 
> stop/start, some scripting will need to happen. Please let us others 
> interested in this combination not have the same fight.
> If there is anyone else using drbd with RHCS 4, I would really 
> appreciate it if you could post the relevant scripts which will make 
> rgmanager play nice with drbd.
> To anyone that knows LVM mirroring: if LVM mirroring becomes stable, 
> will it negate the need for drbd?
> To anoyone familiar with Fedora and the inclusion of new features / 
> packages. What would it take to make drbd part of FC and the new 
> cluster middleware in FC (and potentially RHEL). Or (again), will LVM 
> mirroring negate that requirement?
> thank you in advance
> Riaan


I use this script


if [ -f $DEFAULTFILE ]; then


case "$CMD" in
        # Nicht Starten, wenn aktuell SyncTarget
        cat /proc/drbd|grep "^ ${NUM}: cs:SyncTarget" && exit 1
        # try several times, in case heartbeat deadtime
        # was smaller than drbd ping time
        while true; do
                $DRBDADM primary $RES && break
                let "--try" || exit 1
                sleep 1

        # Nicht Stoppen, wenn aktuelle SyncSource
        cat /proc/drbd|grep "^ ${NUM}: cs:SyncSource" && exit 0
        # exec, so the exit code of drbdadm propagates
        $DRBDADM secondary $RES
        if [ $RET = "0" ]; then
                exit 0
                exit 1
        if [ "$RES" = "all" ]; then
            echo "A resource name is required for status inquiries."
            exit 10
        ST=$( $DRBDADM state $RES 2> /dev/null )
        if [ "$ST" = "Primary" ]; then
            echo "running"
            exit 0
            echo "stopped"
            exit 3
        echo "Usage: drbddisk [resource] {start|stop|status}"
        exit 1

exit 0


This message was sent using IMP, the Internet Messaging Program.

More information about the Linux-cluster mailing list