[DRBD-user] DRBD primary/secondary vs both primary

Dan Barker dbarker at visioncomm.net
Sat Jul 24 13:46:20 CEST 2010

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


> Do you have any tip about choosing between a primary/secondary and
primary/primary drbd configuration?
>
> I mean, thinking about a simple disaster recovery setup. In other words:
> A small environment with just two servers. One is working while the other
sleeps and mirrors drbd blocks.
> If primary deads, secondary will be started.
>
> In my logic, this should fit a drbd primary/secondary setup.
>
> But then some questions are arising in my mind, and they are common tasks
in the everyday production life:
> - for some reason I must turn off the main server for maintenance. It will
be set drbd secondary and shut down and for some hours the work will be done
by the server2. Well. When is time to switch back... What is the best
practice to pretty well syncronize the new datas that have been written on
server2's drbd?
> Should I set server2 drbd secondary? (I don't think so)
> Is drbd managing automatically the difference? (i.e. simply setting back
server1 drbd primary)
> Or I should beware about some correct steps to be done?
>
> In other words I can't find some everyday scenarios and practical
cases/practices in drbd online user guide.
>
> I'd really thank you so much if you have some tip/guidelines (or maybe
also some web lins) to help me with that question, because it also matches
the scenario where server1 really dies.
>
> Thank you for reading too.
>
> Kind regards
> Roberto
>

This is the type of question you should ask on the list. I may get it
wrong<g>, or someone else may have a better answer.

I'm assuming you are not using a heartbeat or pacemaker setup, and are not
using a cluster-aware file system and intend to fail over to the stand-by
box manually.

If those assumptions are incorrect, please let us know.

Following a failure of the primary, the secondary should be in WFConnection
and hopefully in UpToDate/Unknown status. If so, on the secondary simply
drbdadm primary <resource>, mount the filesystem, and start the
applications. After the primary is repaired, drbd should rebuild the disks
to match. To fail back to the original machine, use the procedure below,
reversing primary and secondary.

For scheduled maintenance (ie, a planned outage) do this:

 On the primary:
  Stop the applications
  unmount the filesystem
  stop drbd (or drbdadm secondary <resource>, if failing back)
  shutdown (unless failing back)

On the secondary:
 drbdadm primary <resource>
 mount the filesystem
 start the applications

When reestablishing the connection, the disks should automatically
resynchronize. If they do not, the reason will be in the logs. Rectify the
reason and primary, mount, start.

Dan





More information about the drbd-user mailing list