|
Quick Network Redundancy Schemes
Leo Liberti
Simple bash scripting and IP aliasing can be used to implement quick and easy host redundancy schemes based either on host availability or service availability. In this article, I describe a very simple way to implement such a scheme. The idea sprang from the need to supply a simple redundancy scheme to an HTTP service we have at IrisTech, where I work. The programming involved is limited to bash scripting and the availability of standard UNIX network utilities. This approach makes use of a feature of the Linux kernel, IP aliasing, which provides a neat way to assign more than one IP address to one network card; however, Linux is by no means the only operating system with this property. And even on operating systems without IP aliasing features, there are ways to circumvent this problem (e.g., installing two network cards).
Redundancy is useful when you have a computer running a crucial service. To lessen the probability of the service becoming unavailable, one (or possibly more than one) other computer monitors the activity of the service on the main computer. If the service becomes unavailable, there can be one of two reasons:
- The computer has crashed (or has lost the network connections);
- The computer is alive but the process running the service has died.
The monitoring computer must take different actions according to the nature of the problem.
Initial Scenario
To put this idea into practice, I will first describe the network setup needed to implement it. Host A (IP address 192.168.1.1 on device eth0) supplies the important service. Host B (IP address 192.168.1.2 on device eth0) monitors A and takes action when the important service becomes unavailable. To make things more precise and readily applicable, A runs the HTTP service with an Apache Web server running on port 80, and both A and B run Linux.
|