DRBD

From wiki.techunit.org
Jump to: navigation, search

Installation

  • Create a LVM partition on both nodes: LVM
  • To do on both nodes
aptitude install drbd-utils -y
  • Edit /etc/drbd.d/res0.res:
 resource res0 {
  device /dev/drbd0;
  disk /dev/vg_data/lv_shared;
  meta-disk internal;
  net {
    after-sb-0pri discard-zero-changes;
    after-sb-1pri discard-secondary;
    after-sb-2pri disconnect;
  }
  syncer {
    rate 90M;
  }
  on node1 {
    address 10.0.0.1:7789;
  }
  on node2 {
    address 10.0.0.2:7789;
  }
 }
  • Than create ressource:
drbdadm create-md res0
service drbd restart


  • To do on node1, define the master
drbdadm -- --overwrite-data-of-peer primary res0
  • And format the partition
mkfs.ext4 /dev/drbd0
  • Verify DRBD status:
root@zimbra-01:~# cat /proc/drbd 
version: 8.4.3 (api:1/proto:86-101)
srcversion: 6551AD2C98F533733BE558C 
0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
   ns:180412 nr:0 dw:180412 dr:681 al:51 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0

Debug : Persistent DRBD Split Brain

  • Node2
drbdadm down res01
  • Node1
drbdadm down res01
drbdadm create-md res01
drbdadm up res01
drbdadm -- --overwrite-data-of-peer primary res01
  • Node2
drbdadm up res01
  • Node1
drbdadm primary res01
mkfs.ext4 /dev/drbd0

Sources

Elliot
techUnit's cofounder