Download presentation
Presentation is loading. Please wait.
1
Load Balance of Tomcat with Apache by George Fu, UCCS CS 526 Semester Project Spring 2009
2
Outline Our webserver system introduction HTTP Load balancing on Solaris The work I did Future work Conclusions References
3
Our Current Web Servers on Solaris Client Internet
4
Problems No Load Balance Single Point of Failure No Transparent Failover and Failback No Scalability Performance Low Availability
5
Resolutions on Solaris Hardware based load balancing Reverse proxy:mod_proxy, mod_jk, mod_cluster Load balancing appliance (Juniper, Cisco…) Tomcat balancer application DNS load balancing (Round Robin)
6
Mod_Cluster Blancer Allows httpd to act as a load balancer in front of Tomcat based-based webservers JBoss Product Very little configuration on the httpd side Main calculations done on the backend servers Backend server dynamic configuration No more workers.properties
7
Mod_Proxy Blancer Part of mod_proxy New in Apache HTTP Server 2.2 Two load balancing methods –By number of requests –By number of bytes Detects failed backends
8
Apache mod_proxy Configuration Listen 80 LogLevel debug TransferLog logs/access_log LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so ProxyPass / balancer://mycluster/ ProxyPassReverse / http://1.2.3.4:80 ProxyPassReverse / http://1.2.3.5:80 BalancerMember http://1.2.3.4:80 BalancerMember http://1.2.3.5:80
9
Tomcat and mod_jk Apache + mod_jk Multiple tomcat servers Balancer worker Very easy to do
10
Apache Worker-Properties File worker.list=loadbalancer worker.tomcat1.port=18081 worker.tomcat1.host=localhost worker.tomcat1.type=ajp13 worker.tomcat1.lbfactor=1 worker.tomcat2.port=28081 worker.tomcat2.host=localhost worker.tomcat2.type=ajp13 worker.tomcat2.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=tomcat1, tomcat2 worker.loadbalancer.method=Busyness
11
Apache httpd.conf File JkMount /jsp-examples loadbalancer JkMount /jsp-examples/* loadbalancer
12
Tomcat server.xml File with: <Server port="8009" with: <Server port="18081"
13
Our Webservers with Load Balancer
14
Future Work Problem: Single point of failure DNS round-robin No work at the server side Multiple records in DNS zone file
15
Example DNS Zone File scalingout.org. 86400 IN SOA ns.scalingout.org. sctemme.scalingout.org. ( 2006051401 ; Serial 86400 ; refresh (1 day) 7200 ; retry (2 hours) 8640000 ; expire (10 days) 86400 ) ; minimum (1 day) scalingout.org. IN NS bagheera.scalingout.org. gw IN A 10.11.0.1 bagheera IN A 10.11.0.2 ;... mail IN CNAME bagheera ns IN CNAME bagheera www IN A 10.11.0.113 IN A 10.11.0.114 IN A 10.11.0.115
16
DNS Round-Robin :
17
Conclusions Apache/Tomcat load balancing is easy No dedicated balancer machine is needed For better performance, mod_cluster can be used
18
References Aveneet Manget, Load-balancing Tomcat with Apache, 2008 http://www.theserverside.com/tt/knowledgecenter/know ledgecenter.tss?l=LoadBalancingTomcatApache Web http://www.theserverside.com/tt/knowledgecenter/know ledgecenter.tss?l=LoadBalancingTomcatApache Web Brain Stansberry, A new httpd-based load balancer http://www.jugs.ch/html/events/slides/090313_BrianStansberry_ mod-cluster-jug.pdf http://www.jugs.ch/html/events/slides/090313_BrianStansberry_ mod-cluster-jug.pdf Apacheand Tomcat load balancing http://confluence.atlassian.com/display/DOC/Apache+and+Tom cat+load+balancing http://confluence.atlassian.com/display/DOC/Apache+and+Tom cat+load+balancing
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.