Again a tip on how to write your OpenAIS/Pacemaker configuration in a simpler fashion; this applies to SUSE Linux Enterprise 11 High-Availability Extension too, of course.
For the full cluster functionality with
OpenAIS/OCFS2/cLVM2 and an OCFS2 mount on top, you need to
configure DLM, O2CB, cLVM2 clones, one to start the LVM2
volume group, and Filesystem resources to mount the file
system. Add in all the dependencies needed, and you end up
with a configuration pretty much like this (shown in CRM
shell syntax, which is already much more concise than the
raw XML):
primitive clvm ocf:lvm2:clvmd primitive dlm ocf:pacemaker:controld primitive o2cb ocf:ocfs2:o2cb primitive ocfs2-2 ocf:heartbeat:Filesystem \ params device="/dev/cluster-vg/ocfs2" directory="/ocfs2-2" fstype="ocfs2" primitive vg1 ocf:heartbeat:LVM \ params volgrpname="cluster-vg" clone c-ocfs2-2 ocfs2-2 \ meta target-role="Started" interleave="true" clone clvm-clone clvm \ meta target-role="Started" interleave="true" ordered="true" clone dlm-clone dlm \ meta interleave="true" ordered="true" target-role="Stopped" clone o2cb-clone o2cb \ meta target-role="Started" interleave="true" ordered="true" clone vg1-clone vg1 \ meta target-role="Started" interleave="true" ordered="true" colocation colo-clvm inf: clvm-clone dlm-clone colocation colo-o2cb inf: o2cb-clone dlm-clone colocation colo-ocfs2-2 inf: c-ocfs2-2 o2cb-clone colocation colo-ocfs2-2-vg1 inf: c-ocfs2-2 vg1-clone colocation colo-vg1 inf: vg1-clone clvm-clone order order-clvm inf: dlm-clone clvm-clone order order-o2cb inf: dlm-clone o2cb-clone order order-ocfs2-2 inf: o2cb-clone c-ocfs2-2 order order-ocfs2-2-vg1 inf: vg1-clone c-ocfs2-2 order order-vg1 inf: clvm-clone vg1-cloneThat's quite a bite, and becomes cumbersome for every fs you add.
However, there is a little known feature - you can
actually clone a resource group:
primitive clvm ocf:lvm2:clvmd primitive dlm ocf:pacemaker:controld primitive o2cb ocf:ocfs2:o2cb primitive ocfs2-2 ocf:heartbeat:Filesystem \ params device="/dev/cluster-vg/ocfs2" directory="/ocfs2-2" fstype="ocfs2" primitive vg1 ocf:heartbeat:LVM \ params volgrpname="cluster-vg" group base-group dlm o2cb clvm vg1 ocfs2-2 clone base-clone base-group \ meta interleave="true"
I think this speaks for itself; 20 lines of
configuration reduced. You will also find that
crm_mon
output is much simpler and shorter,
allowing
you to
see more of the cluster status in one go.