As pointed by Javier Guerra on the xen-users mailing list, the RedHat's cluster projet is now based on openAIS. It is then possible to skip cman and fenced when only clvm (aka without GFS) is needed. This results in a setting easiest by far! Exactly what I was looking for from always for my xen servers which do share the same FC storage unit!

The clvm package in Debian/Lenny is still based on cman, but it is quite easy to compile its source in order to use openAIS instead. I won't develop here the full process on how to install the build environment for dpkg nor the source, please refer to the large number of howto's.

Compile the package

  • The package libopenais-dev is required. Please install it.
  • in ~/src/clvm/lvm2-2.02.39/debian/clvm.init: remove everything related to cman and cluster.conf
  • in ~/src/clvm/lvm2-2.02.39/debian/control: modify the dependies (lvm2 without the version number, openais in place of cman) and modify the comments accordingly like following:
    Package: clvm
    Section: admin
    Priority: extra
    Architecture: any
    Depends: ${shlibs:Depends}, lvm2, lsb-base, openais
    Description: Cluster LVM Daemon for lvm2
    This package provides the clustering interface for lvm2. Instead of
    the package powered by debian, this one is not based on the Red Hat's
    "cman" cluster infrastructure but on "openais". This provide a light
    way to implement Cluster LVM. It allows logical volumes to be created
    on shared storage devices (eg Fibre Channel, or iSCSI).
  • in ~/src/clvm/lvm2-2.02.39/debian/rules: replace cman by openais in the configure options, and add the PATH where to find the openais libs in:
    ...
    $(STAMPS_DIR)/setup-deb: SOURCE_DIR = $(BUILD_DIR)/source
    $(STAMPS_DIR)/setup-deb: DIR = $(BUILD_DIR)/build-deb
    $(STAMPS_DIR)/setup-deb: $(STAMPS_DIR)/source
    rm -rf $(DIR)
    cp -al $(SOURCE_DIR) $(DIR)
    cd $(DIR); \
    ./configure CFLAGS="$(CFLAGS)" \
    LDFLAGS="-L/usr/lib/openais" \
    $(CONFIGURE_FLAGS) \
    --with-optimisation="" \
    --with-clvmd=openais \
    --enable-readline
    touch $@
    ...
  • update the version number and place a comment in changelog (eg with dch -i)
  • install the required libs in order to compile the package then build it:
    ~# apt-get build-dep clvm
    ~# dpkg-buildpackage -rfakeroot -uc -b

Install and configure openAIS and clvm

  • Install openais, then follow the provided QUICKSTART instructions (/usr/share/doc/openais/QUICKSTART.gz). In short:
    • create the user ais and the group ais.
    • mkdir /etc/ais where you can copy and modify the openais.conf example in from /ush/share/doc/openais/examples.
    • start aisexec on each nodes; debian does not provide the init script for it, you must write your own. For now, you can just type aisexec, which will start as a daemon by itself.
  • install the openais version of clvm (eg dpkg -i clvm_2.02.39-7.acv1_amd64.deb), then modify /etc/lvm/lvm.conf with locking_type = 3 in the global section.
  • Start it with /etc/init.d/clvm start (you can first check that everything is OK lauching clvm -d 1 on each nodes).
  • and voilà. Don't forget to create an init script for aisexec before you reboot your computers! ;)
You can get a copy of my own clvm package for openAIS at http://olecam.online.fr/debian/lenny/clvm_2.02.39-7.acv1_amd64.deb

Hope that helps!