From mdame at mfm.com Mon Dec 3 15:54:21 2007 From: mdame at mfm.com (Mark T. Dame) Date: Mon, 03 Dec 2007 10:54:21 -0500 Subject: Can piranha failover all ethernet interfaces? In-Reply-To: <47506240.3060202@vfive.com> References: <47506240.3060202@vfive.com> Message-ID: <475426AD.9020000@mfm.com> 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 ## 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" From brian at vfive.com Mon Dec 3 22:45:32 2007 From: brian at vfive.com (Brian Ghidinelli) Date: Mon, 03 Dec 2007 14:45:32 -0800 Subject: Can piranha failover all ethernet interfaces? In-Reply-To: <475426AD.9020000@mfm.com> References: <47506240.3060202@vfive.com> <475426AD.9020000@mfm.com> Message-ID: <4754870C.4050901@vfive.com> Mark T. Dame wrote: > 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: Mark, thanks for the response. So, if the heartbeat goes down which causes the external interface to be brought up on the standby, the failover will simultaneously be triggered and can execute a script to change the other NICs? I have read conflicting info on whether or not you can have virtual servers and failover running at the same time. It sounds from your post like you do? Would you mind sharing your script as a starting point? It would be appreciated, thanks! Brian From mdame at mfm.com Fri Dec 14 22:52:34 2007 From: mdame at mfm.com (Mark T. Dame) Date: Fri, 14 Dec 2007 17:52:34 -0500 Subject: Can piranha failover all ethernet interfaces? In-Reply-To: <4754870C.4050901@vfive.com> References: <47506240.3060202@vfive.com> <475426AD.9020000@mfm.com> <4754870C.4050901@vfive.com> Message-ID: <47630932.8060309@mfm.com> Brian Ghidinelli wrote: > > Mark T. Dame wrote: >> 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: > > Mark, thanks for the response. So, if the heartbeat goes down which > causes the external interface to be brought up on the standby, the > failover will simultaneously be triggered and can execute a script to > change the other NICs? Correct. > I have read conflicting info on whether or not you can have virtual > servers and failover running at the same time. It sounds from your post > like you do? On these servers I only have failover running. > Would you mind sharing your script as a starting point? It would be > appreciated, thanks! Attached lvs.cf and fos_failover.pl -m -- ## Mark T. Dame ## VP, Product Development ## MFM Software, Inc. (http://www.mfm.com/) "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." -- The Restaurant at the End of the Universe, Douglas Adams -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: fos_failover.pl URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: lvs.cf URL: From brian at vfive.com Sat Dec 15 16:36:58 2007 From: brian at vfive.com (Brian Ghidinelli) Date: Sat, 15 Dec 2007 08:36:58 -0800 Subject: Can piranha failover all ethernet interfaces? In-Reply-To: <47630932.8060309@mfm.com> References: <47506240.3060202@vfive.com> <475426AD.9020000@mfm.com> <4754870C.4050901@vfive.com> <47630932.8060309@mfm.com> Message-ID: <476402AA.9010808@vfive.com> Mark, Many thanks - I'll check these out. I tried out Keepalived in the mean time and it seems to work well although ultimately I'd like to use the stock RHEL goodies. It doesn't seem as though Redhat really promotes it though but I'll try this in my test setup. Thanks!! Brian Mark T. Dame wrote: > Brian Ghidinelli wrote: >> >> Mark T. Dame wrote: >>> 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: >> >> Mark, thanks for the response. So, if the heartbeat goes down which >> causes the external interface to be brought up on the standby, the >> failover will simultaneously be triggered and can execute a script to >> change the other NICs? > > Correct. > > >> I have read conflicting info on whether or not you can have virtual >> servers and failover running at the same time. It sounds from your >> post like you do? > > On these servers I only have failover running. > > >> Would you mind sharing your script as a starting point? It would be >> appreciated, thanks! > > Attached lvs.cf and fos_failover.pl > > > -m > > > ------------------------------------------------------------------------ > > _______________________________________________ > Piranha-list mailing list > Piranha-list at redhat.com > https://www.redhat.com/mailman/listinfo/piranha-list > > !DSPAM:2,47630970271081939311634!