[DRBD-user] How to become primary when the other node gets dead?

Richard NAGY r.nagy at nameshield.net
Thu Oct 14 10:11:56 CEST 2004

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


Thank you Lars.
Excellent. Every thing is OK!
I applied the little patch and increased a little bit the ha deadtime.

Lars Ellenberg wrote :

>/ 2004-10-13 16:23:49 +0200
>\ Richard NAGY:
>  
>
>>Hello all,
>>
>>I'm facing a problem with drbd and heartbeat. When the master node is 
>>powered off, the secondary node stays in a secondary state. It does not 
>>want to become primary. It says that the other pear is primary, but it 
>>is dead!
>>    
>>
>
>that is when heartbeat deadtime is considerably smaller than drbd ping time.
>heartbeat should try again, if starting a resource failed ...
>oopsie, exit code of drbddisk was always zero ... hm...
>
>you could increase the ha-deadtime, decrease the drbd-ping time,
>but maybe the below patch already helps you.
>
>	Lars Ellenberg
>
>
>Index: DRBD/drbd07/scripts/drbddisk
>===================================================================
>--- DRBD/drbd07/scripts/drbddisk	(revision 1586)
>+++ DRBD/drbd07/scripts/drbddisk	(working copy)
>@@ -23,10 +23,18 @@
> 
> case "$CMD" in
>     start)
>-	$DRBDADM primary $RES
>+    	# try several times, in case heartbeat deadtime
>+	# was smaller than drbd ping time
>+    	try=6
>+	while true; do
>+		$DRBDADM primary $RES && break
>+		let "--try" || exit 20
>+		sleep 1
>+	done
> 	;;
>     stop)
>-	$DRBDADM secondary $RES
>+    	# exec, so the exit code of drbdadm propagates
>+	exec $DRBDADM secondary $RES
> 	;;
>     status)
> 	if [ "$RES" = "all" ]; then
>_______________________________________________
>drbd-user mailing list
>drbd-user at lists.linbit.com
>http://lists.linbit.com/mailman/listinfo/drbd-user
>  
>


-- 
*****************************
Richard NAGY
Nameshield
*****************************




More information about the drbd-user mailing list