RE: HAProxy and FreeBSD CARP failover
With carp, the IP address should already be bound to the spare server, just not active. If you check the status of CARP on the main server, it should list that IP as active and on the backup server as backup. Might want to verify your configs in CARP. Travis From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: Thursday, July 23, 2009 5:13 PM To: haproxy@formilux.org Subject: HAProxy and FreeBSD CARP failover Hi list. I'd like to set up a redundant HAProxy server using CARP failover in FreeBSD so the spare server will automatically snatch up the "listen" IP and balance out our server farm. I can get HAProxy configured, but it won't actually start unless the IP is already bound to the box. Suggestions? (latest haproxy-devel from FreeBSD ports) ---Daniel
Re: HAProxy and FreeBSD CARP failover
On Thu, Jul 23, 2009 at 05:44:09PM -0800, Daniel Gentleman wrote: > Good idea! I can have the external IP of the domain redirected (with > FreeBSD's pf rules) to an internal IP then have HAProxy bind to that internal > IP. If the external IP fails over to that second box, HAProxy should already > be running. I'll test and report the results. If FreeBSD does not allow you to bind to a non-local IP, I would suggest that you try a different method instead : - configure both of your servers with same IP aliases - configure your router, firewall or whatever to route those aliases via the CARP address. It's a common way to handle large amounts of virtual IPs without having to announce them all. In your case, it allows both servers to have their daemons bound to the service IPs. And BTW, if you're sure FreeBSD does not allow you to bind to a non-local IP, I think you should ask for a feature request. This should be almost nothing to do, basically just a condition to add to an existing "if" in the source code, so maybe they will add it for future releases. Regards, Willy
Re: HAProxy and FreeBSD CARP failover
I don¹t know if it works on BSD, but if so, use Heartbeat instead. It can be configured to run whatever you want when one machine takes over.. So you could have it kill(because you might have auto fail back enabled) then start haproxy after it takes the IP. Maybe CARP can do the same thing? Paul K. Dickson Systems Administrator Frederick County Government, IIT pdick...@fredco-md.net 301-600-2399/x12399 From: Daniel Gentleman Date: Thu, 23 Jul 2009 14:12:31 -0800 (GMT-08:00) To: Subject: HAProxy and FreeBSD CARP failover Hi list. I'd like to set up a redundant HAProxy server using CARP failover in FreeBSD so the spare server will automatically snatch up the "listen" IP and balance out our server farm. I can get HAProxy configured, but it won't actually start unless the IP is already bound to the box. Suggestions? (latest haproxy-devel from FreeBSD ports) ---Daniel
RE: HAProxy and FreeBSD CARP failover
Daniel, Just for some inspiration: I run FreeBSD 7.2 with carp. For one setup I have 2 balancers with one carp address, so in an active-passive setup. For another setup, I have 4 balancers, each with multiple carp address, doing active-active ha+lb (using DNS round robin). For both projects, I run Squid on each node (which listens on the public ip's at port 80 and 443), and then I run haproxy on the same machine with hundreds of sites, listening on 127.0.0.1:8001, 127.0.0.2:8002, etc.. Works like a charm! And I run apache on the same node to show a nice error message when no backend application server is available for a specific site. -- With kind regards, Angelo Höngens Systems Administrator -- NetMatch tourism internet software solutions Ringbaan Oost 2b 5013 CA Tilburg T: +31 (0)13 5811088 F: +31 (0)13 5821239 mailto:a.hong...@netmatch.nl http://www.netmatch.nl -- From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: vrijdag 24 juli 2009 3:44 Cc: haproxy@formilux.org Subject: Re: HAProxy and FreeBSD CARP failover Good idea! I can have the external IP of the domain redirected (with FreeBSD's pf rules) to an internal IP then have HAProxy bind to that internal IP. If the external IP fails over to that second box, HAProxy should already be running. I'll test and report the results. Thanks! ---D - Original Message - From: "John Lauro" To: "Daniel Gentleman" Cc: haproxy@formilux.org Sent: Thursday, July 23, 2009 5:05:52 PM GMT -08:00 US/Canada Pacific Subject: RE: HAProxy and FreeBSD CARP failover At least with linux this is possible, but I assume FreeBSD can do it too… You could use firewall rules to map static map the connection for a specific host/port to a local always present (even 127.0.0.1) IP and use different local ports for each host. From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: Thursday, July 23, 2009 6:30 PM Cc: haproxy@formilux.org Subject: Re: HAProxy and FreeBSD CARP failover Good idea except ... that HAProxy server load-balances for a couple different sites :( - Original Message - From: "John Lauro" To: "Daniel Gentleman" , haproxy@formilux.org Sent: Thursday, July 23, 2009 3:23:06 PM GMT -08:00 US/Canada Pacific Subject: RE: HAProxy and FreeBSD CARP failover Only bind to the port so it doesn’t matter if additional addresses are added or removed. From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: Thursday, July 23, 2009 6:13 PM To: haproxy@formilux.org Subject: HAProxy and FreeBSD CARP failover Hi list. I'd like to set up a redundant HAProxy server using CARP failover in FreeBSD so the spare server will automatically snatch up the "listen" IP and balance out our server farm. I can get HAProxy configured, but it won't actually start unless the IP is already bound to the box. Suggestions? (latest haproxy-devel from FreeBSD ports) ---Daniel Checked by AVG - www.avg.com Version: 8.5.375 / Virus Database: 270.13.20/2248 - Release Date: 07/22/09 18:00:00 Checked by AVG - www.avg.com Version: 8.5.375 / Virus Database: 270.13.20/2248 - Release Date: 07/22/09 18:00:00
Re: HAProxy and FreeBSD CARP failover
Good idea! I can have the external IP of the domain redirected (with FreeBSD's pf rules) to an internal IP then have HAProxy bind to that internal IP. If the external IP fails over to that second box, HAProxy should already be running. I'll test and report the results. Thanks! ---D - Original Message - From: "John Lauro" To: "Daniel Gentleman" Cc: haproxy@formilux.org Sent: Thursday, July 23, 2009 5:05:52 PM GMT -08:00 US/Canada Pacific Subject: RE: HAProxy and FreeBSD CARP failover At least with linux this is possible, but I assume FreeBSD can do it too… You could use firewall rules to map static map the connection for a specific host/port to a local always present (even 127.0.0.1) IP and use different local ports for each host. From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: Thursday, July 23, 2009 6:30 PM Cc: haproxy@formilux.org Subject: Re: HAProxy and FreeBSD CARP failover Good idea except ... that HAProxy server load-balances for a couple different sites :( - Original Message - From: "John Lauro" To: "Daniel Gentleman" , haproxy@formilux.org Sent: Thursday, July 23, 2009 3:23:06 PM GMT -08:00 US/Canada Pacific Subject: RE: HAProxy and FreeBSD CARP failover Only bind to the port so it doesn’t matter if additional addresses are added or removed. From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: Thursday, July 23, 2009 6:13 PM To: haproxy@formilux.org Subject: HAProxy and FreeBSD CARP failover Hi list. I'd like to set up a redundant HAProxy server using CARP failover in FreeBSD so the spare server will automatically snatch up the "listen" IP and balance out our server farm. I can get HAProxy configured, but it won't actually start unless the IP is already bound to the box. Suggestions? (latest haproxy-devel from FreeBSD ports) ---Daniel Checked by AVG - www.avg.com Version: 8.5.375 / Virus Database: 270.13.20/2248 - Release Date: 07/22/09 18:00:00 Checked by AVG - www.avg.com Version: 8.5.375 / Virus Database: 270.13.20/2248 - Release Date: 07/22/09 18:00:00
RE: HAProxy and FreeBSD CARP failover
At least with linux this is possible, but I assume FreeBSD can do it too… You could use firewall rules to map static map the connection for a specific host/port to a local always present (even 127.0.0.1) IP and use different local ports for each host. From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: Thursday, July 23, 2009 6:30 PM Cc: haproxy@formilux.org Subject: Re: HAProxy and FreeBSD CARP failover Good idea except ... that HAProxy server load-balances for a couple different sites :( - Original Message - From: "John Lauro" To: "Daniel Gentleman" , haproxy@formilux.org Sent: Thursday, July 23, 2009 3:23:06 PM GMT -08:00 US/Canada Pacific Subject: RE: HAProxy and FreeBSD CARP failover Only bind to the port so it doesn’t matter if additional addresses are added or removed. From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: Thursday, July 23, 2009 6:13 PM To: haproxy@formilux.org Subject: HAProxy and FreeBSD CARP failover Hi list. I'd like to set up a redundant HAProxy server using CARP failover in FreeBSD so the spare server will automatically snatch up the "listen" IP and balance out our server farm. I can get HAProxy configured, but it won't actually start unless the IP is already bound to the box. Suggestions? (latest haproxy-devel from FreeBSD ports) ---Daniel Checked by AVG - www.avg.com Version: 8.5.375 / Virus Database: 270.13.20/2248 - Release Date: 07/22/09 18:00:00 Checked by AVG - www.avg.com Version: 8.5.375 / Virus Database: 270.13.20/2248 - Release Date: 07/22/09 18:00:00
Re: HAProxy and FreeBSD CARP failover
Good idea except ... that HAProxy server load-balances for a couple different sites :( - Original Message - From: "John Lauro" To: "Daniel Gentleman" , haproxy@formilux.org Sent: Thursday, July 23, 2009 3:23:06 PM GMT -08:00 US/Canada Pacific Subject: RE: HAProxy and FreeBSD CARP failover Only bind to the port so it doesn’t matter if additional addresses are added or removed. From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: Thursday, July 23, 2009 6:13 PM To: haproxy@formilux.org Subject: HAProxy and FreeBSD CARP failover Hi list. I'd like to set up a redundant HAProxy server using CARP failover in FreeBSD so the spare server will automatically snatch up the "listen" IP and balance out our server farm. I can get HAProxy configured, but it won't actually start unless the IP is already bound to the box. Suggestions? (latest haproxy-devel from FreeBSD ports) ---Daniel Checked by AVG - www.avg.com Version: 8.5.375 / Virus Database: 270.13.20/2248 - Release Date: 07/22/09 18:00:00
RE: HAProxy and FreeBSD CARP failover
Only bind to the port so it doesn’t matter if additional addresses are added or removed. From: Daniel Gentleman [mailto:dani...@chegg.com] Sent: Thursday, July 23, 2009 6:13 PM To: haproxy@formilux.org Subject: HAProxy and FreeBSD CARP failover Hi list. I'd like to set up a redundant HAProxy server using CARP failover in FreeBSD so the spare server will automatically snatch up the "listen" IP and balance out our server farm. I can get HAProxy configured, but it won't actually start unless the IP is already bound to the box. Suggestions? (latest haproxy-devel from FreeBSD ports) ---Daniel Checked by AVG - www.avg.com Version: 8.5.375 / Virus Database: 270.13.20/2248 - Release Date: 07/22/09 18:00:00
HAProxy and FreeBSD CARP failover
Hi list. I'd like to set up a redundant HAProxy server using CARP failover in FreeBSD so the spare server will automatically snatch up the "listen" IP and balance out our server farm. I can get HAProxy configured, but it won't actually start unless the IP is already bound to the box. Suggestions? (latest haproxy-devel from FreeBSD ports) ---Daniel