Today I set up an replicated cluster filesystem using in DRBD an GFS2 inside 2 KVM-based virtual machines. These are running CentOS 6 with an additional storage vdb as the base drive for DRBD. I already set up an MariaDB Galera-Cluster. First of, as CentOS 6 has no drbd* packages anymore, I used the ELRepro as the source for DRBD:
rpm -Uvh http://elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
yum --enablerepo=elrepo install drbd83-utils kmod-drbd83 ntp && service ntpd start && chkconfig ntpd on
The NTP-Service is necessary to keep the server time in sync on both nodes. And, you need /etc/hosts entries if you are not using DNS name resolution.

192.168.122.22 node01.local
192.168.122.23 node02.local
Now, you need to build your drbd volume, i name it /dev/vdb for now, as it was for me.

Insert the DRBD Kernel module on both nodes:
modprobe -v drbd
and edit your DRBD-Ressource on both nodes:

resource gfs2 {
protocol C;
    startup {
            wfc-timeout 20;
            degr-wfc-timeout 10;
            # become-primary-on both; # Enable this *after* initial testing
    }
    net {
            cram-hmac-alg sha1;
            shared-secret "happy2013everybody";
            allow-two-primaries;
    }

    on node01.local {
    device          /dev/drbd0;
    address         ipv4 192.168.122.22:7850;
    disk            "/dev/vdb";
    meta-disk  internal;
    }

    on node02.local {
    device          /dev/drbd0;
    address         ipv4 192.168.122.23:7850;
    disk            "/dev/vdb";
    meta-disk  internal;
    }
    disk {
            fencing resource-and-stonith;
    }
    handlers {
            outdate-peer "/sbin/obliterate-peer.sh"; # We'll get back to this.
    }
}

The /sbin/obliterate-peer.sh can be found here. Additionally, add rate 100M; to the syncer section in /etc/drbd.d/global_common.conf. This increases the sync speed dramatically. Now initialize your pool on both nodes:

drbdadm create-md gfs2 drbdadm up gfs2 drbdadm invalidate gfs2 The last step ist only necessary if drbd-overview lists both as incosistent. This may take a while. In the meantime install gfs2-utils and RedHat Cluster Manager:

yum install gfs2-utils cman
Edit your /etc/cluster/cluster.conf:

<?xml version="1.0"?>
<cluster alias="lolcats" config_version="41" name="lolcats">
    <cman expected_votes="1" two_node="1"/>
    <clusternodes>
            <clusternode name="node01.local" nodeid="1" votes="1">
                    <fence>
                            <method name="1">
                                    <device domain="node01.local" name="xvm"/>
                            </method>
                    </fence>
            </clusternode>
            <clusternode name="node02.local" nodeid="2" votes="1">
                    <fence>
                            <method name="1">
                                    <device domain="node01.local" name="xvm"/>
                            </method>
                    </fence>
            </clusternode>
    </clusternodes>
    <fencedevices>
            <fencedevice agent="fence_xvm" name="xvm"/>
    </fencedevices>
    <rm/>
</cluster>

If your drbd resync is done you are ready to gfs2'd your new pool:

mkfs.gfs2 -p lock_dlm -t lolcats:drbdtest /dev/drbd/by-res/gfs2 -j 2
mkdir /mnt/drbdtest (on both nodes)
edit your fstab (on both nodes): /dev/drbd/by-res/gfs2 /mnt/drbdtest gfs2 defaults 0 0
and start the cluster manager: service cman start && service gfs2 start

You are done now. Leave a comment if you like it or even if you don't.