This guide describes DRBD version 8.4 and above. For 8.3 please look here.


Chapter 12. Using OCFS2 with DRBD

Table of Contents

12.1. OCFS2 primer
12.2. Creating a DRBD resource suitable for OCFS2
12.3. Creating an OCFS2 filesystem
12.4. Pacemaker OCFS2 management
12.4.1. Adding a Dual-Primary DRBD resource to Pacemaker
12.4.2. Adding OCFS2 management capability to Pacemaker
12.4.3. Adding an OCFS2 filesystem to Pacemaker
12.4.4. Adding required Pacemaker constraints to manage OCFS2 filesystems
12.5. Legacy OCFS2 management (without Pacemaker)
12.5.1. Configuring your cluster to support OCFS2
12.5.2. Using your OCFS2 filesystem

This chapter outlines the steps necessary to set up a DRBD resource as a block device holding a shared Oracle Cluster File System, version 2 (OCFS2).

[Important]Important

All cluster file systems require fencing - not only via the DRBD resource, but STONITH! A faulty member must be killed.

You’ll want these settings:

disk {
        fencing resource-and-stonith;
}
handlers {
        # Make sure the other node is confirmed
        # dead after this!
        outdate-peer "/sbin/kill-other-node.sh";
}

There must be no volatile caches! You might take a few hints of the page at https://fedorahosted.org/cluster/wiki/DRBD_Cookbook, although that’s about GFS2, not OCFS2.

12.1. OCFS2 primer

The Oracle Cluster File System, version 2 (OCFS2) is a concurrent access shared storage file system developed by Oracle Corporation. Unlike its predecessor OCFS, which was specifically designed and only suitable for Oracle database payloads, OCFS2 is a general-purpose filesystem that implements most POSIX semantics. The most common use case for OCFS2 is arguably Oracle Real Application Cluster (RAC), but OCFS2 may also be used for load-balanced NFS clusters, for example.

Although originally designed for use with conventional shared storage devices, OCFS2 is equally well suited to be deployed on dual-Primary DRBD. Applications reading from the filesystem may benefit from reduced read latency due to the fact that DRBD reads from and writes to local storage, as opposed to the SAN devices OCFS2 otherwise normally runs on. In addition, DRBD adds redundancy to OCFS2 by adding an additional copy to every filesystem image, as opposed to just a single filesystem image that is merely shared.

Like other shared cluster file systems such as GFS, OCFS2 allows multiple nodes to access the same storage device, in read/write mode, simultaneously without risking data corruption. It does so by using a Distributed Lock Manager (DLM) which manages concurrent access from cluster nodes. The DLM itself uses a virtual file system (ocfs2_dlmfs) which is separate from the actual OCFS2 file systems present on the system.

OCFS2 may either use an intrinsic cluster communication layer to manage cluster membership and filesystem mount and unmount operation, or alternatively defer those tasks to the Pacemakercluster infrastructure.

OCFS2 is available in SUSE Linux Enterprise Server (where it is the primarily supported shared cluster file system), CentOS, Debian GNU/Linux, and Ubuntu Server Edition. Oracle also provides packages for Red Hat Enterprise Linux (RHEL). This chapter assumes running OCFS2 on a SUSE Linux Enterprise Server system.


This guide describes DRBD version 8.4 and above. For 8.3 please look here.