DRBD with OCSF2

= 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

Check more on DRBD

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 on serverNode01 (IP 192.168.11.23) and  on serverNode02 (IP 192.168.11.27) to create a drbd node  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.

Please change what even which suit your needm

Now it is time to change /etc/conf.d/ocfs2 files

There are a lot of configurable parameters there but we will only make one change. OCFS2_CLUSTER and change it to ocfs2 cluster name.

It is also time we add the required mount to /etc/fstab

Please add the following.

= DRBD Initialization and Setup = After we have all this.

It is time to initial DRBD

Let us up this DRBD devices.

When both node is up. We can check on the BRDB status.

When Both node is up, we will see something...

The Secondary/Unknown become Secondary/Secondary.

We now have the DRBD device.

Let start to synchronization both node BRDB by making it primary

Let us check the synchronization status

Please wait until it is done.

Let make 2nd Node primary

Let start the DRBD services

Yes, Our DRBD cluster are done. Now let continue to the OCFS2 Setup

= OCFS2 Setup = The 1st things we need to do is to mount the required kernel config and dlm that needed by OCFS2. Since that we already modified the /etc/fstab. You can simple follow the command below.

We should now start the OCFS2 Cluster

Now let us make the DRBD cluster run OCFS2

We can now mount it the OCFS2 cluster

= Adding both DRBD and OCFS2 on system boot = Let us start both DRBD and OCFS2 when system boot up.

= See also = DRDB

= External Reference =