From owner-freebsd-isp Sun Jul 9 16:49:24 2000 Delivered-To: freebsd-isp@freebsd.org Received: from inet03.citec.qld.gov.au (inet03.citec.qld.gov.au [203.5.10.10]) by hub.freebsd.org (Postfix) with ESMTP id 4AC5637B631 for ; Sun, 9 Jul 2000 16:49:18 -0700 (PDT) (envelope-from sgcccdc@citec.qld.gov.au) Received: by inet03.citec.qld.gov.au; id JAA16104; Mon, 10 Jul 2000 09:49:15 +1000 (EST) Received: from guru.citec.qld.gov.au( 147.132.152.220) by inet03.citec.qld.gov.au via smap (V2.0) id xma015956; Mon, 10 Jul 00 09:49:08 +1000 Received: from localhost (sgcccdc@localhost) by guru.citec.qld.gov.au (8.9.3/8.9.3) with ESMTP id JAA97630 for ; Mon, 10 Jul 2000 09:49:07 +1000 (EST) (envelope-from sgcccdc@citec.qld.gov.au) X-Authentication-Warning: guru.citec.qld.gov.au: sgcccdc owned process doing -bs Date: Mon, 10 Jul 2000 09:49:07 +1000 (EST) From: Colin Campbell To: isp@FreeBSD.ORG Subject: Re: Re[2]: load balancing In-Reply-To: <13990135708.20000707183631@buz.ch> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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