Remus-fu with DRBD, GFS2 & Redhat Cluster on Debian
Refer to http://www.loonjuice.com/2010/06/06/remus-fu to get Debian & Xen with Remus installed, configured & running.
Then, change the disk of the VM to use an image location being on a GFS2 mounted, DRBD distributed, clustered file system! (eg used below is /usr/gfs0 )
Current Xen 4.1-unstable includes Remus & uses/patches the 2.6.31.13 Linux kernel.
Build & install the latest DRBD sources, from http://www.drbd.org/docs/install/
ie:
download the relevant drbd-*.tar.gz, extract to /usr/local/src
run ./configure –with-km; make KDIR=/lib/modules/2.6.31.13/build ; make KDIR=/lib/modules/2.6.31.13/build install
You then need to configure DRBD using the same /usr/local/etc/drbd.conf on both hosts, eg: using /dev/loop0 as the backing disk device!!
global {
minor-count 10;
}resource drbdr1 {
protocol C;
meta-disk internal;
device /dev/drbd0;
##disk /dev/mapper/VG-LV_name;
disk /dev/loop0;startup {
wfc-timeout 30;
degr-wfc-timeout 30;
become-primary-on both;
}disk {
on-io-error detach;
}syncer {
rate 90M; # Note: ‘M’ is MegaBytes, not MegaBits
}net {
allow-two-primaries;
after-sb-0pri discard-younger-primary;
after-sb-1pri discard-secondary;
after-sb-2pri call-pri-lost-after-sb;
}on remus1 {
##device /dev/drbd0;
##disk /dev/loop0;
##disk /dev/mapper/VG-LV_name;
address 192.168.X.Y1:7789;
##meta-disk internal;
}on remus2 {
##device /dev/drbd0;
##disk /dev/mapper/VG-LV_name;
address 192.168.X.Z:7789;
##meta-disk internal;
}}
Ensure that the same entries for hosts ‘remus1′ & ‘remus2′ are in each hosts /etc/hosts file! (V.IMPORTANT)
Now instantiate/initially-start DRBD with the following command set:
drbdadm create-md drbdr1
drbdadm attach drbdr1
drbdadm connect drbdr1
watch cat /proc/drbd
Then finally set Dual Primary mode with: (as long as you have dual-primary enabled in your active drbd.conf as perhttp://www.drbd.org/users-guide-emb/s-enable-dual-primary.html )
drbdadm primary drbdr1
With both hosts running in DRBD Primary modes (cat /proc/drbd |grep “Primary/Primary”) you can now get the GFS2 filesystem built on /dev/drbd0
mkfs.gfs2 -t clusternamefromcluster.conf:gfs1 -p lock_dlm -j 2 /dev/drbd0
Then you can mount the GFS2 filesystem on each host:
mkdir /usr/gfs0
mount /dev/drbd0 /usr/gfs0
(on each host)
Check status of Cluster, GFS & DRBD:
cat /proc/drbd
cman_tool status
cman_tool nodes
gfs2_tool df
More to be added, but you can install & run up a domU as per the original Remus-fu post using an image on /usr/gfs0 !
By rich, June 13, 2010 @ 12:12 am
This doesn’t use CLVM either, using “image files” for VMs instantiated on each Hypervisor..