[Linux-HA] Question: How to configure crm for correct use of drbd
ocf RA
Andrew Beekhof
beekhof at gmail.com
Mon Jan 7 07:00:15 MST 2008
You forgot to mention what version you're using.
You _really_ need to be on the very latest version if you want to use
master/slave functionality.
On Jan 2, 2008, at 1:43 PM, Lukáš Pecha wrote:
> Hello,
> I am trying to setup correctly the drbd ocf resource agent, but it
> still
> doesn't do the things I want.
> I was following the setups described at
> http://linux-ha.org/v2/Concepts/MultiState and at
> http://wiki.linux-ha.org/DRBD/HowTov2.
> I have two nodes and I am using drbd to replicate disks of xen virtual
> machines, so I need only two resource agents - DRBD and Xen.
> When I use drbddisk and Xen RAs, it's all right - I define only a few
> things:
> 1) group of primitives drbdisk and xen
> 2) rule drdbdisk before xen
> 3) preferred place for group set to infinity
> And it runs all right - I have resource stickiness set to zero, so
> when
> I change preffered place, it stops xen domain at first and then set
> drbd
> resource to secondary state. And it immediatelly starts the whole
> group
> on the other node.
>
> That is the behavior I want to achieve with OCF version of drbd RA,
> but
> it still don't work for me.
>
> Here is the constraints part of my cib.xml (full cib is at the end
> of mail):
> <constraints>
> <rule id="rule_pokus2_likes_nodeX" role="master"
> score="INFINITY">
> <expression attribute="#uname" id="sdfhdhfbhjfbvj"
> operation="eq" value="node1"/>
> </rule>
> </rsc_location>
> <rsc_order id="pokus2_before_pokus3" from="pokus3"
> action="start"
> to="pokus2" to_action="promote"/>
> <rsc_colocation id="pokus3_on_pokus2" to="pokus2"
> to_role="master" from="pokus3" score="infinity"/>
> </constraints>
> As you can see, I tell the cluster, that I want node1 to be the master
> for drbd (resource pokus2). Then I add rules, that xen domain (pokus3)
> can run only on node, which have drbd resource in primary state.
> But I still can't figure a way, how to move the resources to the other
> node just by changing the value of preferred node - grouping of the
> resources don't work for combination of primitive and master/slave
> resource. When I shut down heartbeat (or use crm_stanby), it correctly
> shut down the resources and run them on the other node, that's fine.
> But
> I want to move the whole group of resources at one time, not manually
> step-by-step like shut down the xen domain, promote the other node
> to be
> the master, than run the xen domain again... I would like to add some
> more resources to these two, like IPaddr, and I want to be able to
> move
> the whole group of them.
> If it works with drbddisk, there must be a way how to use the ocf drbd
> RA....
>
> Thanks a lot for your suggestions, happy new year and sorry for my
> English, it's not my native language :o)
> Luke
>
>
> Here is the whole cib of mine (it's simplified version, just with the
> two resources I need the most)
>
> <cib admin_epoch="0" have_quorum="true" ignore_dtd="false"
> num_peers="2" cib_feature_revision="1.3" ccm_transition="2"
> generated="true" dc_uuid="8ac3d88f-8d80-467c-b39b-7ab56b8e9038"
> epoch="26" num_updates="413" cib-last-written="Wed Jan 2 09:46:40
> 2008">
> <configuration>
> <crm_config>
> <cluster_property_set id="cib-bootstrap-options">
> <attributes>
> <nvpair name="last-lrm-refresh"
> id="cib-bootstrap-options-last-lrm-refresh" value="1198245924"/>
> </attributes>
> </cluster_property_set>
> </crm_config>
> <nodes>
> <node id="8ac3d88f-8d80-467c-b39b-7ab56b8e9038" uname="node2"
> type="normal"/>
> <node id="caea1435-ba8a-4f05-9a3b-d26c458bd767" uname="node1"
> type="normal"/>
> </nodes>
> <resources>
> <master_slave id="pokus2">
> <instance_attributes id="pokus2_instance_attrs">
> <attributes>
> <nvpair id="pokus2_clone_max" name="clone_max" value="2"/>
> <nvpair id="pokus2_clone_node_max" name="clone_node_max"
> value="1"/>
> <nvpair id="pokus2_master_max" name="master_max"
> value="1"/>
> <nvpair id="pokus2_master_node_max" name="master_node_max"
> value="1"/>
> <nvpair id="pokus2_notify" name="notify" value="yes"/>
> <nvpair id="pokus2_global" name="globally_unique"
> value="no"/>
> <nvpair name="target_role" id="pokus2_target_role"
> value="stopped"/>
> </attributes>
> </instance_attributes>
> <primitive class="ocf" type="drbd" provider="heartbeat"
> id="pokus1">
> <instance_attributes id="pokus1_instance_attrs">
> <attributes>
> <nvpair name="target_role" id="pokus1_target_role"
> value="stopped"/>
> <nvpair id="f370e1ed-b9ed-44e7-803d-b472b41363b5"
> name="drbd_resource" value="drbd0"/>
> </attributes>
> </instance_attributes>
> </primitive>
> </master_slave>
> <primitive class="ocf" type="Xen" provider="heartbeat"
> id="pokus3">
> <instance_attributes id="pokus3_instance_attrs">
> <attributes>
> <nvpair name="target_role" id="pokus3_target_role"
> value="stopped"/>
> <nvpair id="rfegnklerhgjb" name="xmfile"
> value="/etc/xen/vm/pokus"/>
> </attributes>
> </instance_attributes>
> <operations>
> <op id="wehjfbrgnjke" name="stop" timeout="75"/>
> </operations>
> </primitive>
> </resources>
> <constraints>
> <rule id="rule_pokus2_likes_nodeX" role="master"
> score="INFINITY">
> <expression attribute="#uname" id="sdfhdhfbhjfbvj"
> operation="eq" value="node1"/>
> </rule>
> </rsc_location>
> <rsc_order id="pokus2_before_pokus3" from="pokus3"
> action="start"
> to="pokus2" to_action="promote"/>
> <rsc_colocation id="pokus3_on_pokus2" to="pokus2"
> to_role="master" from="pokus3" score="infinity"/>
> </constraints>
> </configuration>
> </cib>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
More information about the Linux-HA
mailing list