Friday, 1 February 2008

Distributed Replicated Block Device

DRBD is a quite an interesting software for Linux. (It's now included in the "vanilla" kernel.) DRBD takes one of your block devices, and mirrors it to a remote computer's block device. It's something like a basic clustering on block level but with only two nodes.

You can create a journaling filesystem on top of a DRBD device, for example. When your main node dies, the secondary node can mount up that filesystem (after recovering it to a clean state from journal), and take over your task, as a cold backup. Once your ex-primary host come up again, it can now act as your slave, re-synchronizing the data for itself.

On DRBD, writes occur to the local and remote device simultaneously, however reads are made only on the local device, which is usually faster.

One can even use DRBD in a multi-master environment, if choosing shared-disk-filesystem, that supports simultaneous mounts on multiple hosts.

There is a nice article on Debian Administration, a good overview to demonstrate the possibilities when combining DRBD with other tools.

No comments: