Friday, December 11, 2009

drbd

drbd sounds like an interesting technology. Essentially, it's RAID 1 over a network. Using it, you can construct two disks which are kept in sync with drbd. Doesn't matter whether the disks are, themselves, RAID.

drbd operates by providing a virtual disk, upon which your filing system mounts. So, instead of mounting at /dev/sda1, for example, you'd enable drbd on /dev/sda1 and then mount your real filing system on /dev/drbd0

Once up and running, it maintains a status in /proc/drbd. Querying this just tells you whether you are on the primary, and whether the two drives are in sync.

When I built a pair (4TB) the biggest issue was formatting. You only format the primary, of course, and the secondary formats by syncing. Syncing 4TB of data takes a long, long time....

BUT - you can't mount the secondary. So you can't use drbd to maintain an identical pair of servers with one of the read only. The second server, the secondary, is missing a mount

Of course, this is used with heartbeat to provide a ha pair with automatic failover.

This all worked really well for me, until d-day. for some unexplained reason, drbd refused to start when the servers were rebooted to go live. I had to strip it off, and that's the end of this particular experiment.