Documentation/Storage-Configuration/Advanced/two-node-cluster-drbd.md
This guide provides installation instructions for setting up a two-node Kubernetes cluster with Rook using DRBD (Distributed Replicated Block Device) for storage replication for one of the Ceph mons.
For architecture details and design rationale, see the Two-Node Fencing Design Document.
Before starting the installation:
DRBD kernel modules must be installed and loaded on both nodes before running the setup script.
Follow the DRBD installation documentation for your distribution and install drbd & drbd_transport_tcp:
On both nodes, verify DRBD modules are loaded:
# Check loaded modules
lsmod | grep drbd
# Expected output:
# drbd_transport_tcp 16384 0
# drbd 614400 1 drbd_transport_tcp
# Check DRBD version
drbdadm --version
Use the setup script to list available block devices on both nodes:
./deploy/examples/drbd-setup-experimental.sh -l
Example output:
=== Block devices (node0=node-0, node1=node-1) ===
Use the PATH column (e.g. -d /dev/sdb or -d0 / -d1 per-node paths).
--- node-0 ---
NAME PATH SIZE ROTA TYPE FSTYPE
sdb /dev/sdb 10G 0 disk <-- Use this
--- node-1 ---
NAME PATH SIZE ROTA TYPE FSTYPE
sdb /dev/sdb 10G 0 disk <-- Use this
Same path on both nodes: -d <path>
Different paths (same size): -d0 <path0> -d1 <path1>
Requirements for backing devices:
The setup script configures DRBD, performs initial sync, and creates the auto-start DaemonSet.
./deploy/examples/drbd-setup-experimental.sh -d /dev/sdb
./deploy/examples/drbd-setup-experimental.sh -d0 /dev/sdb -d1 /dev/sdc
Available options:
./deploy/examples/drbd-setup-experimental.sh -h
!!! note Network connectivity on DRBD replication port (default: 7794) between nodes, we can customise this in the script.
Check auto-start DaemonSet:
kubectl get daemonset drbd-autostart -n rook-ceph
kubectl get pods -n rook-ceph -l app=drbd-autostart
Check for the drbd-configure configmap
kubectl get cm -n rook-ceph drbd-configure -o yaml
Create the CephCluster CR with floating monitor configuration:
Apply the cluster:
kubectl apply -f deploy/examples/cluster-tnf.yaml
Check monitor pods:
kubectl get pods -n rook-ceph -l app=rook-ceph-mon
Expected: 3 monitor pods (mon-a, mon-b, mon-c)
Check Ceph status:
kubectl exec -n rook-ceph deploy/rook-ceph-tools -- ceph status
Expected output:
cluster:
id: <cluster-id>
health: HEALTH_OK
services:
mon: 3 daemons, quorum a,b,c (age ...)
...
The setup creates:
r0) with Protocol C synchronous replication/dev/drbd0) with XFS filesystemdrbd-autostart) in rook-ceph namespacedrbd-configure) in rook-ceph namespacemon-c) backed by DRBDConfigure pools with replica-2, pool-tnf.yaml
Check:
lsmod | grep drbd
Fix: Install DRBD kernel modules (see Step 1)
Check network connectivity:
nc -zv <peer-node-ip> 7794
Check DRBD status:
drbdadm status r0
Check DRBD is Secondary on both nodes:
drbdadm role r0
# Expected: Secondary/Secondary
Check ConfigMap:
kubectl get configmap drbd-configure -n rook-ceph -o yaml
The script is idempotent and safe to re-run:
./deploy/examples/drbd-setup-experimental.sh -d /dev/sdb