[DRBD-user] DRBD and Heartbeat

Thanos Chatziathanassiou tchatzi at arx.gr
Mon Dec 26 18:55:44 CET 2005

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

John Baker wrote:

>I'm evaluating drbd and heartbeat, and have a very simple problem that I'm
>sure others have tackled.
>I have two machines, A and B, both running drbd. Let's consider A to be the
>primary, and B to be the secondary. I would like heartbeat to switch B to
>the primary drbd in the event of A crashing. I do not wish to share an IP
>between the two machines - I just want something like this executed on B:
>  drbdadm primary all ; mount /dev/drbd0 /mnt/drbd0
while the use of this (not sharing an IP) is debatable in my mind, it is 
easy: just do not include an ip resource in your ``haresources'' and it 
should work I suppose.
you need something along the lines of
<node_name> drbddisk::<name_of_drbd_resource> 
e.g. in my case:
nfs_server drbddisk::spool Filesystem::/dev/drbd0::/var/spool::ext3

which as you can guess mounts the drbd resource as a spool directory for 
sendmail - to later export it via nfs, but that's beside the point.
Just make sure to start drbd init script before heartbeat.

>I've been reading the heartbeat (1.2.x) docs and I'm sure this is possible,
>however while I have drbd doing precisely what I want it to do (I'm using
>gentoo - I emerged, quicky configured and it "just worked"), I can not
>get heartbeat working properly.
>So my question is: Is this possible and does anyone have it working?
>If so, do you fancy sharing some heartbeat configuration files (ha.cf and
 From the client standpoint, it's easier if the service presents a 
single highly available IP to the outside world.
But even if you must share an IP resource for heartbeat to work (I don't 
know this, since I've never tried setting up heartbeat without IP 
resources - I'm sure there are people on this list that know, though), 
you can easily share a ``dummy'' IP, that's got nothing to do with 
actual service. That way, eveyone's happy.

>I also have another thought; if A crashes, and B takes over, I do not wish A
>become the primary as soon as it comes back online, or rather, what I'd like
>is a "flip flop" effect. When A crashes and comes back online, I wish it to
>become the secondary drbd instance, resync, and not become the primary until
>B goes offline.
Look at http://www.linux-ha.org/ha_2ecf_2fAutoFailbackDirective
Basically you need ``auto_failback off''

>Thanks in advance, and Merry Christmas.
You too.

>drbd-user mailing list
>drbd-user at lists.linbit.com

More information about the drbd-user mailing list