Hello Jochen,
[ RESEND: Previous CIB was crap ]
> ipaddr
> drbd
> filesystem (for mounting drbd)
> apache
> tomcat
find a cib.xml attached. I also attached two resource agents that I
wrote myself and run on Debian Etch. Adapt for your need (hostnames and
ip address; mountmount; drbd ressource). I hope that gets you going.
Oh and a few more information:
ha.cf:
use_logd yes
bcast eth1
mcast eth0.2 239.0.0.1 694 1 0
mcast eth0.3 239.0.0.1 694 1 0
node apache-01 apache-02
watchdog /dev/watchdog
respawn hacluster /usr/lib/heartbeat/dopd
apiauth dopd uid=hacluster gid=haclient
ping 62.146.78.1
crm on
drbd.conf:
global {
usage-count no;
}
common {
syncer {
rate 100M;
}
handlers {
outdate-peer "/usr/lib/heartbeat/drbd-peer-outdater";
}
}
resource gcl {
protocol C;
startup {
degr-wfc-timeout 120;
}
disk {
on-io-error pass_on;
fencing resource-only;
}
on apache-01 {
device /dev/drbd0;
disk /dev/sda3;
address 172.17.0.1:7788;
meta-disk internal;
}
on apache-02 {
device /dev/drbd0;
disk /dev/sda3;
address 172.17.0.2:7788;
meta-disk internal;
}
}
/var/cfengine/inputs/update:
...
if [ -x /sbin/drbdsetup ]; then
chown root:haclient /sbin/drbdsetup /sbin/drbdmeta
chmod 750 /sbin/drbdsetup /sbin/drbdmeta
chmod u+s /sbin/drbdsetup /sbin/drbdmeta
fi
Thomas
#!/bin/bash
# . ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
export PID=/var/run/apache2.pid
export EXECUTABLE=/usr/sbin/apache2ctl
case "$1" in
start)
${EXECUTABLE} start && exit || exit 1;
;;
stop)
${EXECUTABLE} stop && exit || exit 1;
;;
status)
if [ -f "${PID}" ]; then
kill -0 `cat ${PID}` &> /dev/null && exit;
fi
exit 1;
;;
monitor)
if [ -f "${PID}" ]; then
kill -0 `cat ${PID}` &> /dev/null && {
wget -o /dev/null -O /dev/null -T 1 -t 1
http://localhost/ && exit || exit 1
}
fi
exit 7;
;;
meta-data)
cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="apachetg">
<version>1.0</version>
<longdesc lang="en">
OCF Ressource Agent for Apache.
</longdesc>
<shortdesc lang="en">OCF Ressource Agent for Apache.</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
#!/bin/sh
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# OCF Ressource Agent on top of tomcat init script shipped with debian. #
# Thomas Glanzmann --tg 21:22 07-12-30 #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# This script manages a Heartbeat Tomcat instance
# usage: $0 {start|stop|status|monitor|meta-data}
# OCF exit codes are defined via ocf-shellfuncs
. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
case "$1" in
start)
/etc/init.d/tomcat5.5 start > /dev/null 2>&1 && exit || exit 1
;;
stop)
/etc/init.d/tomcat5.5 stop > /dev/null 2>&1 && exit || exit 1
;;
status)
/etc/init.d/tomcat5.5 status > /dev/null 2>&1 && exit || exit 1
;;
monitor)
# Check if Ressource is stopped
/etc/init.d/tomcat5.5 status > /dev/null 2>&1 || exit 7
# Otherwise check services (XXX: Maybe loosen retry / timeout)
wget -o /dev/null -O /dev/null -T 1 -t 1
http://localhost:8180/eccar/ && exit || exit 1
;;
meta-data)
cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="tomcattg">
<version>1.0</version>
<longdesc lang="en">
OCF Ressource Agent on top of tomcat init script shipped with debian.
</longdesc>
<shortdesc lang="en">OCF Ressource Agent on top of tomcat 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
ub-freiburg.xml
Description: XML document
_______________________________________________ Linux-HA mailing list [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems
