Dual Primary DRBD + OCFS2

In this HOWTO I try to describe howto set up a dual primary DRBD with the cluster filesystem OCFS2 that can be used as shared storage.

As I am very limited in time I will try to add parts as I find spare time. Please note that this is still a kind of experimental setup (at least for me). Please feel free to correct errors you find in this HOWTO or to mail me (misch@multinet.de). Thanks for your careful review!

Architecture

In this the cluster filesystem (OCFS2) uses the distributed lock manager (DLM). Please see the for a sketch of the usage of the lock manager by the various cluster storage solutions.

Base System

In this setup I use openSUSE 11.1 for the installation. Since the development of the cluster software is driven by SUSE/Novell the latest developments show up in this distributions first. So this distribution has all working components my the setup and I do not have to compile too much myself. Just do a base install on the software.

Please be sure that you end up with a fully patched system.

DRBD

Here comes the first problem. We need DRBD version 8.3.2 for the included resource agent that can deal with two primaries of DRBD. As far as I know there is no precompiled package of this version for openSUSE 11.1. So you will have to compile it yourself. Get the latest sources from linbit and unzip and untar it: For the compilation there is an excellent documentation from linbit. I just want to describe what worked for me: - Get the kernel sources, make, gcc, automake, autoconf and flex
 * 1) tar xvzv drbd-8.3.2.tar.gz
 * 1) cd drbd-8.3.2
 * 2) make clean all
 * 3) make install

After you built and installed the drbd kernel module you can start to configure the DRBDs on the two servers. Please see linbits documentation for this. When you got you Primary/Secondary configuration running you can start configuring the dual-primary mode. All nescessary steps are described again in the docs of linbit. Basically it uncommenting the options "allow-two-primaries" and "become-primary-on-both" in both config files.

Please test this setup manually! Please only go further when it really works.

During your test and setup you will run into a lot of split brain situations. You will want to consider optimizing split-brain behavior of the DRBD. See for more information.

Software Repository

After the DRBD really works (does it really work?) you can start to install the cluster components. I used Lars repository but the openSUSE Buld Server should do as well. With YaST add a new Software Repository by entering the URL. From the new repository you now can install: - pacemaker: The cluster manager - pacemaker-mgmt: Server that the GUI connects to. - pacemaker-mgmt-client: Optional. Better install this on your laptop or use the command line. - cluster-glue: Useful remains of the heartbeat project. - libdlm2: Distributed Lock Manager - ocfs2-tools: Userland tools for the cluster filesystem. The kernel modules are installed automatically. - openais: The cluster communication stack. - pacemaker: The cluster resource manager. - resource agents: All other resource agents of the heartbeat project.

Setup the Cluster

- Setup OpenAIS cluster communication.

Configure the Resources

Tests