A two-node DRBD 8.4.10 deployment on Ubuntu 18.04, replicating an LVM logical volume between hyp-lab and hyp2-lab. Both nodes operate as Primary, with /dev/drbd0 mounted at /mnt/drbd.
This example covers an existing resource with initialized backing volumes, DRBD metadata and a filesystem.
The Lab
Requirement: Concurrent read/write mounts require a clustered filesystem such as OCFS2 or GFS2, distributed locking and working fencing. Do not mount ext4 or XFS read/write on both hosts. Filesystem and fencing configuration must be handled separately from the DRBD configuration below. (DRBD 8.4 guide)
Configure Hostnames and Connectivity
Add these entries to /etc/hosts on both nodes:
Configure DRBD
Use the same /etc/drbd.conf on both hosts:
protocol C provides synchronous replication while connected. allow-two-primaries yes permits both nodes to be Primary, and become-primary-on both requests promotion through the DRBD startup script. (DRBD configuration reference)
The legacy syncer setting is retained from the existing configuration. With c-plan-ahead 10, resynchronization uses the dynamic controller and its c-* settings; c-max-rate 720M is an upper limit, not measured throughput. (DRBD 8.4 guide)
Storage note: no-disk-flushes and no-disk-barrier are deployment-specific settings. Disabling flushes requires verified power-loss protection across the storage write path, including controller and drive caches. Otherwise, retain disk flushing. (LINBIT storage tuning guidance)
Validate and Apply the Configuration
On both nodes, parse the file and preview the required changes:
-d prints the backend commands without executing them. After reviewing the output and coordinating any changes with the cluster manager, apply the configuration on each node: (drbdadm reference)
Verify Replication
On hyp-lab:
On hyp2-lab:
These values confirm the DRBD replication state at the time of the checks. They do not verify filesystem consistency or fencing. (DRBD status reference)
Verify Mounted Storage
Relevant excerpts from df -h:
Check the filesystem type and mount options on both hosts:
df -h confirms the mount and capacity; it does not identify the filesystem type.
Split-Brain Behaviour
The configured policies apply when split brain is detected:
These policies do not provide fencing. For a dual-primary split brain, stop conflicting writes and identify the authoritative copy before recovery. (Split-brain policy reference)
Useful Troubleshooting Commands
If the connection remains in WFConnection, check peer availability, replication IPs and TCP port 7788. If the kernel log reports split brain, follow the recovery procedure instead of forcing a reconnect. (DRBD 8.4 guide)