I'm new to load balancing and I'm wondering if it's possible to use multiple load balancers to redirect traffic to my application servers. I don't really understand how this can be done. Shouldn't a domain name match one to one with a certain server's IP address (in this case the IP of one load balancer)? If each load balancing server has a different IP, how can the request be received by both load balancers (or by 10 load balancers or 50 or 100)?
Using round robin DNS is not that great for high availability - if one server goes offline, clients will still try to connect to it and wait for a timeout.
There are other ways to achieve this.
1) Active/Passive load balancers
Basically one load balancer handles all traffic for one IP address.
If that balancer goes down, the passive node jumps in and takes over the IP.
Keep in mind that load balancers are pretty much only forwarding traffic, so for small to medium sized sites this can work out OK.
2) Active/Active load balancers
The same traffic IP is configured on both (or many more) load balancers.
Incoming traffic gets sent to all load balancers but a algorithm chooses which balancer should respond, all others discard that traffic.
Simple way to think of it, you have two load balancers:
When the requesting IP ends with an even number then load balancer A answers, otherwise load balancer B answers.
Of course your infrastructure must support this and there is overhead due to traffic getting sent but discarded.
More information, e.g. here: http://community.brocade.com/t5/SteelApp-Docs/Feature-Brief-Deep-dive-on-Multi-Hosted-IP-addresses-in-Stingray/ta-p/73867
High Availability with load balancers is commonly implemented using a virtual ip address (VIP) protocol which allows several hosts (i.e. load balancers) to answer to one common ip address in one of several possible ways (variations on active/passive, active/active).
There are a good number of these protocols, the ones I have seen most with regular load balancers are VRRP and NLB (as well as a good many nondescript blackboxed protocols in appliances). Expanding to routers and firewalls one may also encounter CARP, HRSP, GLSP for instance.
This strategy has a number of benefits over DNS load balancing which is a simpler strategy (and which is taken care of in another answer).
DNS load balancing is burdened for instance with:
- the slow turnover of dns caching mechanisms
- limited load balancing algorithms (typically just round-robin)
- the outsourcing of the load balancing decision to the client (through caching of the dns record)
- Slow drain of service queues when a server (i.e. a load balancer) is taken out of rotation (based on dns record TTLs as handled by ISPs and clients)
- Slow failover on load balancer failure
Using a virtual ip protocol for HA one may have a choice to achieve for instance:
- Choice of load balancing algorithm amongst the load balancers
- Server centric load balancing decisions (fascilitating for example service health based measures and routing)
- Quicker drain of service queues when a load balancer is taken out of rotation.
- Instant failover on load balancer failure
Only you know which strategy and protocol fits your scenario best.