Disk Replication with DRBD

From Alpine Linux
Revision as of 08:18, 12 March 2012 by Dubiousjim (talk | contribs) (Category:Storage)
This material is work-in-progress ...

Do not follow instructions here until this notice is removed.
(Last edited by Dubiousjim on 12 Mar 2012.)

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

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 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