Chapter 5. Configuring DRBD

Table of Contents

Preparing your lower-level storage
Preparing your network configuration
Configuring your resource
Example configuration
The global section
The common section
The resource sections
Enabling your resource for the first time
The initial device synchronization
Using truck based replication

Preparing your lower-level storage

After you have installed DRBD, you must set aside a roughly identically sized storage area on both cluster nodes. This will become the lower-level device for your DRBD resource. You may use any type of block device found on your system for this purpose. Typical examples include:

  • A hard drive partition (or a full physical hard drive),

  • a software RAID device,

  • an LVM Logical Volume or any other block device configured by the Linux device-mapper infrastructure,

  • an EVMS volume,

  • any other block device type found on your system. In DRBD version 8.3 and above, you may also use resource stacking, meaning you can use one DRBD device as a lower-level device for another. Some specific considerations apply to stacked resources; their configuration is covered in detail in the section called “Creating a three-node setup”.

[Note]Note

While it is possible to use loop devices as lower-level devices for DRBD, doing so is not recommended due to deadlock issues.

It is not necessary for this storage area to be empty before you create a DRBD resource from it. In fact it is a common use case to create a two-node cluster from a previously non-redundant single-server system using DRBD (some caveats apply – please refer to the section called “DRBD meta data” if you are planning to do this).

For the purposes of this guide, we assume a very simple setup:

  • Both hosts have a free (currently unused) partition named /dev/sda7.

  • We are using internal meta data.