The first two days added a server to a customer. Jointly undertake the operation of a forum. But. To achieve load balancing. It's a difficult thing.
I've tried a couple of ways before,
One, the DNS rotation. Advantages: Simple implementation. Disadvantage: Unable to detect the load on each server. It is difficult to control the visitor's access address (the general DNS server has caching, so.) Effect is not obvious)
Second, the foreground procedure. A service program similar to Zeus Load balancer was used. Receive an access request at the foreground. And then streaming to each of the actual servers.
But the above two methods are not very suitable for my situation.
The first kind. Unable to properly allocate visitor traffic ... There is a large load of a server that often occurs. And the other one is very low ...
The second kind. will consume more traffic. Resources are also taking up large.
Best. I have also adopted a DNS balanced load method---lbname.
Its main effect is introduced:
A Perl-based DNS server. Application is simple.
Second, automatically detect the load of each server. DNS resolution is then prioritized by result.
Third, the DNS resolution takes effect immediately. Will not be cached by the DNS server.
Four, the installation method is simple ...
Lbname Web Page Introduction
Http://www.stanford.edu/~schemers/docs/lbnamed/lbnamed.html
http://www.stanford.edu/~riepel/lbnamed/
。
。
Download:
Http://www.stanford.edu/~riepel/lbnamed/lbnamed-1.2.1.tar.gz
Http://www.stanford.edu/~schemers/dist/lb.tar
.
.
Download Package Description:
Memory several directories
1) LBCD source code .... LBCD is the server-side test server load program used by lbnamed. Every server that needs a balanced load needs to install, run it ...
The recommended download uses the latest LBCD compilation package. Http://www.stanford.edu/~riepel/lbnamed/lbcd-3.1.0.tar.gz are often compiled incorrectly. (This is also available.) Hey. )
When compiling this package. Often goes wrong. How to install successfully. It depends on your ability. (Edit util.c Line 123th.) In front Plus//)
After the compilation LBCD succeeded. Copy it to/usr/sbin. Then you can run it. You don't have to add any parameters. (after running to stop it is lbcd-s)
2 lbnamed Server program Perl. is divided into two versions. One is PERL4. The other is perl5. I use PERL5. So use it to illustrate.
Enter PERL5 directory ... First, configure the lbnamed and Poller programs.
Explain:
The lbnamed program is the main program. Provides DNS dynamic resolution. Strictly speaking. It is already a DNS server-side program.
Poller is the load situation for the lbnamed to provide each balancing server. (in conjunction with the LBCD program we installed earlier)
But all two programs may need to be changed, look at the Perl program address in the first line of the program ... Change to your Perl address.
Then you need to change the configuration file for the program.