OpenSSI Logo SourceForge Logo

project
 home page
 sourceforge page
 mailing lists
 feature list
 demos
 screenshots
 Bruce's corner
 related links
 wiki
downloads
 notes
 1.2 stable
 1.9 development
 CVS
documentation
 1.2 stable
 1.9 development
 roadmap
 wiki
work items
 task list
 bug database
 feature requests
 process mgmt hooks
  hide sidebar
Configuring DRBD  in an OpenSSI Cluster

1) apt-get install the drbd packages.
	apt-get install <drbd package name>

	drbd package names :
	drbd0.7-module-2.4.22-1.2199.nptl-ssi-686-smp_0.7.5-2.ssi1_i386.deb
	drbd0.7-module-source_0.7.5-2.ssi1_all.deb
	drbd0.7-utils_0.7.5-2.ssi1_i386.deb

	The first package contain the drbd module and is built against 
	the released openssi kernel it also have kernel version in the package name

2) edit the default drbd.conf, mine is attached.

	a) Need to specify the node number as a part of each resources
	 For example:

	 on node2 {
		 device    /dev/drbd/0;
		 disk      /dev/hda2;
		 address   192.168.22.12:7788;
		 nodenum  2;
		 meta-disk /dev/hda5[0];
	 }

	b) Need to make sure that they use the same device name on all nodes 
	for same mount point.  See the sample drbd.conf below

	c) Need to make sure that the "incon-degr-cmd" line returns a non-zero value.
	a sample entry looks like:
	incon-degr-cmd "exit 1";

	d) Need to make sure that "wfc-timeout" is zero.
	see drbd.conf(5) man page for details of these  parameters

	e) Need to make sure the root device should be /dev/drbd/0
	This is the device name that we mention in /etc/fstab for /. Also drbd.conf should use
	this drbd device to map to underlying partition that carry root file system


3) modprobe drbd, if you don't do this, the mkinitrd will fail cause it 
can't find the drbd devices You should have no warnings/errors with your 
config, if you do FIX THEM!!!!!!!!!

4) add 'drbd' to /etc/mkinitrd/modules

5) set 'DRBD_CONFIG=yes' in /etc/mkinitrd/mkinitrd.conf

6) Follow the README.hardmounts document in the OpenSSI package and replace 
UUID=f00barf00 with /dev/drbd/0 

7) be sure to use ssi-chnode to modify all nodes that will be drbd
failovers, make them initnodes

8) rebuild your initrd image  using mkinitrd command. After rebuilding the initrd images 
issue ssi-ksync. It puts the new initrd image in the tftp directory and everywhere you'll
need it

9) reboot, it should give you a error/warning about not having a
primary disk/node, when it prompts you for a shell, enter 
the shell and issue drbdadm --do-what-I-say primary all, after you exit 
the shell it should boot just fine.

10) since you did ssi-ksync, you can boot the second intinode

Sample drdb.conf 
----------
resource r0 {
	protocol C;
	incon-degr-cmd "exit 1";
	startup {
		# Wait for connection timeout.
		# The init script blocks the boot process until the resources
		# are connected.
		# In case you want to limit the wait time, do it here.
		#
		wfc-timeout  0;

		# Wait for connection timeout if this node was a degraded cluster.
		# In case a degraded cluster (= cluster with only one node left)
		# is rebooted, this timeout value is used.
		#
		degr-wfc-timeout 120;    # 2 minutes.

	}
	disk {
		on-io-error   detach;
	}
	net {
	}
	syncer {
		rate 10M;
		group 1;
		al-extents 257;
	}

	on node1 {
		device     /dev/drbd/0;
		disk       /dev/hda2;
		nodenum 1;
		address    IPADDR1:7788;
		meta-disk  /dev/hda5[0];

	}

	on node2 {
		device    /dev/drbd/0;
		disk      /dev/hda2;
		address   IPADDR2:7788;
		nodenum  2;
		meta-disk /dev/hda5[0];
	}
}

resource r1 {

	protocol C;

	incon-degr-cmd "exit 1";

	startup {
		# Wait for connection timeout.
		# The init script blocks the boot process until the resources
		# are connected.
		# In case you want to limit the wait time, do it here.
		#
		wfc-timeout  0;

		# Wait for connection timeout if this node was a degraded cluster.
		# In case a degraded cluster (= cluster with only one node left)
		# is rebooted, this timeout value is used.
		#
		degr-wfc-timeout 120;    # 2 minutes.

	}

	disk {
		on-io-error   detach;
	}

	net {
	}

	syncer {
		rate 10M;

		group 1;

		al-extents 257;
	}

	on node1 {
		device     /dev/drbd/1;
		disk       /dev/hda4;
		nodenum 1;
		address    IPADDR1:7789;
		meta-disk  /dev/hda5[1];

	}

	on node2 {
		device    /dev/drbd/1;
		disk      /dev/hda4;
		address   IPADDR2:7789;
		nodenum  2;
		meta-disk /dev/hda5[1];
	}
}

sample /etc/fstab entry enabling root and /home failover 
-------------------------------
As you can see both the nodes have local boot partition. This enables each node to be boot
without depending on the other

kvaneesh@node2:~$ more /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc    /proc   proc    defaults,node=* 0       0
/dev/drbd/0     /       ext3    chard,defaults,errors=remount-ro,node=1:2       0       1
/dev/hda1       /boot   ext3    defaults,node=1 0       2
/dev/drbd/1     /home   ext3    chard,defaults,node=1:2 0       2
/dev/hda6       none    swap    sw,node=1       0       0
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto,node=1   0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,node=1   0       0
/dev/hda6       none    swap    sw,node=2       0       0
kvaneesh@node2:~$

This page last updated on Thu Dec 15 17:15:45 2005 GMT
privacy and legal statement