Corosync

Corosync is the currently preferred cluster messaging layer in the Linux cluster community. It is typically used with Pacemaker to set up Gentoo-based clusters.

Installing
Recently there has been a fair amount of standardization-oriented changes within the Linux cluster community. Perhaps as a result, at present the version of Corosync available in the portage tree is out of date.

Download
To get the absolutely latest version of Corosync installed (usually a good idea), you can take the following steps.

First, download the 'git HEAD' (latest release) corosync ebuild from here and temporarily install it in to your local tree.

Unmask
Next, unmask the package.

If you are on amd64 or another untested architecture, you may also need to do the following.

Install
Now emerge the git HEAD release of corosync.

Unmask the git HEAD version (ie. -9999) of pacemaker.

If you are on amd64 or another untested architecture, you may also need to un-archmask it as follows (replace amd64 with your architecture).

Install pacemaker.

Configuring
Gentoo installs the example corosync configuration in to /etc/corosync/corosync.conf.example. First copy this to /etc/corosync/corosync.conf.

Then edit the file to express your appropriate configuration, using your favourite text editor.

Running
Corosync is managed as a standard Gentoo OpenRC service, ie. you can start and stop it as follows.

Debugging
Corosync logs to /var/log/cluster/corosync.log by default. To view the log, run:

If you are having issues even starting Corosync successfull (such as receiving "Status: crashed" when executing /etc/init.d/corosync status), then you can start the daemon manually with the -F (foreground) option as follows. (You might also consider first enabling the log_to_stderr directive within /etc/corosync/corosync.conf).

Next steps
Once you have corosync installed and talking between a couple of machines, you may wish to move on to installing Pacemaker.