Hi all,
i am working on a two node squid cluster with heartbeat2 and squid3.
The cluster was installed on debian 5.02 i386. the system is up and
running - what is going well by now is: The two nodes are working as a
cluster with a secondary ip on their lan interface. squid3 is started
from the heartbeat daemon. if i shutdown one node, the squid and the
ip is brought up in the right way on the second node. hard shutdown of
the activ node also moves the resources. I used the main parts from a
prior post (but i attached the squid script and the xml what i
inserted to the debian default cib.
What is not working correct (imo) is: if you rename the squid.conf on
the active node (so squid is not able to start on it) heartbeat tries
to restart squid but does not move the resources. And the inserted
ping nodes seem to have no effect - disbaling the lan interface of a
active node, does not force the resources to move.
find attached my config:
ha.cf
logfacility local0
node proxy1 proxy2
bcast eth1
mcast eth0 239.0.0.2 694 1 0
ping 192.168.1.254 192.168.1.253
crm on
squid.xml
<configuration>
<resources>
<group id="squid-cluster">
<primitive class="ocf" provider="heartbeat" type="IPaddr" id="ip0">
<instance_attributes id="ia-ip0">
<attributes>
<nvpair id="ia-ip0-1" name="ip" value="192.168.1.250" />
<nvpair id="ia-ip0-2" name="cidr_netmask" value="24" />
<nvpair id="ia-ip0-3" name="nic" value="eth0" />
</attributes>
</instance_attributes>
<operations>
<op id="ip0-monitor0" name="monitor" interval="60s" timeout="120s"
start_delay="1m" />
</operations>
</primitive>
<primitive class="ocf" provider="heartbeat" type="squid" id="squid0">
<operations>
<op id="squid0-monitor0" name="monitor" interval="60s"
timeout="120s" start_delay="1m" />
<op id="squid0-start0" name="start" timeout="120s" />
<op id="squid0-stop0" name="stop" timeout="120s" />
</operations>
</primitive>
</group>
</resources>
</configuration>
and
heatbeat squid script
#!/bin/sh
if [ -z "${OCF_ROOT}" ]; then
export OCF_ROOT=/usr/lib/ocf/
fi
. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
SQUID_PORT=3128
INIT_SCRIPT=/etc/init.d/squid3
PID=/var/run/squid3.pid
CHECK_URLS="http://www.google.de/ http://www.glanzmann.de/
http://www.uni-erlangen.de"
case "$1" in
start)
if [ -f "${PID}" ]; then
kill -0 `cat ${PID}` &> /dev/null && exit 0;
else
rm -f "${PID}"
fi
${INIT_SCRIPT} start > /dev/null 2>&1 && exit || exit 1
;;
stop)
if [ -f "${PID}" ]; then
${INIT_SCRIPT} stop > /dev/null 2>&1 && exit || exit 1
fi
exit 0;
;;
status)
if [ -f "${PID}" ]; then
kill -0 `cat ${PID}` && exit;
fi
exit 1;
;;
monitor)
if [ -f "${PID}" ]; then
kill -0 `cat ${PID}` || exit 7
else
exit 7;
fi
for URL in ${CHECK_URLS}; do
http_proxy=http://localhost:${SQUID_PORT}/
wget -o /dev/null -O /dev/null -T 1 -t 1 ${URL} && exit
done
exit 1;
;;
meta-data)
cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="squid">
<version>1.0</version>
<longdesc lang="en">
OCF Ressource Agent on top of squid init script shipped with debian.
</longdesc>
<shortdesc lang="en">OCF Ressource Agent on top of squid init script
shipped with debian.</shortdesc>
<actions>
<action name="start" timeout="90" />
<action name="stop" timeout="100" />
<action name="status" timeout="60" />
<action name="monitor" depth="0" timeout="30s" interval="10s"
start-delay="10s" />
<action name="meta-data" timeout="5s" />
<action name="validate-all" timeout="20s" />
</actions>
</resource-agent>
END
;;
esac
regards markus
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems