Product: DRBD - Distributed Replicated Block Device

Todd Hoff's picture

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.

Examples:
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 ONLamp.com
  • DRBD for MySQL High Availability

  • Comments

    Re: Product: DRBD - Distributed Replicated Block Device

    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.

    Todd Hoff's picture

    Re: Product: DRBD - Distributed Replicated Block Device

    > 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?

    Re: Product: DRBD - Distributed Replicated Block Device

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

    Re: Product: DRBD - Distributed Replicated Block Device

    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.

    Re: Product: DRBD - Distributed Replicated Block Device

    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:
    http://blog.sqawasmi.com/index.php/2008/05/23/drbd-primary-primary-using...

    Re: Product: DRBD - Distributed Replicated Block Device

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

    Re: Product: DRBD - Distributed Replicated Block Device

    Cool concept and good work ! Et si vous cherchez un bon site de voyance gratuite and voyance webcam ou simplement une consultation de voyance ou mieux encore une voyance telephone, suivez le lien.

    Re: Product: DRBD - Distributed Replicated Block Device

    Can this be used in home PCs as well.
    -----
    sea plants
    sea grapes...plant roots

    Comment viewing options

    Select your preferred way to display the comments and click "Save settings" to activate your changes.