Michael Schwartzkopff escribió:
Am Donnerstag, 15. Mai 2008 10:47 schrieb Adrian Chapela:
(...)
I find the solution for my problem. My problem is the order of my
resources. I need to order the resources exactly as the execute order.
If I need to order the resources at resources section, Why need I write
some constraints to order resources ? I suppose the write order of
resources was independent of order constraints.
Can you explain me a bit ?
The order in which resrouces are displayed using cibadmin -Q -o resources or
the GUI does NOT have any connection to the order in which they are started.
If you need a specific start (and stop) ordrer you have to use constraints.
See:
http://www.linux-ha.org/Constraints
This was I think. I don't use GUI, I edit the cib.xml file and in my
tests I saw the resources write order affects to constraints (or vice
versa, I don't know exactly).
You can test it with:
<resources>
<group id="FW_GROUP">
<primitive class="lsb" id="tunnel_vf1" provider="linux"
type="tunnel_vf1" resource_stickiness="0">
<operations>
<op id="tunel_vf1_op1" name="start" timeout="5s"/>
<op id="tunel_vf1_op2" name="stop" timeout="5s"/>
<op id="tunel_vf1_op3" interval="10s" name="monitor"
timeout="4s"/>
</operations>
</primitive>
<primitive class="lsb" id="tunnel_vf2" provider="linux"
type="tunnel_vf2" resource_stickiness="0">
<operations>
<op id="tunel_vf2_op1" name="start" timeout="5s"/>
<op id="tunel_vf2_op2" name="stop" timeout="5s"/>
<op id="tunel_vf2_op3" interval="10s" name="monitor"
timeout="4s"/>
</operations>
</primitive>
<primitive class="lsb" id="tunnel_vf3" provider="linux"
type="tunnel_vf3" resource_stickiness="0">
<operations>
<op id="tunel_vf3_op1" name="start" timeout="5s"/>
<op id="tunel_vf3_op2" name="stop" timeout="5s"/>
<op id="tunel_vf3_op3" interval="10s" name="monitor"
timeout="4s"/>
</operations>
</primitive>
<primitive class="lsb" id="shorewall_HA" provider="linux"
type="shorewall_HA" resource_stickiness="0">
<operations>
<op id="shorewall_op1" name="start" timeout="5s"/>
<op id="shorewall_op2" name="stop" timeout="5s"/>
<op id="shorewall_op3" interval="10s" name="monitor"
timeout="4s"/>
</operations>
</primitive>
<primitive class="ocf" id="IPaddr_mundor1" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="1" interval="5s" name="monitor" timeout="5s"/>
<op id="2" name="start" timeout="5s"/>
<op id="3" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="mundor_opts">
<attributes>
<nvpair id="ip1" name="ip" value="192.168.20.220"/>
<nvpair id="ip2" name="netmask" value="24"/>
<nvpair id="ip3" name="gw" value="192.168.20.254"/>
<nvpair id="ip4" name="nic" value="mundor"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_mundor2" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="4" interval="5s" name="monitor" timeout="5s"/>
<op id="5" name="start" timeout="5s"/>
<op id="6" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="mundor_opts_lan">
<attributes>
<nvpair id="ip5" name="ip" value="91.117.252.10"/>
<nvpair id="ip6" name="netmask" value="30"/>
<nvpair id="ip8" name="nic" value="mundor"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_lan" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="7" interval="5s" name="monitor" timeout="5s"/>
<op id="8" name="start" timeout="5s"/>
<op id="9" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="lan_opts">
<attributes>
<nvpair id="ip9" name="ip" value="192.168.19.254"/>
<nvpair id="ip10" name="netmask" value="24"/>
<nvpair id="ip12" name="nic" value="lan"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_lan2" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="10" interval="5s" name="monitor" timeout="5s"/>
<op id="11" name="start" timeout="5s"/>
<op id="12" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="lan2_opts">
<attributes>
<nvpair id="ip13" name="ip" value="192.168.18.254"/>
<nvpair id="ip14" name="netmask" value="24"/>
<nvpair id="ip16" name="nic" value="lan2"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_lan2_2" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="13" interval="5s" name="monitor" timeout="5s"/>
<op id="14" name="start" timeout="5s"/>
<op id="15" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="lan2_opts2">
<attributes>
<nvpair id="ip17" name="ip" value="192.168.17.254"/>
<nvpair id="ip18" name="netmask" value="24"/>
<nvpair id="ip20" name="nic" value="lan2"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_auna" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="16" interval="5s" name="monitor" timeout="5s"/>
<op id="17" name="start" timeout="5s"/>
<op id="18" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="auna_opts">
<attributes>
<nvpair id="ip21" name="ip" value="192.168.21.220"/>
<nvpair id="ip22" name="netmask" value="24"/>
<nvpair id="ip24" name="nic" value="auna"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="lsb" id="Quagga" provider="linux"
type="quagga" resource_stickiness="0">
<operations>
<op id="quagga_op1" name="start" timeout="30s"/>
<op id="quagga_op2" interval="30s" name="monitor" timeout="2s"/>
<op id="quagga_op3" name="stop" timeout="30s"/>
</operations>
</primitive>
</group>
<clone id="pingd">
<instance_attributes id="pingd">
<attributes>
<nvpair id="pingd-clone_node_max" name="clone_node_max"
value="1"/>
</attributes>
</instance_attributes>
<primitive id="pingd-child" provider="heartbeat" class="ocf"
type="pingd">
<operations>
<op id="pingd-child-monitor" name="monitor" interval="20s"
timeout="40s" prereq="nothing"/>
<op id="pingd-child-start" name="start" prereq="nothing"/>
</operations>
<instance_attributes id="pingd_inst_attr">
<attributes>
<nvpair id="pingd-dampen" name="dampen" value="5s"/>
<nvpair id="pingd-multiplier" name="multiplier" value="100"/>
</attributes>
</instance_attributes>
</primitive>
</clone>
</resources>
<constraints>
<rsc_order id="order_transition_1" from="tunnel_vf1"
action="start" type="before" to="tunnel_vf2"/>
<rsc_order id="order_transition_2" from="tunnel_vf2"
action="start" type="before" to="tunnel_vf3"/>
<rsc_order id="order_transition_3" from="tunnel_vf3"
action="start" type="before" to="Quagga"/>
<rsc_order id="order_transition_4" from="Quagga" action="start"
type="before" to="IPaddr_mundor1"/>
<rsc_order id="order_transition_5" from="IPaddr_mundor1"
action="start" type="before" to="IPaddr_mundor2"/>
<rsc_order id="order_transition_6" from="IPaddr_mundor2"
action="start" type="before" to="IPaddr_lan"/>
<rsc_order id="order_transition_7" from="IPaddr_lan"
action="start" type="before" to="IPaddr_lan2"/>
<rsc_order id="order_transition_8" from="IPaddr_lan2"
action="start" type="before" to="IPaddr_lan2_2"/>
<rsc_order id="order_transition_9" from="IPaddr_lan2_2"
action="start" type="before" to="IPaddr_auna"/>
<rsc_order id="order_transition_10" from="IPaddr_auna"
action="start" type="before" to="shorewall_HA"/>
<rsc_location id="my_resource:connected" rsc="FW_GROUP">
<rule id="my_resource:prefer:fwlocatel" score="500">
<expression id="my_resource:prefer:fwlocatel:expr"
attribute="#uname" operation="eq" value="fwlocatel"/>
</rule>
<rule id="my_resource:connected:rule" score="-INFINITY"
boolean_op="or">
<expression id="my_resource:connected:expr:undefined"
attribute="pingd" operation="not_defined"/>
<expression id="my_resource:connected:expr:zero"
attribute="pingd" operation="lte" value="0"/>
</rule>
</rsc_location>
</constraints>
If you use this two sections the resources starting doesn't run well,
but if you use the above constraints and the next resources section:
<resources>
<group id="FW_GROUP">
<primitive class="lsb" id="tunnel_vf1" provider="linux"
type="tunnel_vf1" resource_stickiness="0">
<operations>
<op id="tunel_vf1_op1" name="start" timeout="5s"/>
<op id="tunel_vf1_op2" name="stop" timeout="5s"/>
<op id="tunel_vf1_op3" interval="10s" name="monitor"
timeout="4s"/>
</operations>
</primitive>
<primitive class="lsb" id="tunnel_vf2" provider="linux"
type="tunnel_vf2" resource_stickiness="0">
<operations>
<op id="tunel_vf2_op1" name="start" timeout="5s"/>
<op id="tunel_vf2_op2" name="stop" timeout="5s"/>
<op id="tunel_vf2_op3" interval="10s" name="monitor"
timeout="4s"/>
</operations>
</primitive>
<primitive class="lsb" id="tunnel_vf3" provider="linux"
type="tunnel_vf3" resource_stickiness="0">
<operations>
<op id="tunel_vf3_op1" name="start" timeout="5s"/>
<op id="tunel_vf3_op2" name="stop" timeout="5s"/>
<op id="tunel_vf3_op3" interval="10s" name="monitor"
timeout="4s"/>
</operations>
</primitive>
<primitive class="lsb" id="Quagga" provider="linux"
type="quagga" resource_stickiness="0">
<operations>
<op id="quagga_op1" name="start" timeout="30s"/>
<op id="quagga_op2" interval="30s" name="monitor" timeout="2s"/>
<op id="quagga_op3" name="stop" timeout="30s"/>
</operations>
</primitive>
<primitive class="ocf" id="IPaddr_mundor1" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="1" interval="5s" name="monitor" timeout="5s"/>
<op id="2" name="start" timeout="5s"/>
<op id="3" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="mundor_opts">
<attributes>
<nvpair id="ip1" name="ip" value="192.168.20.220"/>
<nvpair id="ip2" name="netmask" value="24"/>
<nvpair id="ip3" name="gw" value="192.168.20.254"/>
<nvpair id="ip4" name="nic" value="mundor"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_mundor2" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="4" interval="5s" name="monitor" timeout="5s"/>
<op id="5" name="start" timeout="5s"/>
<op id="6" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="mundor_opts_lan">
<attributes>
<nvpair id="ip5" name="ip" value="91.117.252.10"/>
<nvpair id="ip6" name="netmask" value="30"/>
<nvpair id="ip8" name="nic" value="mundor"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_lan" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="7" interval="5s" name="monitor" timeout="5s"/>
<op id="8" name="start" timeout="5s"/>
<op id="9" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="lan_opts">
<attributes>
<nvpair id="ip9" name="ip" value="192.168.19.254"/>
<nvpair id="ip10" name="netmask" value="24"/>
<nvpair id="ip12" name="nic" value="lan"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_lan2" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="10" interval="5s" name="monitor" timeout="5s"/>
<op id="11" name="start" timeout="5s"/>
<op id="12" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="lan2_opts">
<attributes>
<nvpair id="ip13" name="ip" value="192.168.18.254"/>
<nvpair id="ip14" name="netmask" value="24"/>
<nvpair id="ip16" name="nic" value="lan2"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_lan2_2" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="13" interval="5s" name="monitor" timeout="5s"/>
<op id="14" name="start" timeout="5s"/>
<op id="15" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="lan2_opts2">
<attributes>
<nvpair id="ip17" name="ip" value="192.168.17.254"/>
<nvpair id="ip18" name="netmask" value="24"/>
<nvpair id="ip20" name="nic" value="lan2"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" id="IPaddr_auna" provider="heartbeat"
type="IPaddr" resource_stickiness="0">
<operations>
<op id="16" interval="5s" name="monitor" timeout="5s"/>
<op id="17" name="start" timeout="5s"/>
<op id="18" name="stop" timeout="5s"/>
</operations>
<instance_attributes id="auna_opts">
<attributes>
<nvpair id="ip21" name="ip" value="192.168.21.220"/>
<nvpair id="ip22" name="netmask" value="24"/>
<nvpair id="ip24" name="nic" value="auna"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="lsb" id="shorewall_HA" provider="linux"
type="shorewall_HA" resource_stickiness="0">
<operations>
<op id="shorewall_op1" name="start" timeout="5s"/>
<op id="shorewall_op2" name="stop" timeout="5s"/>
<op id="shorewall_op3" interval="10s" name="monitor"
timeout="4s"/>
</operations>
</primitive>
</group>
<clone id="pingd">
<instance_attributes id="pingd">
<attributes>
<nvpair id="pingd-clone_node_max" name="clone_node_max"
value="1"/>
</attributes>
</instance_attributes>
<primitive id="pingd-child" provider="heartbeat" class="ocf"
type="pingd">
<operations>
<op id="pingd-child-monitor" name="monitor" interval="20s"
timeout="40s" prereq="nothing"/>
<op id="pingd-child-start" name="start" prereq="nothing"/>
</operations>
<instance_attributes id="pingd_inst_attr">
<attributes>
<nvpair id="pingd-dampen" name="dampen" value="5s"/>
<nvpair id="pingd-multiplier" name="multiplier" value="100"/>
</attributes>
</instance_attributes>
</primitive>
</clone>
</resources>
Perhaps also groups would help you. See:
http://www.linux-ha.org/ClusterInformationBase/ResourceGroups
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems