Linux: The Role of DRBD


  • Service Provider

    DRBD, the Distributed Replicated Block Device, is essentially a network RAID layer for Linux systems. The term "essentially" is used because while a RAID 1 style mirroring mechanism is used, DRBD does not unify the "appearance" of the storage device into a single entity like RAID does but instead presents the overall device as a local device on each attached machine so that additional logic is needed above the DRBD layer in order to handle faults in the physical storage devices. This makes DRBD more complex, but also more powerful.

    DRBD traditionally was an add-on product for Linux, but tightly integrated, until being submitted to the Linux kernel in 2007 and finally accepted and merged in in 2009. Today DRBD is just a part of the Linux kernel itself so very heavily supported.

    DRBD is a powerful tool for building highly available applications higher up in the stack. Typically DRBD will consume block devices that are presented directly to the Linux OS (as presented at the lowest level of the storage stack) and either filesystems will be applied directly to it or, more commonly, a logical volume manager (a la LVM) will be applied directly and then filesystem(s) added on top of that.

    DRBD presents some confusion to many new users due to the fact that it operates at a network level and this causes people to often confuse it with SAN or NAS technologies and believe that it may provide network features. This is incorrect, however. DRBD does network replication of block devices but presents the local instance of that mirror as a local device to the local system on which it is running.

    DRBD, in this way, acts like a mirrored SAN cluster, but one that is local to the Linux OS. So no network transport for communications to the local disk is needed. Not even SATA or SAS as the DRBD layer is on top of whatever physical system lies beneath it.

    DRBD includes no accomodations for things such as file sharing or multiple-access. Like a single drive, DAS or SAN being accessed by two machines at one time, any gatekeeping must be handled at a higher level. By default and by convention, DRBD is used in a primary/secondary fashion with one node being read/write and the failover node being read-only until the storage clustering has failed. This allows traditional filesystems and usage.

    With DRBD 9.1 dual master functionality is available but, as with any technology of this type, requires a clustered file system and clustered volume management system on top of it to function reliably. Red Hat's GFS2 and Oracle's OCFS are popular filesystems for this usage.

    DRBD is highly configurable as to how replication will occur with options for full synchronization for maximum safety while sacrificing performance or for different asynchronous options that can effectively eliminate any performance penalties introduced by DRBD, but at a higher risk of crash consistency in the case of a failure.

    In some cases, DRBD is used as a transport over the WAN for replication to a disaster recovery site.

    DRBD is a very powerful, but complex, piece of the Linux storage ecosystem. It gives Linux the ability to do things that few other operating systems can do, and can do it for free, baked into the Linux kernel itself. Understanding DRBD and its role is important for all Linux administrators. Understanding how to configure and manage DRBD, however, is an advanced topic and will be broached at that time.

    Because DRBD is inherent to Linux itself, we find it commonly in use in systems that depend on Linux such as Xen and KVM hypervisors and as the underpinnings of storage clustering in many commercial NAS and SAN storage systems.

    Part of a series on Linux Systems Administration by Scott Alan Miller



  • I personally would love the follow up to this regarding the management of DRBD.

    I look forward to that!


  • Service Provider

    I added a header into the main topic list for that. But it is going to be later in the Advanced Topics, section. Oddly, I know of pretty much no standard Linux Administration tomes that cover DRBD. It's so core, very odd that it so often gets missed.



  • @scottalanmiller said in Linux: The Role of DRBD:

    I added a header into the main topic list for that. But it is going to be later in the Advanced Topics, section. Oddly, I know of pretty much no standard Linux Administration tomes that cover DRBD. It's so core, very odd that it so often gets missed.

    Could it be that most Linux Admin's don't know about it until they go searching for it? ...That's how I found out about it.



  • @dafyre said in Linux: The Role of DRBD:

    @scottalanmiller said in Linux: The Role of DRBD:

    I added a header into the main topic list for that. But it is going to be later in the Advanced Topics, section. Oddly, I know of pretty much no standard Linux Administration tomes that cover DRBD. It's so core, very odd that it so often gets missed.

    Could it be that most Linux Admin's don't know about it until they go searching for it? ...That's how I found out about it.

    I think so many people assume you have to pay for the kinds of thing that it offers that they just assume "Linux doesn't do it"


  • Service Provider

    @dafyre said in Linux: The Role of DRBD:

    @scottalanmiller said in Linux: The Role of DRBD:

    I added a header into the main topic list for that. But it is going to be later in the Advanced Topics, section. Oddly, I know of pretty much no standard Linux Administration tomes that cover DRBD. It's so core, very odd that it so often gets missed.

    Could it be that most Linux Admin's don't know about it until they go searching for it? ...That's how I found out about it.

    You would hope that the people writing the books would know, though!



Looks like your connection to MangoLassi was lost, please wait while we try to reconnect.