[DRBD-user] How to colocate multiple DRBD resources in HB2?

Lars Ellenberg lars.ellenberg at linbit.com
Mon Feb 23 14:17:52 CET 2009

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


On Mon, Feb 23, 2009 at 10:50:30AM +0100, Kai Stian Olstad wrote:
> Hi,
> 
> I'm setting up a file server cluster with SLES 10, DRBD 8.2.7, LVM2,
> Samba 3.2.8 and Heartbeat 2.1.4.
> The DRBD resources is master/slave (ocf/heartbeat).
> 
> In this configuration it will be multiple DRBD resources that are
> added to the same volume group in LVM.

you mean these are PVs of a VG made from multiple DRBD?

you are aware that we recommend against such a setup,
as long as we cannot provide write ordering accross multiple DRBD.

> To make this work i'll have to get all the DRBD masters to run on the
> same node, but I have problem in doing so.
> 
> The DRBD resource is configuration:
> <master_slave id="drbd-felles1">
>   <meta_attributes id="drbd-felles1_meta_attrs">
>     <attributes>
>       <nvpair id="drbd-felles1_metaattr_target_role"
> name="target_role" value="started"/>
>       <nvpair id="drbd-felles1_metaattr_clone_max" name="clone_max"
> value="2"/>
>       <nvpair id="drbd-felles1_metaattr_clone_node_max"
> name="clone_node_max" value="1"/>
>       <nvpair id="drbd-felles1_metaattr_master_max" name="master_max"
> value="1"/>
>       <nvpair id="drbd-felles1_metaattr_master_node_max"
> name="master_node_max" value="1"/>
>       <nvpair id="drbd-felles1_metaattr_notify" name="notify"
> value="true"/>
>       <nvpair id="drbd-felles1_metaattr_globally_unique"
> name="globally_unique" value="false"/>
>     </attributes>
>   </meta_attributes>
>   <primitive id="res-drbd-felles1" class="ocf" type="drbd"
> provider="heartbeat">
>     <instance_attributes id="res-drbd-felles1_instance_attrs">
>       <attributes>
>         <nvpair id="4a811802-ce58-4b53-8022-412672411c77"
> name="drbd_resource" value="felles1"/>
>       </attributes>
>     </instance_attributes>
>   </primitive>
> </master_slave>
> 
> I also have one more that is called felles2 instead of felles1.
> 
> To make the master be on the same node I have tried this colocation rule:
> <rsc_colocation id="drbd-felles2_on_drbd-felles1" to="drbd-felles1"
> to_role="master" from="drbd-felles2" score="infinity"/>
> 
> What happens is that drbd-felles1 is running master(primary) on node1
> and slave(secondary) on the other node2.
> When I start the drbd-felles2 it will run master on node1 but doesn't
> start at all on node2.
> 
> If I remove colocation rule or lover the score the drbd-felles2 slave
> will start on node2, but then I'm not guarantied that the masters will
> run on the same node.
> 
> Does anyone have a solution or suggestion to this problem?

I think that default "action" for constraints is "start".
in this case, you want the constraint on the action "promote".

try somthing like
<rsc_colocation id="drbd-felles2_on_drbd-felles1"
	action="promote" to="drbd-felles1" from="drbd-felles2" score="infinity"/>
I may be wrong, though.

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
__
please don't Cc me, but send to list   --   I'm subscribed



More information about the drbd-user mailing list