we plan to set up a web site with two web servers.
The two servers should be under the same domain
name. Normally, web surfing load should be
distributed between the servers. when one server
fails, the other server should take all of load
automatically. When fault sever recovers, load
balancing should be achived automatically.There is no
buget for load balancer.
we plan to use DNS to balance load between the two
servers. But, it seems DNS based solution could not
direct all load to one server automatically when the
other is down.
NANOG really isn't the forum for this kind of conversation.
That said, look into devices like Alteons, or open source solutions like Balance-NG. Even Apache can be used for this with something like mod_proxy. Good luck.
The approach described in <http://www.nanog.org/mtg-0505/abley.cluster.html > would probably work, so long as the routers choosing between the ECMP routes are able to make route selections per flow, and not just per packet (e.g. "ip cef" on a cisco).
Tony Kapela did a lightning talk a few meetings ago about another cisco-specific approach which used some kind of SLA-measuring cisco feature to do the same thing without needing to run a routing protocol on a server. I can't seem to find a link to the details, but if someone else knows where it is it'd be good to know.
The approach described in
<http://www.nanog.org/mtg-0505/abley.cluster.html
> would probably work, so long as the routers choosing between the
ECMP routes are able to make route selections per flow, and not just
per packet (e.g. "ip cef" on a cisco).
Tony Kapela did a lightning talk a few meetings ago about another
cisco-specific approach which used some kind of SLA-measuring cisco
feature to do the same thing without needing to run a routing protocol
on a server. I can't seem to find a link to the details, but if
someone else knows where it is it'd be good to know.
One option might be to run two instances of VRRP/CARP across the hosts.
You have Host A being the primary/master for one IP address that's in
your DNS, and Host B being the primary/master for the other IP addess
that's in your DNS. Host A is the secondary/backup for the IP address
normally owned by Host B and Host B is the secondary/backup for the IP
address normally owned by Host A. When, for example, Host A fails, Host
B takes over being the primary/master for both IP addresses in your
DNS, giving you your continued availability. If you want make that fail
over transparent to load, you'd need to keep the load on the hosts <50%
under normal, non-fail circumstances.
I understand you have no budget for a comercial load balancer; however, you should consider setting up two inexpensive servers or PCs as load balancers. You could do it with one, but that would itself be a single point of failure. The OS and software are all free. Two old PCs would be next to free. Heck, two bottom of the line new servers would only cost $2K--$3K total.
The How To documentation is short and sweet (there is a full how to, and a mini how to) http://www.austintek.com/LVS/LVS-HOWTO/ . I've been running a cluster of 12 web servers for almost 5 9s for 6 years now based off this stuff. You can take a server down for maintenance and nobody notices.