[DRBD-user] syncsource/synctarget

Papp Tamás tompos at martos.bme.hu
Thu Feb 28 09:51:26 CET 2008

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


Papp Tamás wrote:
>>
>> do not use skip-sync.
>>
>> it does not skip the initial sync, as you may have assumed,
>> it does skip _any_ sync.
>> this was meant as a debug tool in that time, and never to be used in any
>> production environment.
>>
>> do not use skip-sync.
>> never.
>>   
> So there is now way to force a device to be synctarget or syncsource?

Lars, I would be happy, if you write the best way to solve this problem. 
Until that I write, what worked to me.

Problem:

A drbd 0.7 cluster is in split-brain mode and both node was in Primary 
state. The BAD node wants to be SyncSource, even if its cstate is Secondary.

Goal: sync bytes from GOOD node to BAD node.

This behaviour can be seeing by setting '/drbdadm /dev/drbd0 syncer 
--skip-sync/' and plugging the cross cable:

# /drbdsetup /dev/drbd0 syncer --skip-sync

/Plug the cable:/

/# /cat /proc/drbd/
version: 0.7.22 (api:79/proto:74) SVN Revision: 2554 build by 
root at meta1, 2007-06-08 10:51:18
0: cs:*SkippedSyncS *st:*Secondary*/Primary ld:Consistent ns:0 nr:379684 
dw:388896 dr:123304 al:964 bm:1221 lo:0 pe:0 ua:0 ap:0


Resolving:

Primary (*BAD*) node change to Secondary:

# /drbdsetup /dev/drbd0 secondary

/Disconnect the cross cable (maybe here it's enough a /disconnect /command?

Force *GOOD node *to be *SyncSource* (you can not do it with Secondary):/
/
# drbdsetup /dev/drbd0 primary --human

For safety set --skip-sync on both nodes (probably unnecessary?):

# /drbdsetup /dev/drbd0 syncer --skip-sync
/Plug the cross cable and you have to see something like that on the 
*BAD* node:

# /cat /proc/drbd /
version: 0.7.22 (api:79/proto:74) SVN Revision: 2554 build by 
root at meta1, 2007-06-08 10:51:18
0: cs:*SkippedSyncT *st:Secondary/Secondary ld:Consistent ns:0 nr:379684 
dw:388896 dr:123304 al:964 bm:1221 lo:0 pe:0 ua:0 ap:0

You have the right direction.

Disconnect nodes and set syncer back to normal behaviour:

# /drbdsetup /dev/drbd0 disconnect/
# /drbdsetup /dev/drbd0 syncer/

Change *GOOD *node to be Primary:

# drbdsetup /dev/drbd0 primary
/
/Connect nodes to start syncing:/

# drbdsetup /dev/drbd0 connect


/
Bye,

tamas



More information about the drbd-user mailing list