From: Helmut Wollmersdorfer (helmut.wollmersdorfer_at_gmx.at)
Date: Mon 22 Aug 2005 - 16:55:56 BST
Herbert Poetzl wrote:
> btw, a failover setup with drbd would probably interest
> other folks too, care to write a few lines for a howto?
Yes I will write a HOWTO and populate in the wikis of DRBD, vserver and
heartbeat. But first I have to be sure, that it works stable.
The short story for the experts:
- install a vserver-kernel, compile drbd-module against it
(for current debian see
http://wiki.linux-ha.org/DRBD_2fHowTo_2fInstallDebianPackages07)
- install the utilities of vserver, heartbeat, drbd
- configure a drbd device dedicated to a single vserver-guest
- mount it as e.g. /dev/drbd0 /var/lib/vservers
- install a vserver-guest on it
- copy the relevant configuration files to the second node
(I used tar and scp)
- add a resource group like
xp2400 drbddisk::vser-42 \
Filesystem::/dev/drbd0::/var/lib/vservers::ext3 vserver::vs27
to /etc/ha.d/haresources
There are some other difficulties to avoid - most related to services
listening to some ports ... somewhere ... two nodes and dozens of cables
to each node;-)
Such a resource script is needed (which IMHO needs some exeption
handling added;-) in /etc/ha.d/resource.d/vserver
#!/bin/bash
#
# This script is intended to be used as resource script by heartbeat
#
# Jan 2005 by Helmut Wollmersdorfer.
#
###
VSERVER="/usr/sbin/vserver"
RES="$1"
CMD="$2"
case "$CMD" in
start)
$VSERVER $RES start
;;
stop)
# exec, so the exit code propagates
exec $VSERVER $RES stop
;;
status)
$VSERVER $RES status | grep running > /dev/null
if [ $? -eq 0 ]
then
echo "running"
else
echo "stopped"
fi
;;
*)
echo "Usage: vserver VSERVER-NAME {start|stop|status}"
exit 1
;;
esac
exit 0
Helmut Wollmersdorfer
_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver