DRBD Users Guide 8.0-8.3

Creating a three-node setup

Available in DRBD version 8.3.0 and above

A three-node setup involves one DRBD device stacked atop another.

Device stacking considerations

The following considerations apply to this type of setup:

  • The stacked device is the active one. Assume you have configured one DRBD device /dev/drbd0, and the stacked device atop it is /dev/drbd10, then /dev/drbd10 will be the device that you mount and use.

  • Device meta data will be stored twice, on the underlying DRBD device and the stacked DRBD device. On the stacked device, you must always use internal meta data. This means that the effectively available storage area on a stacked device is slightly smaller, compared to an unstacked device.

  • To get the stacked upper level device running, the underlying device must be in the primary role.

  • To be able to synchronize the backup node, the stacked device on the active node must be up and in the primary role.

Configuring a stacked resource

In the following example, nodes are named alice, bob, and charlie, with alice and bob forming a two-node cluster, and charlie being the backup node.

resource r0 {
  protocol C;

  on alice {
    device     /dev/drbd0;
    disk       /dev/sda6;
    meta-disk internal;

  on bob {
    device    /dev/drbd0;
    disk      /dev/sda6;
    meta-disk internal;

resource r0-U {
  protocol A;

  stacked-on-top-of r0 {
    device     /dev/drbd10;

  on charlie {
    device     /dev/drbd10;
    disk       /dev/hda6;
    address; # Public IP of the backup node
    meta-disk  internal;

As with any drbd.conf configuration file, this must be distributed across all nodes in the cluster — in this case, three nodes. Notice the following extra keyword not found in an unstacked resource configuration:

  • stacked-on-top-ofThis option informs DRBD that the resource which contains it is a stacked resource. It replaces one of the on sections normally found in any resource configuration. Do not use stacked-on-top-of in an lower-level resource.


It is not a requirement to use Protocol A for stacked resources. You may select any of DRBD's replication protocols depending on your application.

Enabling stacked resources

To enable a stacked resource, you first enable its lower-level resource and promote it:

drbdadm up r0
drbdadm primary r0

As with unstacked resources, you must create DRBD meta data on the stacked resources. This is done using the following command:

drbdadm --stacked create-md r0-U

Then, you may enable the stacked resource:

drbdadm --stacked up r0-U
drbdadm --stacked primary r0-U

After this, you may bring up the resource on the backup node, enabling three-node replication:

drbdadm create-md r0-U
drbdadm up r0-U

In order to automate stacked resource management, you may integrate stacked resources in your cluster manager configuration. See the section called “Using stacked DRBD resources in Pacemaker clusters” for information on doing this in a cluster managed by the Pacemaker cluster management framework.