Mirroring of important data

DRBD® works on top of block devices, i.e., hard disk partitions or LVM's logical volumes. It mirrors each data block that it is written to disk to the peer node.

From fully synchronous

Mirroring can be done tightly coupled (synchronous). That means that the file system on the active node is notified that the writing of the block was finished only when the block made it to both disks of the cluster.

Synchronous mirroring (called protocol C in DRBD speak) is the right choice for HA clusters where you dare not lose a single transaction in case of the complete crash of the active (primary in DRBD speak) node.

To asynchronous

The other option is asynchronous mirroring. That means that the entity that issued the write requests is informed about completion as soon as the data is written to the local disk.

Asynchronous mirroring is necessary to build mirrors over long distances, i.e., the interconnecting network's round trip time is higher than the write latency you can tolerate for your application. (Note: The amount of data the peer node may fall behind is limited by bandwidth-delay product and the TCP send buffer.)


Data accessible only on the active node

A consequence of mirroring data on block device level is that you can access your data (using a file system) only on the active node. This is not a shortcoming of DRBD but is caused by the nature of most file systems (ext3, XFS, JFS, ext4, ...). These file systems are designed for one computer accessing one disk, so they cannot cope with two computers accessing one (virtually) shared disk.

In spite of this limitation, there are still a few ways to access the data on the second node:

  • Use DRBD on logical volumes and use LVM's capabilities to take snapshots on the standby node, and access the data via the snapshot.
  • DRBD's primary-primary mode with a shared disk file system (GFS, OCFS2). These systems are very sensitive to failures of the replication network.

→ Continue with What DRBD does after an outage

© 2008-2015: LINBIT HA-Solutions GmbH : Stiegergasse 18, 1150 Vienna, Austria : phone +43 1 817 82 92 - 0 : office@linbit.com

LINBIT USA, LLC, 3720 SW 141st Ave. Suite 100, Beaverton, OR 97005, USA