Synchronizing Configuration Files

After configuring the primary LVS router, there are several configuration files that must be copied to the backup LVS router before you start the cluster.

These files include:

ImportantImportant
 

The /etc/sysctl, /etc/sysconfig/iptables, or /etc/sysconfig/ipchains files do not change when you configure the cluster using the Piranha Configuration Tool.

Synchronizing lvs.cf

Anytime the LVS configuration file, /etc/sysconfig/ha/lvs.cf, is created or updated, you must copy it to the backup LVS router node.

WarningWarning
 

Both the active and backup LVS router nodes must have identical lvs.cf files. Mismatched LVS configuration files between the LVS router nodes can prevent failover.

The best way to do this is to use the scp command.

ImportantImportant
 

To use scp the sshd must be running on the backup router, see the Section called Configuring Services on the LVS Routers in Chapter 7 for details on how to properly configure the necessary services on the LVS routers.

Issue the following command as the root user from the primary LVS router to sync the lvs.cf files between the router nodes:

scp /etc/sysconfig/ha/lvs.cf n.n.n.n:/etc/sysconfig/ha/lvs.cf

In the above command, replace n.n.n.n with the real IP address of the backup LVS router.

Synchronizing sysctl

The sysctl file is only modified once in most situations. This file is read at boot time and tells the kernel to turn on packet forwarding.

ImportantImportant
 

If you are not sure whether or not packet forwarding is enabled in the kernel, see the Section called Turning on Packet Forwarding in Chapter 7 for instructions on how to check and, if necessary, enable this key functionality.

Synchronizing Network Packet Filtering Rules

If you are using a network packet filter, such as iptables or ipchains, you will need to synchronize the appropriate configuration file on the backup LVS router.

If you alter the any network packet filter rules, enter the following command as root from the primary LVS router:

scp /etc/sysconfig/net_filter n.n.n.n:/etc/sysconfig/.

In the above command, replace n.n.n.n with the real IP address of the backup LVS router and net_filter with either iptables or ipchains.

Next either open an ssh session to the backup router or log into the machine as root and type the following command:

/sbin/service net_filter restart

In the above command, replace net_filter with either iptables or ipchains.

Once you have copied these files over to the backup router and started the appropriate services (see the Section called Configuring Services on the LVS Routers in Chapter 7 for more on this topic) you are ready to start the cluster.