Disk Replication with DRBD: Difference between revisions

From Alpine Linux
Line 2: Line 2:


== Disk Replication with DRBD ==
== Disk Replication with DRBD ==
DRBD support is present only in SCST version of Alpine. At the time of this writing DRBD tools are currently in edge (testing).


   #apk add drbd
   #apk add drbd

Revision as of 12:30, 4 October 2021

This material is work-in-progress ...

Do not follow instructions here until this notice is removed.
(Last edited by Larena on 4 Oct 2021.)

Disk Replication with DRBD

 #apk add drbd

Load DRBD kernel driver:

 #modprobe drbd

Sample DRBD configuration in /etc/drbd.d/r0.res (resource 0):

 resource r0 {
   device /dev/drbd1;
   disk /dev/md0;
   meta-disk internal;
   on host1 {
     address	192.168.0.1:7789;
   }
   on host2 {
     address	192.168.0.2:7789;
   }
 }


It is recommended to have a dedicated heartbeat interface for DRBD where replication occurs.

Create the DRBD device and bring it up on both nodes:

 #drbdadm create-md r0
 #drbdadm up r0

On primary node start replication:

 #drbdadm -- --overwrite-data-of-peer primary r0

If you want to temporarily speed up replication, run (e.g. 1G):

 #drbdsetup /dev/drbd1 syncer -r 1G

Control replication status:

 #cat /proc/drbd