The advantages and disadvantages of the three load balancing methods for tomcat cluster are compared with each other.

Source: Internet
Author: User
Tags config net win32 tomcat tomcat server advantage
1. Use DNS polling. 2. Use the Apache R-proxy method. 3. Use Apache Mod_jk method. The disadvantage of  dns polling is that when a server in the cluster is stopped, the user cannot access the service because of DNS caching, and must wait until the DNS resolution update or the server restarts. There is a cluster must be all the service ports exposed to the outside world, did not use Apache to do the way the front agent security, and occupy a large number of public network IP address, and Tomcat is responsible for processing static web resources, affecting efficiency. The advantage is that the cluster configuration is the simplest and the DNS settings are simple. The disadvantage of  r-proxy is that when one of the tomcat stops running, Apache still forwards the request to the past, causing a 502 gateway error. However, this problem does not exist as long as the server is restarted. The advantage of the  MOD_JK approach is that Apache automatically detects the stopped Tomcat and then sends no more requests to the past. The disadvantage is that when the stopped Tomcat server starts again, Apache does not detect it, and it still does not forward requests to the past. The common advantage of  r-proxy and MOD_JK is that. You can only put Apache on the public network, save the public network IP address resources. This can be done by setting up Apache to handle static Web pages specifically, so that Tomcat is specifically responsible for dynamic requests such as JSP and servlet. The common disadvantage is that all cluster services will not be available externally if the Apache proxy server is stopped. R-proxy and MOD_JK processing of static page requests can be set to select an effect that optimizes as much as possible. These three ways to achieve the optimal load balance are certain deficiencies, mod_jk relatively better, you can set the Lbfactor parameters to assign the request task.   All of these should be selected in the light of the situation in practical use. Briefly configured as follows: Pre-preparation: 1. Download Apache and Tomcat:apache2.0.53:http://www.eu.apache.org/dist/httpd/binaries/win32/apache_2.0.53-win32-x86-no_ ssl.msi tomcat5.5.9:http://www.eu.apache.org/dist/jakarta/tomcat-5/v5.5.9/bin/ jakarta-tomcat-5.5.9.ziphttp://www.eu.apache.org/dist/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9-fulldocs.tar.gzhttp://www.eu.apache.org/dist/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9-compat.ziphttp ://www.eu.apache.org/dist/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9-admin.zip mod_jk.sohttp:// www.eu.apache.org/dist/jakarta/tomcat-connectors/jk/binaries/win32/jk-1.2.8/mod_jk-1.2.8-apache-2.0.52.so (Optional, Because the Apache2.0.53 has been brought up by itself.   2. Configure Tomcat clusters. At the same time the release has Clusterapp this Web application, modify test.jsp, make open: http://192.168.9.235:12080/clusterapp/test.jsp and http:// 192.168.9.226:12080/clusterapp/test.jsp see a different page effect.  3. Install Apache2.0.53.   At this point the Tomcat Cluster Server is: 192.168.9.226:12080 and 192.168.9.235:12080  edit c:/windows/system32/drivers/etc/host files, The last line plus 127.0.0.1   lizongbo.com first to r-proxy the way. Next is the MOD_JK way. Restart Apache, also open http://lizongbo.com/clusterapp/test.jsp constantly refresh this page, will also see the page display a different content. Reference: Tomcat cluster:http://www.onjava.com/onjava/2004/04/14/examples/tomcatclustering.ziphttp://www.onjava.com/ Pub/a/onjava/2004/11/24/replication1.htmlhttp://www.onjava.com/pub/a/onjava/2004/11/24/replication1. html?page=2http://www.onjava.com/pub/a/onjava/2004/04/14/clustering.htmlhttp://www.onjava.com/pub/a/onjava/ 2004/04/14/clustering.html?page=2r-proxy:http://www.douzhe.com/docs/apachemanual/mod/mod_proxy.html# proxypassreversehttp://www.douzhe.com/docs/apachemanual/mod/mod_rewrite.html#rewritemaphttp://www.douzhe.com/ docs/apachemanual/mod/mod_rewrite.html#rewriterule mod_jk: http://jakarta.apache.org/tomcat/ connectors-doc/config/apache.htmlhttp://jakarta.apache.org/tomcat/connectors-doc/config/workers.htmlhttp:// jakarta.apache.org/tomcat/connectors-doc/common/ajpv13a.htmlhttp://www.mail-archive.com/ tomcat-user@jakarta.apache.org/msg146787.html   relatively outdated data (since MOD_JK2 methods have not been recommended, MOD_JK2 is no longer updated): http:// Www.sentom.net/list.asp?id=14http://www.linuxforum.net/docnew/showthreaded.php? cat=&board=server&number=507&page=1&view=collapsed&sb=5&o=all&fpart=http:// Www.ecoo.net/list.asp?articleid=2311http://www.linuxaid.com.cn/forum/showdoc.jsp?l=1&i=81013&m=0http://search.csdn.net/expert/topicview1.asp?id=1706745http://www.chinaitlab.com/www/news/article_ show.asp?id=11921   may be useful information: (because I haven't looked at it carefully)  http://www.phpv.net/article.php/92 http:// raibledesigns.com/tomcat/ http://www.crazysquirrel.com/debian/tomcat55.php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.