Webapplication Load Balancing

2,338 views
2,239 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,338
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
54
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Webapplication Load Balancing

  1. 1. High Availability & Load Balancing Apache 2.2 & Tomcat 6.0 Gowrisankar Narayana MCA, SCJP, SCWCD gowrisankar.narayana@gmail.com
  2. 2. Presentation Format  High availability  Load balancing  The Perfect Match - Apache 2.2 & Tomcat 6.0  Introduction to Horizontal & Vertical Scaling  HA and LB Practical Example  Live Demo  Q&A
  3. 3. High Availability Application is deployed in each of these nodes Server Internet Users Server enables seamless failover and state management Nodes System is always ready and available to serve users. Tolerates and overcomes faults and continues operating normally in the event of failure of some of its components. If the system experiences a failure, it continues to operate without interruption during the repair process.
  4. 4. Load Balancing All these nodes will be used under heavy load. Work is distributed and allotted by the server Server Request 1 Request 1 Request N Internet Request N Request 2 More Users Distributes work across all nodes Nodes Load is distributed evenly across all the available nodes. The node server ensures no node is overloaded and no node is too idle. More nodes can be added without downtime or interruption.
  5. 5. The Perfect Match - Apache 2 & Tomcat 6 APACHE 2 HTTP Server Tomcat 6 Nodes/ Instances Apache is free & open source. Designed to provide a balance of flexibility, portability, and performance. Apache is the first web server software to surpass the 100 million web site milestone, so its the most-used Web server software package on the earth. Tomcat 6 is an open source servlet container developed by the Apache Software Foundation.
  6. 6. Horizontal and Vertical Scaling Vertical Scaling: (Otherwise known as scaling up) means to add more hardware resources to the same machine, generally by adding more processors and memory. • Expensive • Easy to implement • Single point of failure Horizontal Scaling: (Otherwise known as scaling out) means to add more machines into the mix, generally cheap commodity hardware. • Cheaper - at least more linear expenditures • Hard to implement • Many points of failure and therefore can usually handle failures elegantly
  7. 7. Live Example
  8. 8. Apache Proxy Configuration ProxyRequests On <Location /balancer-manager> SetHandler balancer-manager Order Allow,Deny Allow from all </Location> <Proxy balancer://ajpCluster> Order Allow,Deny Allow from all BalancerMember ajp://localhost:8209/app loadfactor=1 BalancerMember ajp://localhost:8109/app status=+h ProxySet lbmethod=bytraffic ProxySet stickysession=JSESSIONID </Proxy> ProxyPreserveHost on ProxyPass /app balancer://ajpCluster/ stickysession=JSESSIONID ProxyPassReverse /app balancer://ajpCluster/ stickysession=JSESSIONID
  9. 9. Tomcat Configuration – Two Instances <Server port="8101"shutdown="SHUTDOWN"> <GlobalNamingResources> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can beupdated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <Service name="Catalina"> <!--Define an HTTP/1.1 Connector --> <Connector port="8180" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!--Define an AJP 1.3 Connector --> <Connector port="8109" packetSize="20000" protocol="AJP/1.3" redirectPort="8443" /> ... </Service> </Server> <Server port="8201"shutdown="SHUTDOWN"> <GlobalNamingResources> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can beupdated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <Service name="Catalina"> <!--Define an HTTP/1.1 Connector --> <Connector port="8280" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!--Define an AJP 1.3 Connector --> <Connector port="8209" packetSize="20000" protocol="AJP/1.3" redirectPort="8443" /> ... </Service> </Server>
  10. 10. Live Demo The Load Balancer Manager Interface : http://livedemo.opencampaign.co.uk/balancer-manager Load Balancer Manager At Work: http://livedemo.opencampaign.co.uk
  11. 11. Q&A You can always contact me with your suggestions and comments gowrisankar.narayana@gmail.com 07850151413

×