[DRBD-user] DRBD Replication Modes

Nathan Joyes njoyes at interprisesoftware.com
Fri Dec 7 19:09:53 CET 2012

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


We are investigating the possibility of using DRBD to perform synchronous 
replication of our PostgreSQL database server. After reading the 
Replication modes section of the DRBD features documentation we concluded 
that we would need to use protocol C, which is describes writes to be 
considered complete only after both the local and the remote disk writes 
have been confirmed.  However, during our testing we were able to 
continuously write to the primary device after disabling network traffic 
on the secondary.  We also noticed that during high write loads on the 
primary the number of kilobytes out of sync would grow, but eventually the 
secondary would catch up.

After reading the documentation, we were surprised at the testing results.
Is this expected and/or correct behavior, or have we incorrectly configured
something for the DRBD device?

Here are the configuration files if it helps.

cat drbd.conf
# You can find an example in  /usr/share/doc/drbd.../drbd.conf.example

include "drbd.d/global_common.conf";
include "drbd.d/*.res";

cat drbd.d/global_common.conf
global {
        usage-count yes;
}

common {
        handlers {
                pri-on-incon-degr
"/usr/lib/drbd/notify-pri-on-incon-degr.sh;
/usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ;
reboot -f";
                pri-lost-after-sb
"/usr/lib/drbd/notify-pri-lost-after-sb.sh;
/usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ;
reboot -f";
                local-io-error "/usr/lib/drbd/notify-io-error.sh;
/usr/lib/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ;
halt -f";
        }

        startup {
        }

        options {
        }

        disk {
        }

        net {
                protocol C;
        }
}

cat drbd.d/*.res
resource r0 {
  on drbd-primary {
    device    /dev/drbd1;
    disk      /dev/sda1;
    address   XXX.XXX.XXX.XXX:7789;
    meta-disk internal;
  }
  on drbd-secondary {
    device    /dev/drbd1;
    disk      /dev/sda1;
    address   XXX.XXX.XXX.XXX:7789;
    meta-disk internal;
  }
}


Thanks,
Nathan.






More information about the drbd-user mailing list