[DRBD-user] Procedure for making secondary server primary if primary is destroyed?

Maros Timko timkom at gmail.com
Mon May 24 12:18:06 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.


> If the Primary server in the 2 node cluster completely fails and the drbd
> partition/data is lost, how do I force the Secondary server to become the
> Primary drbd resource?
> I have simulated this by shutting down the switch port that the Primary
> server is connected to.  I did hope that the pacemaker would just
> automatically failover to the secondary server and promote the DRBD resource
> as primary, but this did not occur and if I cat /proc/drbd on the secondary
> server, this is the state it is currently in:
>
> # cat /proc/drbd
> version: 8.3.7 (api:88/proto:86-91)
> GIT-hash: ea9e28dbff98e331a62bcbcc63a613
>
>
>  1: cs:WFConnection ro:Secondary/Unknown ds:Inconsistent/DUnknown C r----
>    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:564835

Your data are Inconsistent meaning the initial resync is not done yet.
Are you sure you want to use it?

>
> So lets pretend that the above state was a result of the Primary getting
> destroyed, how do I force the Secondary (inconsistent resource) to become
> the Primary?  How do I get drbd to ignore the fact that it is in an
> inconsistent state and force to be primary so that the cluster can mount the
> partition and service can resume?  Sure, there might be some lost data, but
> that's better than losing all the data.  I have tried running "drbdadm
> primary r0" but get the following error:
>
> # drbdadm primary r0
> 1: State change failed: (-2) Refusing to be Primary without at least one
> UpToDate disk
> Command 'drbdsetup 1 primary' terminated with exit code 17
>
> I have read through the DRBD documentation, but have not been able to find
> instructions on how to resolve this problem.

http://www.drbd.org/users-guide/re-drbdsetup.html

primary
-o, --overwrite-data-of-peer

    Alias for --force.

-f, --force

    Becoming primary fails if the local replica is not up-to-date.
I.e. when it is inconsistent, outdated of consistent. By using this
option you can force it into primary role anyway. USE THIS OPTION ONLY
IF YOU KNOW WHAT YOU ARE DOING.

>
> Any help would be very much appreciated.
>
> Cheers,
> Tom



More information about the drbd-user mailing list