Can piranha failover all ethernet interfaces?
Mark T. Dame
mdame at mfm.com
Mon Dec 3 15:54:21 UTC 2007
Brian Ghidinelli wrote:
>
> What I want is:
>
> 10.64.2.1 (floating VIP)
> 10.64.2.2 (fw 1)
> 10.64.2.3 (fw 2)
>
> 10.64.3.1 (floating VIP)
> 10.64.3.2 (fw 1)
> 10.64.3.3 (fw 2)
>
> And these interfaces should failover whenever the primary nat_router is
> failed over so that the boxes in 10.64.2 and .3, which depend on the
> firewall/gateway for routing, will continue to have network access.
>
> Can piranha do this?
Not directly. You will have to write a script to bring the extra
interfaces up or down and then use the start_cmd and stop_cmd settings
to call the script when the service fails over. I did something similar
for a MySQL server. I have two servers, each with two NICs, one
external and one internal. On failover, the floating IP for each
network to switch to the appropriate server. My service definition is:
failover mysql {
active = 1
address = xxx.xxx.xxx.xxx eth0:1
port = mysql
timeout = 3
start_cmd = "/path/to/script/fos_failover.pl -u"
stop_cmd = "/path/to/script/fos_failover.pl -d"
}
fos_failover.pl takes either -u (for up) or -d (for down). On up, it
enables the VIP on the internal NIC and sends an arp broadcast to the
network. On down, it disables the VIP on the internal NIC. In both
cases it sends an e-mail to report the failover.
The script is pretty straight forward. It uses the perl system()
function to call ifconfig to enable or disable the VIP and send_arp to
send the arp notification.
-m
--
## Mark T. Dame <mailto:mdame at mfm.com>
## VP, Product Development
## MFM Software, Inc. (http://www.mfm.com/)
"We now return you to your regularly scheduled \"I've been hacking
so long we had only zeros, not ones and zeros\" discussion..."
-- Randal Schwartz"
More information about the Piranha-list
mailing list