Mod_rewrite using load balanced
APACHE mode_rewrite read the document, referred to rewrite some of the methods used to achieve load balance method, the record.
Load balanced
- Description:
How to balance
www.foo.comload towww[0-5].foo.comtotal of 6 server)?- :
There are many issues that may be the solution here, we discussed what is known as the "based on DNS (DNS-based)" program, and special use
mod_rewriteprogram:- DNS cycle (DNS Round-Robin)
The easiest way is to use
BINDfor DNS characteristics of the cycle, as long as the practice set upwww[0-9].foo.comthe DNS of the A (address) records, such as:www0 IN A 1.2.3.1 www1 IN A 1.2.3.2 www2 IN A 1.2.3.3 www3 IN A 1.2.3.4 www4 IN A 1.2.3.5 www5 IN A 1.2.3.6
Then, add the following:
www IN CNAME www0.foo.com. IN CNAME www1.foo.com. IN CNAME www2.foo.com. IN CNAME www3.foo.com. IN CNAME www4.foo.com. IN CNAME www5.foo.com. IN CNAME www6.foo.com.
Note that the above may seem wrong, but a matter of fact, it is
BINDa desired characteristics, but also can be used. In any case, nowwww.foo.comresolution hasBINDBIND can be givenwww0-www6though each will be on the order of the minor replacement / cycle, the client's request can be distributed among the various servers. However, this is not a good load balancing because, DNS resolution information can be the name of the other network server buffer, and oncewww.foo.comfor the resolution waswwwN.foo.comwhile its follow-up request will be sent to Towww.foo.comBut the end result is correct, because the request was indeed the total distributed to the various servers
- DNS cycle (DNS Round-Robin)

































