Hi,

On Sun, Feb 24, 2008 at 08:01:02PM +0100, Bernd Broermann wrote:
> Hello
> I want failover when a resource monitior fails.
> 
> Version: heartbeat-2    2.1.3-2~bpo40+
> crm = yes
> 
> Configuration  in short:
> 2 Node Aktiv /Passiv derived from
> 
> /usr/lib/heartbeat/haresources2cib.py --stdout -c /etc/ha.d/ha.cf
> /root/haresources> /var/lib/heartbeat/crm/cib.xml
> <nodes>
> - node1 DC
> - node2
> </nodes>
> Resources:
> <group>
> - IPADDR (OCF)
> - Application (LSB init Script)
> </group>
> 
> If Application is not runnable it should migrate with IPADDR to node2.
> As I read this should work with a cib entry  - operation monitor.
> 
> cibadmin -U -o resources -X '<op id="Application_mon" interval="10s"
> name="monitor" timeout="20s"/>'

In the attached CIB, there's a monitor operation defined. If you
want to change it, you'd have to use the same id. Also, try to
extract the whole resource, then change whatever you want in it
(but retain the same ids), then do cibadmin -U (or -R).

> It do not work !!!, Ressources stay unrunnable on node1.
> 
> 
> For a workaround I put following in the Application init-script.
>   status)
>         echo -n "Status of $DESC: "
> 
>         if  myApp_runnable  >/dev/null ; then
>         echo -n "OK  Application runnable"
>         crm_standby -U node1   -v false
>         else
>         echo "ERROR "
>         crm_standby -U node1   -v true
>         exit 3
>         fi

This is no good. You shouldn't put nodes in standby from the RA.
Just returning proper exit codes should suffice.

> Question:
> Is it possible to initiate a failover  of  the Group IPADDR and
> Application , when the recource monitor states an error?  How to modify
> the cib.xml to make it work ?

You cib looks OK to me. The monitor op runs every 120secs. Did
you wait long enough?

Thanks,

Dejan

> Thank you , for your help
> 
> Bernd Broermann
> 
> 
> My cib.xml :
> <?xml version="1.0" ?>
> <cib admin_epoch="0" epoch="0" num_updates="0">
>         <configuration>
>                 <crm_config>
>                         <cluster_property_set id="cib-bootstrap-options">
>                                 <attributes>
>                                         <nvpair
> id="cib-bootstrap-options-symmetric-cluster" name="symmetric-cluster"
> value="true"/>
>                                         <nvpair
> id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy"
> value="stop"/>
>                                         <nvpair
> id="cib-bootstrap-options-default-resource-stickiness"
> name="default-resource-stickiness" value="0"/>
>                                         <nvpair
> id="cib-bootstrap-options-default-resource-failure-stickiness"
> name="default-resource-failure-stickiness" value="0"/>
>                                         <nvpair
> id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled"
> value="false"/>
>                                         <nvpair
> id="cib-bootstrap-options-stonith-action" name="stonith-action"
> value="reboot"/>
>                                         <nvpair
> id="cib-bootstrap-options-startup-fencing" name="startup-fencing"
> value="true"/>
>                                         <nvpair
> id="cib-bootstrap-options-stop-orphan-resources"
> name="stop-orphan-resources" value="true"/>
>                                         <nvpair
> id="cib-bootstrap-options-stop-orphan-actions"
> name="stop-orphan-actions" value="true"/>
>                                         <nvpair
> id="cib-bootstrap-options-remove-after-stop" name="remove-after-stop"
> value="false"/>
>                                         <nvpair
> id="cib-bootstrap-options-short-resource-names"
> name="short-resource-names" value="true"/>
>                                         <nvpair
> id="cib-bootstrap-options-transition-idle-timeout"
> name="transition-idle-timeout" value="5min"/>
>                                         <nvpair
> id="cib-bootstrap-options-default-action-timeout"
> name="default-action-timeout" value="20s"/>
>                                         <nvpair
> id="cib-bootstrap-options-is-managed-default" name="is-managed-default"
> value="true"/>
>                                         <nvpair
> id="cib-bootstrap-options-cluster-delay" name="cluster-delay" value="60s"/>
>                                         <nvpair
> id="cib-bootstrap-options-pe-error-series-max"
> name="pe-error-series-max" value="-1"/>
>                                         <nvpair
> id="cib-bootstrap-options-pe-warn-series-max" name="pe-warn-series-max"
> value="-1"/>
>                                         <nvpair
> id="cib-bootstrap-options-pe-input-series-max"
> name="pe-input-series-max" value="-1"/>
>                                 </attributes>
>                         </cluster_property_set>
>                 </crm_config>
>                 <nodes/>
>                 <resources>
>                         <group id="Group_1">
>                                 <primitive class="ocf"
> id="IPaddr_192_168_96_56" provider="heartbeat" type="IPaddr">
>                                         <operations>
>                                                 <op
> id="IPaddr_192_168_96_56_mon" interval="5s" name="monitor" timeout="5s"/>
>                                         </operations>
>                                         <instance_attributes
> id="IPaddr_192_168_96_56_inst_attr">
>                                                 <attributes>
>                                                         <nvpair
> id="IPaddr_192_168_96_56_attr_0" name="ip" value="192.168.96.56"/>
>                                                 </attributes>
>                                         </instance_attributes>
>                                 </primitive>
>                                 <primitive class="lsb"
> id="MyApplication" provider="heartbeat" type="Application">
>                                         <operations>
>                                                 <op
> id="MyApplication_mon" interval="120s" name="monitor" timeout="60s"/>
>                                         </operations>
>                                 </primitive>
>                         </group>
>                 </resources>
>                 <constraints>
>                         <rsc_location id="rsc_location_Group_1"
> rsc="Group_1">
>                                 <rule id="prefered_location_Group_1"
> score="100">
>                                         <expression attribute="#uname"
> id="prefered_location_Group_1_expr" operation="eq" value="node1"/>
>                                 </rule>
>                         </rsc_location>
>                 </constraints>
>         </configuration>
>         <status/>
> </cib>
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to