Hi,
I want to run apache with mysql on a node. In case of a failure apache
should move to the next node while mysql is running
on each node (replication). I created a resource group with:
<resources>
<group id="Res_Web">
<primitive id="Res_IP" class="ocf" type="IPaddr2"
provider="heartbeat">
<instance_attributes id="Res_IP_Attr">
<attributes>
<nvpair id="Res_IP_Attr_Value" name="ip"
value="xx.xx.xx.xx"/>
<nvpair id="Res_IP_target_role" name="target_role"
value="started"/>
</attributes>
</instance_attributes>
<operations>
<op id="Res_IP_Op_Start" name="start" timeout="5s"/>
<op id="Res_IP_Op_Stop" name="stop" timeout="5s"/>
<op id="Res_IP_Op_Monitor" interval="5s" name="monitor"
timeout="2s"/>
</operations>
</primitive>
<primitive id="Res_Apache" class="lsb" type="httpd"
provider="heartbeat">
<operations>
<op id="Res_Apache_Op_Start" name="start" timeout="5s"/>
<op id="Res_Apache_Op_Stop" name="stop" timeout="5s"/>
<op id="Res_Apache_Op_Monitor" interval="5s" name="monitor"
timeout="2s"/>
</operations>
<instance_attributes id="Res_Apache_instance_attrs">
<attributes>
<nvpair id="Res_Apache_target_role" name="target_role"
value="started"/>
</attributes>
</instance_attributes>
</primitive>
<instance_attributes id="Res_Web_instance_attrs">
<attributes>
<nvpair id="Res_Web_target_role" name="target_role"
value="started"/>
</attributes>
</instance_attributes>
</group>
</resources>
Everything works fine, till I add the following resource to the above
group:
<primitive id="Res_MySQL" class="lsb" type="mysql-ha"
provider="heartbeat">
<operations>
<op id="Res_MySQL_Op_Monitor" interval="5s" name="monitor"
timeout="2s"/>
</operations>
<instance_attributes id="Res_MySQL_instance_attrs">
<attributes>
<nvpair id="Res_MySQL_target_role" name="target_role"
value="started"/>
</attributes>
</instance_attributes>
</primitive>
with the lsb script "mysql-ha" as a dummy script:
case "$1" in
start)
status mysqld
;;
stop)
exit 0
;;
status)
status mysqld
;;
*)
echo $"Usage: $0 {start|stop|status} (start|stop faked)"
exit 1
esac
exit $?
No if I stop mysql on the first node, apache move to the second node. If
I start mysql on the first node again and stop mysql on the second node,
apache wont move back to the first node. Does I have to definie some
scores?
Best regards,
Markus
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems