DRBD with OCSF2

see DRBD

=Introduction= This is a guide for DRBR with OCFS2.

The tough came with found that samba Active Directory (AD) Domain Controller (DC) sysvol is not being replicated between DC as current Samba4 known limitation.

Q: Why DRBD only is not enough...

There might be case where there are multiple write access to the sysvol by multiple DC member, thus without cluster files system we might be looking for trouble since the DRBD volume are being mount by 2 or more DC member, so OCFS2 is selected for it performance and also popularity.

You can use always other Cluster files system.

= Prerequisite = Below are the kernel need.

= Packages = Please emerge the following package

DRBD 8.4 guide do suggest the use of heartbeat and also pacemaker. But I think that was just too complicated...

You are welcome to try and add on an option with heartbeat and peacemaker.

= DRBD Configuration = We will now configure DRBD.

Please check the DRBD User’s Guide Ver 8.4 on their website it is well written with example.

This is a Global DRBD configuration. It will need to change according to your DRBD need. Please check the on the manual for more info.

Please create the files below.

If you have multiple resource setup, you can do it one resource per files to avoid confusion.

Below files is a 2 Node Resource example.

In plain English, we will use /dev/sda5 on serverNode01 (IP 192.168.11.23) and /dev/sda5 on serverNode02 (IP 192.168.11.27) to create a drbd node /dev/drbd1 respectively on both server. Both drbd node will store the metadata on internally.

= OCFS2 Configuration = We will now continue with OCFS2 Setup.

Unfortunately ocfs2 configuration don't include the cluster files example and thus you will need to copy the files below as an example.

= DRBD Setup =

When the 2nd node is up.

DRBD are now successfully setup

The initial device synchronization

Until it is done.

the initial full synchronization will commence

ocfs2 setup

Time to make a change and make the DRBD Dual Primary We only list changes here

{{File|/etc/drdb.d/global_common.conf|| handlers { pri-on-incon-degr "/usr/lib64/drbd/notify-pri-on-incon-degr.sh; /usr/lib64/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f"; pri-lost-after-sb "/usr/lib64/drbd/notify-pri-lost-after-sb.sh; /usr/lib64/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f"; local-io-error "/usr/lib64/drbd/notify-io-error.sh; /usr/lib64/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f"; out-of-sync "/usr/lib64/drbd/notify-out-of-sync.sh root";

net { protocol C;               allow-two-primaries yes;

}}

{{File|/etc/drdb.d/r0.res|| resource r0 { startup { become-primary-on both; }       }        on amtbsrv01 { device   /dev/drbd1; disk     /dev/sda5; address  192.168.11.23:7789; meta-disk internal; }       on amtbsrv02 { device   /dev/drbd1; disk     /dev/sda5; address  192.168.11.27:7789; meta-disk internal; }       net { # allow-two-primaries yes; after-sb-0pri discard-zero-changes; after-sb-1pri discard-secondary; after-sb-2pri disconnect; } } }}

=External Reference=