Feb 14, 2006 12:43
Software: FreeBSD 6.1-prerelease on i386
Hardware: Intel Xeon 2.8 Ghz, 1 GB Ram, 3ware 9550sx with 6 Maxtor diamondmax 10 250 GB disks with 16 mb cache in RAID 1+0, gigabit NIC's
/dev/da0s1a is the root filesystem on which freebsd is installed (8 gigabytes)
/dev/da0s1b is swap (2 gigabytes)
/dev/da0s2 is a slice which will contain /home/users on the masterfileserver
/dev/da0s2d is the actual partition that contains /home/users (667 gigabytes)
A postmark benchmark showed me that the disks can write with an average speed of 21 megabytes per second.
192.168.1.11 is master. 192.168.1.12 is slave. They are connected with a crosscable between their intel e1000 NIC's.
On the slavefileserver:
# echo "192.168.1.11 RW /dev/da0s2" > /etc/gg.exports
# ggated -a 192.168.1.12
On the masterfileserver:
# ggatec create -o rw 192.168.1.12 /dev/da0s2
# echo geom_mirror_load="YES" >> /boot/loader.conf
# kldload geom_mirror
# sysctl kern.geom.debugflags=16
# gmirror label -v -b prefer gm0 /dev/da0s2
# gmirror insert -p 1 gm0 /dev/ggate0
# mkdir /test
# mount /dev/mirror/gm0d /test
# gmirror status
The last command will output something like: "mirror/gm0 DEGRADED da0s2". Here the machines are syncing at 200mbit/sec, which is nice I think. What can this do for you? If masterfileserver fails, there is the slavefileserver. On the slavefileserver you could mount /dev/da0s2d on /home/users, start nfsd on a virtual ip, and start a background fsck to check consistency. More information later on. btw I use the 'prefer' balancing algorithm because we don't want read's to hit the network, only writes.
Remember: This is far from perfect and playing with geom may cause your system to panic.