Skip to content

DRBD 9

Install the required packages

apt install drbd-dkms drbd-utils python-drbdmanage

Check the module installation

modprobe drbd
modinfo drbd

Enable and start the DRBD cluster manager service

systemctl enable drbdmanaged
systemctl start drbdmanaged

Configure the DRBD 9 cluster

Create the drbdpool volume group on the desired PVs.

vgcreate drbdpool /dev/nvme0n1 /dev/mapper/disks

Initialize drbdmanage on the master node with your parameters.

drbdmanage init <node-name> <ip_drbd>

Add the volume and resources.

drbdmanage add-volume <volume-name> <capacity>
Note: it also creates an associated resource with the same name as the volume.

Deploy the resources to the nodes.

drbdmanage deploy <resource-name> <nº nodes>

If you want to allocate volumes on a desired PV, perform this step.

pvmove <resource-name> <pv>

Create the filesystem and mount it.

mkfs.ext4 /dev/<resource-name>
mount /dev/<resource-name> /mnt
In DRBD 9, the mount action automatically triggers a Secondary -> Primary change to allow a read-write mount.

Node types

All node types share a block device, including diskless nodes.

Control node

  • Control volume (.drbdctrl): local (can be primary or secondary)
  • Resources: local (can be primary or secondary)
drbdmanage add-node drbd1 192.168.0.11

Cluster startup is performed using drbdmanage init. The node also becomes a control node.

Pure controller node

  • Control volume (.drbdctrl): local (can be primary or secondary)
  • Resources: local (can be primary or secondary)
drbdmanage add-node --no-storage drbd2-controller 192.168.0.12

This node functions like a control node. Because it has no storage, it acts only as a control node or a satellite.

Satellite node

  • Control volume (.drbdctrl): remote, via TCP (can be primary or secondary)
  • Resources: local (can be primary or secondary)
drbdmanage add-node --satellite drbd3-satellite 192.168.0.13

Pure client node

  • Control volume (.drbdctrl): remote, via TCP (can be primary or secondary)
  • Resources: remote, via TCP (can be primary or secondary)
drbdmanage add-node --satellite --no-storage drbd4-client 192.168.0.14

Utilities

  • drbdmanage nodes: Displays cluster nodes and their available space.
  • drbdmanage resources: Displays resources.
  • drbdmanage volumes: Displays volumes.
  • drbdmanage uninit <node-name>: Removes a node from the cluster. All resources on that node will be lost.
  • drbdmanage peer-disk-options --common <options>: Modifies disk options.
  • drbdmanage net-options --common <options>: Modifies network options.
  • drbdsetup status: Displays resource status and synchronization progress. Use --verbose for details.