Setting up Failover for symmetric use on Linux


This is the README.linux file I wrote for getting Andreas Muller's Failover package to support symmetric failover on Linux. Mark Akermann got it working on Solaris, and then I modified his files to make it work on Linux.

My modified files can be downloaded here.

You'll need the failover rpm file from Andreas' site (the binary, not the source package). Then download my file, untar it, and read the README and README.linux files before you install anything. If you have any questions, you can contact me at petre at maltzen dot net.

README.linux

Symmetric failover - Linux version
=====================

Read the README file before you read README.linux, as everything will make more sense that way. Symmetric failover was originally developed for Solaris; I just modified those files to work with Linux. These are my notes about how to install it on Linux. This has been tested successfully on Red Hat 7.3, 8 and 9, and should work with most other distros, but YMMV.
--Petre Scheie

Description
-----------

This directory contains a configuration file setup for symmetric failover. In such a situation, each machine has a virtual address in addition to the real adress. As soon as the partner fails, the second address is activated on the remaining machine.

Such a setup is particularly usefull with proxies or web servers. If you publish both virtual addresses in a DNS server that does round robin DNS, you get a natural load sharing configuration. If one of the servers fails, the other will take over the service from the failed partner.

Requirements
------------

These are the files I had to install to make failover work on a pair of Red Hat 9 boxes:

tcl-8.3.5-88.i386.rpm
pth-1.4.0-2.i586.rpm
failover-0.5.17-1.i586.rpm

The tcl file should be on your distro's CDs; if not, you can get it from www.rpmfind.net. It doesn't have to be version 8.3.5; that was just current version at the time I originally wrote this. Use the version that comes with your distro.

pth is available in an rpm file. In earlier attempts, it would always hang when I tried to install the rpm, so I went to www.gnu.org and got their tar file, which installed quite easily. However, as of July, 2006, using the rpm file on CentOS 4.3 installed and worked with no problems. failover looks for version 1.4 of pth, so while there are newer versions avilable, I used the 1.4 version because the 2.0 version gave me trouble.

I also had to create some symlinks so that the faild and failsh binaries would run:

ln -s /usr/lib/libtcl8.3.so /usr/lib/libtcl8.4.so
ln -s /usr/local/lib/libpth.so.14 /lib/libpth.so.14

One more thing: Be sure the 'hostname' command returns the fully qualified name on both boxes; that is, 'hostname' should return 'samson.mycompany.com' and not just 'samson'. This is necessary because the setup script will ask for the FQDN of the hosts at one point in order to create configurations directories with those names, and then later it will try to cd into those directories using the `hostname` output.

Installation
------------

1. Install the tcl and pth packages mentioned above.

2. Create the symlinks mentioned above.

3. Install the failover rpm package, but don't run the setup script.

4. Run ldd on /usr/local/sbin/faild and /usr/local/sbin/failsh to make sure there aren't any missing dependencies.

5. cd into the symmetric-linux/ directory, wherever you untarred it, and run its setup script:

    $ sh setup

It will ask you the necessary parameters, create the necessary files in two sudirectories named after the names of the two hosts, and will install the configuration files and start/stop scripts for the first host. On the second host, install the failover package but don't run the setup script, and then copy the files for the second host, created in the steps above, from the first host. The *.tcl file goes in /usr/local/lib/failover/; the other four files--faild, failsh, and the two named after the virtual addresses--should all be placed in /etc/init.d/.

You should then be able to start the failover with the simple setup described in the Getting Started file.

==============================================================

One afterthought: Be sure you have the hostnames in either the /etc/hosts file or DNS, or failsh won't come up.

Another afterthought: Be sure port 1291 in the linux firewall (iptables) is open, or the two machines won't be able to talk to each other.

2003/09/22
Updated 2006/07/21