[Linux-HA] How to make a colocation rule between a Master/Slave resource's Master and another resource?

Chun Tian (binghe) binghe.lisp at gmail.com
Sat Mar 10 11:15:50 MST 2007


Hi, all

Recently I made a Linux-HA cluster based on DRBD, 20 DRBD master/slave 
resources run at 10 nodes, of cause each DRBD pair can run only on 2 
given nodes. I use this map to distribute DRBDs on 10 nodes: (index-0~9)

(defvar *world* (make-array '(10 4) :initial-contents
;; index-data:
;;( 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 )
'(( 00                         09 10                   17       )  ; index-0
  ( 00 01                            11                   18    )  ; index-1
  (    01 02                            12                   19 )  ; index-2
  (       02 03                   10       13                   )  ; index-3
  (          03 04                   11       14                )  ; index-4
  (             04 05                   12       15             )  ; index-5
  (                05 06                   13       16          )  ; index-6
  (                   06 07                   14       17       )  ; index-7
  (                      07 08                   15       18    )  ; index-8
  (                         08 09                   16       19 )) ; index-9
))

for example drbd0 can run on two node: index-0 and index-1, drbd1 can 
run on two node: index-1 and index-2, ... so DRBD config files on each 
node are different. (I use a Common Lisp program to generate them and 
use GNU Cfengine2 to automatically copy them).

I use 20 Master/Slave DRBD Resource. To restrict DRBD Device's Location, 
I think I must set EACH DRBD Resource which can only run on TWO nodes. 
By using different SCORES (e.g. 100 and 50), I think I can let ONE node 
as a initial Master node. I'm succeed.

Now I need another 20 device group run with each DRBD's Master node, as 
a colocation, but I don't how to write this rule. Can any one give a 
example?

Thank you very much!

Chun Tian (binghe)




More information about the Linux-HA mailing list