Getting High With Lenny - Page 2

Install DRBD8, LVM2, and Heartbeat

We need to do this on both machines.

apt-get install drbd8-modules-2.6-vserver-686-bigmem drbd8-module-source lvm2 heartbeat-2


Build DRBD8

 DRBD man pages

m-a a-i drbd8

depmod -ae

modprobe drbd


Configure DRBD8

mv /etc/drbd.conf /etc/drbd.conf.original

nano /etc/drbd.conf

global {
        usage-count no;
common {
  syncer { rate 100M; }                                                                                            
resource r0 {
  protocol C;
  handlers {
    pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt  f";
    pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt f";
    local-io-error "echo o > /proc/sysrq-trigger ; halt f";
    outdate-peer "/usr/lib/heartbeat/drbd-peer-outdater -t 5";
  startup {
    degr-wfc-timeout 120;    # 2 minutes.
  disk {
    on-io-error   detach;
  net {                   
    after-sb-0pri disconnect;
    after-sb-1pri disconnect;
    after-sb-2pri disconnect;
    rr-conflict disconnect;
  syncer {
    rate 100M;
    al-extents 257;
        on node1 {
                device     /dev/drbd0;
                disk       /dev/cciss/c0d0p6;
                meta-disk  internal;
        on node2 {
                device     /dev/drbd0;
                disk       /dev/cciss/c0d0p6;
                meta-disk  internal;

We need to change the permissions or DRBD will ask for it later.

chgrp haclient /sbin/drbdsetup

chmod o-x /sbin/drbdsetup

chmod u+s /sbin/drbdsetup

chgrp haclient /sbin/drbdmeta

chmod o-x /sbin/drbdmeta

chmod u+s /sbin/drbdmeta

On both nodes:


drbdadm create-md r0


drbdadm create-md r0


drbdadm up r0


drbdadm up r0

The following should be done on the node that will be the primary

On node1:

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

watch cat /proc/drbd 

should show you something like this:

version: 8.0.13 (api:86/proto:86)
GIT-hash: ee3ad77563d2e87171a3da17cc002ddfd1677dbe build by [email protected], 2008-08-04 15:28:07
 0: cs:SyncSource st:Primary/Secondary ds:UpToDate/Inconsistent C r---
    ns:62059328 nr:0 dw:3298052 dr:58770141 al:2102 bm:3641 lo:1 pe:261 ua:251 ap:0
    [===>................] sync'ed: 22.1% (208411/267331)M
    finish: 4:04:44 speed: 14,472 (12,756) K/sec
    resync: used:1/61 hits:4064317 misses:5172 starving:0 dirty:0 changed:5172
    act_log: used:0/257 hits:822411 misses:46655 starving:110 dirty:44552 changed:2102

Share this page:

Suggested articles

0 Comment(s)

Add comment