A three-node setup involves one DRBD device stacked atop another.
The following considerations apply to this type of setup:
/dev/drbd0
, and the stacked device atop it is
/dev/drbd10
, then /dev/drbd10
will be the device that you mount
and use.
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 { net { protocol C; } on alice { device /dev/drbd0; disk /dev/sda6; address 10.0.0.1:7788; meta-disk internal; } on bob { device /dev/drbd0; disk /dev/sda6; address 10.0.0.2:7788; meta-disk internal; } } resource r0-U { net { protocol A; } stacked-on-top-of r0 { device /dev/drbd10; address 192.168.42.1:7788; } on charlie { device /dev/drbd10; disk /dev/hda6; address 192.168.42.2:7788; # 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-of
. This 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.
![]() | Note |
---|---|
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. |
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 create-md --stacked r0-U
Then, you may enable the stacked resource:
# drbdadm up --stacked r0-U # drbdadm primary --stacked 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 Section 8.4, “Using stacked DRBD resources in Pacemaker clusters” for information on doing this in a cluster managed by the Pacemaker cluster management framework.