[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Load balancing/failover



On Wed, 2 Oct 2002, Daniel Hartmeier wrote:
> Another point is how this deals with #Ip1 going down. Should any part of
> pf (in kernel?) monitor (or even probe) the targets and modify the list
> automatically? Or would you want a userland daemon to do that? Or do it
> manually completely?
Just write an userland daemon that monitors all the IPs and change the
PF rule to remove the IP of servers that go down and later add it again.
Just copy the behaviour IPFilter has. Described in the old ipnat(5)
LOAD-BALANCING
       Two options for use with  rdr  are  available  to  support
       primitive,  round-robin  based  load balancing.  The first
       option allows for a rdr to specify a  second  destination,
       as follows:
       rdr le0 203.1.2.3/32 port 80 -> 203.1.2.3,203.1.2.4 port 80 tcp
       This  would send alternate connections to either 203.1.2.3
       or 203.1.2.4.  In scenarios where the load is being spread
       amongst a larger set of servers, you can use:
       rdr le0 203.1.2.3/32 port 80 -> 203.1.2.3,203.1.2.4 port 80 tcp round-robin
       rdr le0 203.1.2.3/32 port 80 -> 203.1.2.5 port 80 tcp round-robin
       In   this   case,  a  connection  will  be  redirected  to
       203.1.2.3, then 203.1.2.4 and then 203.1.2.5 before  going
       back  to  203.1.2.3.   In  accomplishing this, the rule is
       removed from the top of the list and  added  to  the  end,
       automatically, as required.  This will not effect the dis-
       play of rules using "ipnat -l", only the internal applica-
       tion order.
Cheers,
Dries
-- 
Dries Schellekens
email: gwyllion@ulyssis.org