What is DRBD


DRBD is a block device which is designed to build high availability clusters. This is done by mirroring a whole block device via (a dedicated) network. You could see it as a network raid-1.


What is the scope of drbd, what else do I need to build a HA cluster?


DRBD takes over the data, writes it to the local disk and sends it to the other host. On the other host, it takes it to the disk there.


The other components needed are a cluster membership service, which is supposed to be heartbeat, and some kind of application that works on top of a block device.



A filesystem & fsck.

A journaling FS.

A database with recovery capabilities.



How does it work ?


Each device (DRBD provides more than one of these devices) has a state, which can be 'primary' or 'secondary'. On the node with the primary device the application is supposed to run and to access the device (/dev/drbdX). Every write is sent to the local 'lower level block device' and to the node with the device in 'secondary' state. The secondary device simply writes the data to its lower level block device. Reads are always carried out locally.


If the primary node fails, heartbeat is switching the secondary device into primary state and starts the application there. (If you are using it with a non-journaling FS this involves running fsck)


If the failed node comes up again, it is a new secondary node and has to synchronise its content to the primary. This, of course, will happen whithout interruption of service in the background.


And, of course, we only will resynchronize those parts of the device that actually have been changed. DRBD has always done intelligent resynchronization when possible. Starting with the DBRD-0.7 series, you can define an "active set" of a certain size. This makes it possible to have a total resync time of 1--3 min, regardless of device size (currently up to 4TB), even after a hard crash of an active node.


How is DRBD related to current HA clusters ?


To my knowledge most current HA clusters (HP, Compaq, ...) are using shared storage devices, thus the storage devices are connected to more than one node (This can be done with shared SCSI busses or Fibre Channel).


DRBD gives you about the same semantics as a shared device, but it does not need any uncommon hardware. It runs on top of IP networks, which are to my impression less expensive than special storage networks.


DRBD and cluster file systems


You can run DRBD either with one node in primary role and the other node in secondary role. This is recommended for classical fail-over clusters. You should do this as long as you use

a conventional journaling file system (ext3, XFS, JFS, etc...)


Since DRBD-8.0.0 you can run both nodes in the primary role, enabling to mount a cluster file system (a physical parallel file system) one both nodes concurrently. Examples for such file systems are OCFS2 and GFS.

Title Filter     Display # 
# Article Title Author Hits
1 DRBD for lazy people ... a guide to DRBD installation Marco Tusa 59981

Who's Online

We have 41 guests online