« Product: FAI - Fully Automatic Installation | Main | Announce: First Meeting of Boston Scalability User Group »

Product: DRBD - Distributed Replicated Block Device

From their website:
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.

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.

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.

Related Articles


  • How to build a redundant, high-availability system with DRBD and Heartbeat by Pedro Pla in Linux Journal
  • Linux-HA Press Room with many excellent high availability articles.
  • Sync Data on All Servers thread.
  • MySQL clustering strategies and comparisions
  • Wikipedia on DRBD
  • Using Xen for High Availability Clusters by by Kris Buytaert and Johan Huysmans in
  • DRBD for MySQL High Availability
  • Reader Comments (8)

    Instead of building another block device system and network format one could use iSCSI and a smart iSCSI-proxy in the middle to do the mirroring/housekeeping.

    November 29, 1990 | Unregistered CommenterNetrogenic

    > one could use iSCSI and a smart iSCSI-proxy in the middle to do the mirroring/housekeeping.

    How would I do that and what would be better about it?

    November 29, 1990 | Unregistered CommenterTodd Hoff

    I found glusterFS better. This is too low-level.

    November 29, 1990 | Unregistered CommenterAnonymous

    I found good succcess with postgres and drbd... been nice and stable and not too much of a system load it overall... would suggest it if your looking to have a backup machine, however keep in mind that the secondary machine can't be used as a read only cluster node... since you can only mount the drbd drive on one machine at a time.

    November 29, 1990 | Unregistered CommenterAnonymous

    i used drbd as primary/primary setup and it's seems good till now, but the problem it's use manual fencing.
    i followed the following article to setup gfs on top of drbd primary/primary:

    November 29, 1990 | Unregistered CommenterAnonymous

    AFAIK the answer to the "Re: Is "Scaling Engineer" a new job title?" is yes

    November 29, 1990 | Unregistered CommenterJacob V Nichols

    The DRDB work right using low bandwith link, at case in Brazil, upload 300 always low.

    help-me ?


    November 29, 1990 | Unregistered CommenterCristiano B. Hellwig

    PostPost a New Comment

    Enter your information below to add a new comment.
    Author Email (optional):
    Author URL (optional):
    Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>