Disk Replication with DRBD

From Alpine Linux
Revision as of 09:52, 8 November 2011 by Larena (talk | contribs) (first writing)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Underconstruction clock icon gray.svg
This material is work-in-progress ...

Do not follow instructions here until this notice is removed.
(Last edited by Larena on 8 Nov 2011.)

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