Hiit's been an FAQ, how to configure the resource scores in order to failover to another node only after a defined number of failures.
So I wrote the attached script, which will output the necessary constraints and values for you.
Here's an example of what you will see: [EMAIL PROTECTED]:~/bin$ ./calc_linux_ha_scores.sh Resource Name? webserver Node Name 1? ace Node Name 2? king Where do you want to run "webserver" by default? aceHow many times do you want to allow "webserver" to fail before failing over to the other node? 3
Do you want to treat a "not running" resource in the same way as a "failed" resource?
If you don't know what the difference for the cluster is, say "y". [yn] y
Do you want to save this config for later use? [yn] y
Writing configfile clusterconfig
<crm_config>
<cluster_property_set id="cib-bootstrap-options">
<attributes>
<nvpair name="default-resource-stickiness"
id="default-resource-stickiness" value="0"/>
<nvpair name="default-resource-failure-stickiness"
id="default-resource-failure-stickiness" value="-100"/>
</attributes>
</cluster_property_set>
</crm_config>
<constraints>
<rsc_location id="rsc_location_webserver" rsc="webserver">
<rule id="rsc_location_webserver_rule_1" score="400">
<expression id="rsc_location_webserver_rule_1_expr"
attribute="#uname" operation="eq" value="ace"/>
</rule> <rule id="rsc_location_webserver_rule_2" score="150"><expression id="rsc_location_webserver_rule_2_expr" attribute="#uname" operation="eq" value="king"/>
</rule> </rsc_location> </constraints> Please test and send feedback to the list. Hope this helps. Regards Dominik
calc_linux_ha_scores.sh
Description: Bourne shell script
_______________________________________________ Linux-HA mailing list [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems
