Subject: Re: Load Balancer & Real Time Content
To: None <zafer@gmx.org>
From: Mipam <mipam@ibb.net>
List: netbsd-users
Date: 08/06/2004 10:24:12
> Hello Newsgroup,

>I have the order to set up some kind of web-server which is fail-safe and
>fast at once.

>I though about setting up 3 machines with the same content, with a
>load-balancer infront, which is a ipf rule like:
 
>rdr ex1 20.20.20.5/32 port 80 -> 192.168.0.5, 192.168.0.6, 192.168.0.7 
>port 8000

>Though, the problem i'm thinking about is, how do i get the machines in 
>sync all the time? 
>I mean, if an Editor changes some Websites, how does the other both 
>machines notice the change and synchronize?

>I thought about rsync in a crontab once a day, but that is fair not fast
>enough. Is there a way of "real-time" syncing ? with the aspect of 
>fail-proof, if one machine get down.

Nice issue indeed, the apache servers in my case ask the states and 
sessions from eachother in order to deal with dynamic sites and other 
stuff. In pf you can use the sticky bit to assure sessions from an ip are 
redirected to one machine. So you could consider to have the apache 
daemons sync with eachother about states and stuff.
Right now you could try like

rdr ex1 20.20.20.5/32 port 80 -> 192.168.0.5 port 8000 tcp round-robin
rdr ex1 20.20.20.5/32 port 80 -> 192.168.0.6 port 8000 tcp round-robin
rdr ex1 20.20.20.5/32 port 80 -> 192.168.0.7 port 8000 tcp round-robin

And when a server goes down, outcomment a line and reload ipf. :-)
I am not aware if ipf has a mechanism to see no ansers comming back 
anymore from a machine and rdr connections to that machine to another.
However, if those machines are not aware about eachothers states 
and sessions such a thing wouldnt be usefull anyway.
I might be wrong about ipf in this, maybe other can correct me if so?
Bye,

Mipam.