Chapter 3. Building and installing from source

Table of Contents

3.1. Building and installing Cluster Glue from source
3.1.1. Cluster Glue build prerequisites
3.1.2. Downloading Cluster Glue sources
3.1.3. Building Cluster Glue
3.1.4. Building Packages
3.2. Building and installing Heartbeat from source
3.2.1. Heartbeat build prerequisites
3.2.2. Downloading Heartbeat sources
3.2.3. Building Heartbeat
3.2.4. Building Packages

Building and installing the Heartbeat cluster messaging layer from source amounts to building the following packages:

Since heartbeat has a build dependency on cluster-glue, it is necessary to build and install cluster-glue first, before one proceeds with building and installing heartbeat.

3.1. Building and installing Cluster Glue from source

3.1.1. Cluster Glue build prerequisites

Building Cluster Glue requires the presence of the following tools and libraries on the build system:

  • A C compiler (typically gcc) and associated C development libraries;
  • the flex scanner generator and the bison parser compiler;
  • net-snmp development headers, to enable SNMP related functionality;
  • OpenIPMI development headers, to enable IPMI related functionality;
  • Python (just the language interpreter, not library headers).
[Note]Note

This list applies to the default software configuration. If you configure the source with non-standard options, other dependencies may apply.

3.1.2. Downloading Cluster Glue sources

Several options are available for retrieving the Cluster Glue source code, for building locally on a target system.

Downloading a release tarball

Downloading a released version of Heartbeat as a compressed tarball is equivalent to fetching a tagged snapshot from the Mercurial source code repository. Release tags follow the format glue-x.y.z, where x.y.z is the released version of Cluster Glue you wish to download.

If, for example, one wants to download the 1.0.1 release, the correct sequence of commands would be:

# wget http://hg.linux-ha.org/glue/archive/glue-1.0.1.tar.bz2
# tar -vxjf glue-1.0.1.tar.bz2

Downloading the latest Mercurial snapshot

The latest development code is always available in the Mercurial repository as the tip revision.

To download a tarball auto-generated from the tip, use this sequence of commands:

# wget http://hg.linux-ha.org/glue/archive/tip.tar.bz2
# tar -vxjf tip.tar.bz2

Checking out sources from Mercurial

This is the method you would apply if you have the Mercurial utilities locally installed. Checking out the sources amounts to cloning the repository:

$ hg clone http://hg.linux-ha.org/glue cluster-glue
requesting all changes
adding changesets
adding manifests
adding file changes
added 12491 changesets with 34830 changes to 2632 files
updating working directory
356 files updated, 0 files merged, 0 files removed, 0 files unresolved

3.1.3. Building Cluster Glue

Building Cluster Glue is an automated process making extensive use of GNU Autotools. When building and installing on the same machine, it usually amounts to just the following sequence of commands:

$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
[Note]Note

The autogen.sh script is a convenience wrapper around automake, autoheader, autoconf, and libtool.

A number of configuration options are supported, and you may tweak some of them to optimize Heartbeat for your system. To retrieve a list of configuration options, you may invoke configure with the --help option. A customized build may thus comprise these steps:

$ ./autogen.sh
$ ./configure --help
$ ./configure configuration-options
$ make
$ sudo make install

Some typical configuration options that you may wish to set are --prefix, --sysconfdir, and --localstatedir, as shown in this example:

$ ./autogen.sh
$ ./configure --help
$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
$ make
$ sudo make install

3.1.4. Building Packages

RPM packages

RPM spec files are provided in the Cluster Glue source tree both for SuSE and Red Hat based distributions:

  • cluster-glue-suse.spec should be used for OpenSUSE and SLES installations.
  • cluster-glue-fedora.spec is for Fedora, Red Hat Enterprise Linux, and CentOS.

Debian packages

Debian packaging for Cluster glue is maintained in a Mercurial repository on alioth.debian.org. Thus, rather than cloning or downloading from the upstream Mercurial repository, use the one hosted on alioth.

Once you have checked out or unpacked the source tree from the alioth repository, simply invoke dpkg-buildpackage from the top of the source tree — like you would with any other Debian package.