This topology provides a highly available service with minimal hardware requirements. See the overview. for information on how this setup works.
The documentation that follows assumes that all nodes on the network are set up with correct interfaces and routes for each network they are connected to as per the diagram above. The default route for the real-servers is assumed to be the router, but may be an alternate route if available.
This example builds on the example of a high availability single virtual service and adds the ability to have RFC 1519 [offsite], CIDR networks of virtual addresses. The configuration steps for the single virtual service are required in addition to the configuration below.
IPV4 forwarding must be enabled. This is done by adding configuration of net.ipv4.ip_forward to /etc/sysctl.conf as follows:
# Enables packet forwarding net.ipv4.ip_forward = 1For these changes to take effect the sysctl command may be used:
/sbin/sysctl -p net.ipv4.ip_forward = 1
To route 192.168.0.0/24 to 192.168.6.240, add an entry to /etc/sysconfig/static-routes.
any net 192.168.0.0 netmask 255.255.255.0 gw 192.168.6.240
Restarting networking on the machine will make this change take effect.
/etc/init.d/network restart Shutting down interface eth0: [ OK ] Setting network parameters: [ OK ] Bringing up interface lo: [ OK ] Bringing up interface eth0: [ OK ]
You can verify that this worked using the ip command.
/sbin/ip route list 192.168.0.0/24 192.168.0.0/24 via 192.168.6.240 dev eth0
To route 192.168.0.0/24 to 192.168.6.240, add up and pre-down lines to lines to the entry in /etc/network/interfaces for the interface that is connected to the Real-Servers. A sample entry for eth0 follows:
auto eth0 iface eth0 inet static address 192.168.6.1 netmask 255.255.255.0 up ip route add 192.168.0.0/24 via 192.168.6.240 pre-down ip route del 192.168.0.0/24 via 192.168.6.240
Restarting networking on the machine will make this change take effect.
/etc/init.d/networking restart Reconfiguring network interfaces... done.
You can verify that this worked using the ip command.
/sbin/ip route list 192.168.0.0/24 192.168.0.0/24 via 192.168.6.240 dev eth0
The Real-Servers should be set up as per high availability single virtual service, with the exception that the haresources file is updated to include the following resource:
IPaddr2::192.168.6.240/24/eth0/192.168.6.255This ensures that the real-server will accept traffic for all of 192.168.0.0/24 as local. This updated /etc/ha.d/haresources file includes this change. To effect the change, restart heartbeat on both real-servers.
/etc/init.d/heartbeat restartAfter a few moments heartbeat should add the virtual addresses to eth0 and lo on the master. This can be verified using the ip command. output has been truncated show only the eth0 interface. You can verify that came up using the ip command. The following output has been truncated to only show information for lo:0.
/sbin/ip addr sh
1: lo: >LOOPBACK,UP< mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
inet 192.168.0.0/24 brd 192.168.0.255 scope global lo
3: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:50:56:4f:30:07 brd ff:ff:ff:ff:ff:ff
inet 192.168.6.4/16 brd 192.168.6.255 scope global eth0
inet 192.168.6.240/16 brd 192.168.6.255 scope global secondary eth0
Note: The netmask of 255.255.255.0 on the lo:0
interface indicates that this interface will accept traffic for all of the
addresses in
network 192.168.0.0 netmask 255.255.255.0.
This behaviour is peculiar to the
loopback interface (lo) and aliases.
Copyright © 2000-2005,
Horms
Last Updated: Sat Mar 4 16:33:56 2006 +0900
Debian is a registered trademark of Software in the Public Interest, Inc.
Red Hat, the Red Hat Shadowman logo and Fedora are
registered trademarks of Red Hat, Inc.
Red Hat may also be refered to as RedHat on this site.
Linux is a registered trademark of Linus Torvalds.
All other trademarks are the property of their respective owners.