[DRBD-user] Dual-primary split-brain recovery after reboot

Lars Ellenberg lars.ellenberg at linbit.com
Fri Jun 24 19:38:36 CEST 2011

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

On Wed, Jun 22, 2011 at 03:56:18PM -0600, Pete Ashdown wrote:
> On 06/21/2011 04:09 PM, Lars Ellenberg wrote:
> > On Tue, Jun 21, 2011 at 04:03:31PM -0600, Pete Ashdown wrote:
> >> On 06/21/2011 03:55 PM, Lars Ellenberg wrote:
> >>> On Tue, Jun 21, 2011 at 10:13:06AM -0600, Pete Ashdown wrote:
> >>>> If a system properly shuts down drbd upon shutdown, then starts it up upon
> >>>> reboot, I don't understand how there could be pending changes on it. 
> >>>> Shouldn't it just sync up to its peer and go?  Instead I get split-brain
> >>>> every time I reboot a node.  What settings are required to just go
> >>>> secondary, connect, sync, and then go primary upon reboot?
> >>> First make "unused" (umount, typically).
> >>> Then make secondary.
> >>>
> >>> Only then disconnect.
> >>>
> >>> If you disconnect (by for example shutting down the network)
> >>> while both are still in Primary role,
> >>> you get what you observe.
> >>>
> >>> Double check the kill script order,
> >>> or equivalent.
> >> Thank you Lars.
> >>
> >> If I make secondary with the kill script, will it come back as primary upon
> >> reboot, or do I need to specifically insert that into the startup script?
> > DRBD always comes up as Secondary,
> > and will be made Primary by either the drbd init script, if you so chose,
> > or the cluster manager, via some "agent" scripts,
> > or the admin/operator, either directly, or via some other scripts.
> >
> > DRBD does never go Primary by itself.
> >
> > And that is all in the User's Guide ;-)
> Thanks, I actually did read that in the User's Guide, but where I'm
> confused is that the Ubuntu 10.04 init script has this line in it:
>     $DRBDADM sh-b-pri all # Become primary if configured
> So if that is there, is all that I need is to insert a "$DRBDADM secondary
> all" in the stop section?

Certainly not.
I dare say the DRBD init script is fine ;-)

There was something about the correct _order_ of actions
in my original reply.

If you stop things in the wrong order,
then that will lead to what is known as "DRBD split brain".

Of course, if after reboot, you start things in the wrong order,
like promoting to Primary before connecting to the peer,
that will do the same.

You need to get the *order* of the start and stop actions right.

: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
please don't Cc me, but send to list   --   I'm subscribed

More information about the drbd-user mailing list