Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jul 2000 09:49:07 +1000 (EST)
From:      Colin Campbell <sgcccdc@citec.qld.gov.au>
To:        isp@FreeBSD.ORG
Subject:   Re: Re[2]: load balancing
Message-ID:  <Pine.BSF.4.21.0007100913120.96648-100000@guru.citec.qld.gov.au>
In-Reply-To: <13990135708.20000707183631@buz.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 7 Jul 2000, Gabriel Ambuehl wrote:


> I'm very interested in hearing such a solution. The point where we're
> failing here is the following one: one SERVICE (not the complete box)
> of the box goes down. IP itself stays up. Now the hotspare should jump

If a service on a box goes down

1) try to restart it a number of times
2) shutdown the machine if #1 fails

This alleviates the second box from having to try and shutdown the first
box.

One method for "load balancing" that impressed me was using ip aliases
bound to lo0 and running all services on all boxes. Warning, ascii art
follows:

              |
              |
            router
              |
              |
      -------------------- 10.0.1.0
         |         |
         |         |
       host1     host2

Say we want to run services on a.b.c.1..20.

Configure both host1 and host2 as follows:

lo0:1 = a.b.c.1
lo0:2 = a.b.c.2
   .
   .
lo0:20 = a.b.c.20

Now you have to run dynamic routing (eg OSPF) between the router and the
two hosts. The two hosts advertise routes to all lo0:* addresses to the
router. For load balancing you just change the weight of the routes. For
example:

host1 advertises a.b.c.1 with weight 10 and
host2 advertises a.b.c.1 with weight 20

By default the router will always select host1 for the service running on
a.b.c.1. If the service goes down and cannot be restarted, you need to
tell the router that host2 is now a better way to get to a.b.c.1. All you
need do is make the weight via host1 higher than via host2 and the router
will automatically switch ttaffic to host2.

If host1 dies, the router protocol will automatically detect the fact and
switch all traffic that was going to host1 to host2.

Colin






To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0007100913120.96648-100000>