host-a 10.0.0.10 host-b 10.0.0.20 fs-cluster 10.0.0.30
# apt-get install drbd0.7-module-source # apt-get install drbd0.7-utils # apt-get install dpatch # cd /usr/src # tar -zxf drbd0.7.tar.gz # cd /usr/src/modules/drbd # module-assistant prepare # module-assistant automatic-install drbd0.7-module-source Navigate the module package creation procedure as logically as possible; details for this procedure are not provided. # cd /usr/src # dpkg -i drbd0.7-module-2.4.27-2-k7_0.7.10-3+2.4.27-8_i386.deb
resource drbd-resource-0 { protocol C; incon-degr-cmd "halt -f"; # killall heartbeat would be a good alternative :-> disk { on-io-error panic; } syncer { rate 10M; # Note: 'M' is MegaBytes, not MegaBits } on host-a { device /dev/drbd0; disk /dev/hda8; address 10.0.0.10:7789; meta-disk internal; } on host-b { device /dev/drbd0; disk /dev/hda8; address 10.0.0.20:7789; meta-disk internal; } }
# /etc/init.d/drbd start
host-a: # drbdadm primary all
host-a: # drbdsetup /dev/drbd0 primary --do-what-I-say
host-a: # mkreiserfs /dev/drbd0 (or mke2fs, or whatever filesystem you prefer) host-a: # mkdir /share host-a: # mkdir /share/spool0 host-a: # mount /dev/drbd0 /share/spool0
host-a: # mkdir /share/spool0/data
# apt-get install nfs-kernel-server
# /etc/init.d/nfs-kernel-server stop
# echo "/share/spool0/data 10.3.11.0/255.255.255.0(rw,sync)" >> /etc/exports
# update-rc.d -f nfs-kernel-server remove (for non-Debian systems you can probably just delete /etc/init.d/ nfs or /etc/init.d/nfs-server)
host-a: # mv /var/lib/nfs /share/spool0/varlibnfs host-a: # ln -s /share/spool0/varlibnfs /var/lib/nfs
# vi /etc/default/nfs-common ... 'STATDOPTS="-n my_clusters_name" ...
# apt-get install heartbeat
keepalive 1 deadtime 10 warntime 5 initdead 60 udpport 694 baud 19200 serial /dev/ttyS0 ucast eth0 10.0.0.20 auto_failback off watchdog /dev/watchdog node node-a node node-b
# echo 'killall -9 nfsd ; exit 0' > /etc/heartbeat/resource.d/killnfsd # chmod 755 /etc/heartbeat/resource.d/killnfsd
host-a drbddisk::drbd-resource-0 \ Filesystem::/dev/drbd0::/share/spool0/data::reiserfs \ killnfsd \ nfs-common \ nfs-kernel-server \ Delay::3::0 \ IPaddr::10.0.0.30/24/eth0
client-a: # mkdir /mnt/hafs client-a: # echo "fs-cluster:/share/spool0/data /mnt/hafs nfs defaults 0 0" >> /etc/fstab client-a: # mount -a