SlideShare a Scribd company logo
Apache Load Balancing :

Basic SW Requirements :
           1. java
           2. Tomcat
           3. Apache web server
           4. mod_jk

Pre-Check :
              1. Java home/path settings in environment
              2. Test and ensure tomcat instance / httpd [Apache web server] is running .

Basic Configuration:
              1. enable mod_jk in apache configuration file . Ensure in below paths and files :
                  1. /etc/httpd/modules (or) /usr/lib64/httpd/modules/
                  2./usr/libexec/
              2. need to create the following files to integrate tomcat app's with apache httpd
                  server under /etc/httpd/conf.d/.
                  1. worker.properties
                  2.uriworkermap.properties
                  3. mod_jk.conf
 worker.properties file format :

worker.list=lb,status

worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1
worker.tomcat1.redirect=tomcat2

worker.tomcat2.port=8079
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1
worker.tomcat2.redirect=tomcat1

worker.lb.type=lb
worker.lb.balance_workers=tomcat1,tomcat2
worker.lb.sticky_session=True
worker.lb.sticky_session_force=True

worker.status.type=status
worker.localhost.host=localhost

Note :
   1. while enabling LB we need to declare lb worker in worker.list [It is not workers.list]
   2. Change the native AJP port as per the infrastructure security policy in tomcat server.xml
       files . And ensure the tomcat is running on that port while running .
       [netstat -nap |grep java]
   3. update the details for each instances as per the above format .
   4. Finally declare loadbalancer with the above attributes [balance_workers[it is not
       balance_worker],sticky_session.sticky_session_force ]
   5. declaring the status worker to check the status of Load Balancing
mod_jk.conf configuration:

         LoadModule jk_module modules/mod_jk.so
         JkWorkersFile conf.d/worker.properties
         JkMountFile conf.d/uriworkermap.properties
         JkLogFile /var/log/mod_jk.log
         JkLogLevel info
         JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
         JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
         JkRequestLogFormat "%w %V %T"
         JkShmFile logs/jk.shm

Note :
         1.   1st line including the mod_jk.so with httpd
         2.   JkWorkersFile Including the worker.properties file
         3.   JkMountFile we are declaring the worker and mounting point details .
         4.   4th line saying the log file location
         5.   Other attributes saying the log formates and final line is about memory details .

uriworkermap.properties file :

         #/admin/*=lb
         #/manager/*=lb
         #/jsp-examples/*=lb
         #/servlets-examples/*=lb
         #/examples/*=lb
         #/jk-manager=status
         /* =lb
         /status =status

Note :
         Declaring the mount points with the specific worker details
         We are using with load balancing so we can declare with loadbalancer worker [lb] .
         Loadbalancer worker will take care the distribution of the load and session status

Tomcat configuration[server.xml]:

               1. we need to change the native ports in tomcat server.xml file as per the
                  requirements
                  [We have used here 8009 & 8079]
                  ex :
                  <Connector port="8009" protocol="AJP/1.3" redirectPort="8473" />
 in tomcat1
                  <Connector port="8079" protocol="AJP/1.3" redirectPort="8473" />
 in tomcat2
               2. change the jvmRoute name as per the workers declaration.
                  Ex:
                  in tomcat1
                  <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1">
                  in tomcat1
                  <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat2">
Final steps :

           1. Once done all the configuration as per the above details start the tomcat instances
              and apache server . Check the service status and log details for the information .
           2. To verify the session status in load balancing Please create index.jsp with
              identification [page color/ content different ] in $TOMCAT_HOME/webapps/ROOT/
           3. access the server in two different session and confirm the load balance status. It
              need to handle the sessions separately.


K.KarthiKeyan

More Related Content

PPTX
Gateway documentation
ASHOK KUMAR PALAKI
 
PPT
Tomcat configuration
Dima Gomaa
 
PPTX
Timer Interceptor in Mule part 2
Anirban Sen Chowdhary
 
PPT
Sru& and lucene
Swapnil & Patil
 
PDF
How to Replicate PostgreSQL Database
SangJin Kang
 
PPTX
Integrate with database by groovy
Son Nguyen
 
PDF
Apache Web Services
lkurriger
 
PPTX
Mapping and listing with mule
Khan625
 
Gateway documentation
ASHOK KUMAR PALAKI
 
Tomcat configuration
Dima Gomaa
 
Timer Interceptor in Mule part 2
Anirban Sen Chowdhary
 
Sru& and lucene
Swapnil & Patil
 
How to Replicate PostgreSQL Database
SangJin Kang
 
Integrate with database by groovy
Son Nguyen
 
Apache Web Services
lkurriger
 
Mapping and listing with mule
Khan625
 

What's hot (20)

PDF
Pandora FMS: Tomcat Monitoring
Pandora FMS
 
PPTX
Groovy in Mule
Praneethchampion
 
PPTX
Mule Clustering
Vijay Shan
 
PPTX
Mapping and listing with mule
Praneethchampion
 
PDF
R Apache
Ajay Ohri
 
PPTX
Caching & validating
Son Nguyen
 
PPTX
introduction to Tomcat Apache
Pushpendra Tyagi
 
PPTX
Mapping and listing with mule
Anirban Sen Chowdhary
 
PPTX
Mapping and listing in mule
Khan625
 
PDF
What's New in LuaRocks - Lua Workshop 2014 - Hisham Muhammad
Hisham Muhammad
 
PPT
Oracle Flashback Query 3
grogers1124
 
PDF
Get Going With RVM and Rails 3
Karmen Blake
 
PDF
Deployment ibm connections - No Http Server required
Sarwar Javaid
 
PPT
MySQL 5.1 Replication
Ligaya Turmelle
 
PDF
Passing java arrays in oracle stored procedure from mule esb flow
Priyobroto Ghosh (Mule ESB Certified)
 
PPTX
Simple groovy example in mule
Anirban Sen Chowdhary
 
PPT
MySQL 5.5
Ligaya Turmelle
 
PPTX
Cake php
Jyotisankar Pradhan
 
PPT
Rails3 way
Andrei Kaleshka
 
PDF
Pluggable database tutorial 2
Osama Mustafa
 
Pandora FMS: Tomcat Monitoring
Pandora FMS
 
Groovy in Mule
Praneethchampion
 
Mule Clustering
Vijay Shan
 
Mapping and listing with mule
Praneethchampion
 
R Apache
Ajay Ohri
 
Caching & validating
Son Nguyen
 
introduction to Tomcat Apache
Pushpendra Tyagi
 
Mapping and listing with mule
Anirban Sen Chowdhary
 
Mapping and listing in mule
Khan625
 
What's New in LuaRocks - Lua Workshop 2014 - Hisham Muhammad
Hisham Muhammad
 
Oracle Flashback Query 3
grogers1124
 
Get Going With RVM and Rails 3
Karmen Blake
 
Deployment ibm connections - No Http Server required
Sarwar Javaid
 
MySQL 5.1 Replication
Ligaya Turmelle
 
Passing java arrays in oracle stored procedure from mule esb flow
Priyobroto Ghosh (Mule ESB Certified)
 
Simple groovy example in mule
Anirban Sen Chowdhary
 
MySQL 5.5
Ligaya Turmelle
 
Rails3 way
Andrei Kaleshka
 
Pluggable database tutorial 2
Osama Mustafa
 
Ad

Viewers also liked (20)

PDF
APP Email 7.28.05 (b)
Obama White House
 
PDF
Escalabilidad
Expertos en TI
 
PDF
Kyoto Email 4.10.01
Obama White House
 
DOC
Складові комп"ютера та їх призначення
sveta7940
 
PPTX
presentació blogger
Byron Eduardo Castillo Minga
 
PDF
August 1987 1988 The Eighteenth Annual Report Of The Council on Environmental...
Obama White House
 
PPTX
304400_OYDER_MM_2015_Haziran Raporu_v4 0_Basin
Ozgur Tezer
 
PDF
Q3 2014 Investor Factbook
TMUS_IR
 
PDF
แบบทดสอบ เรื่อง หน่วยการวัด
Chanoknan Chanaram
 
PDF
FOTOinformator 1-3-2014
Zbigniew Wlodarski
 
PPTX
Presentation 1 (2)
Davis Hidalgo
 
PDF
LibreOfficeの最近の動向とDebianでのLibreOfficeパッケージについて
Shinji Enoki
 
PPTX
Question 2
jannesandoy
 
PDF
APP Email 08.03.05
Obama White House
 
PDF
OPIC Released Documents 1-10
Obama White House
 
PDF
LibreOffice No coding extention(ClipArt)
Makoto Takizawa
 
PDF
[학생발표]십자성마을_2020에너지자립비전및계획_2014SEL포럼
STUDENT ENERGY LAB
 
PPS
GÊNESIS 14
Samuel Oliveira
 
PDF
Django
Ksd Che
 
PPT
What to do when they've had too much Scratch?
Neil Rickus
 
APP Email 7.28.05 (b)
Obama White House
 
Escalabilidad
Expertos en TI
 
Kyoto Email 4.10.01
Obama White House
 
Складові комп"ютера та їх призначення
sveta7940
 
presentació blogger
Byron Eduardo Castillo Minga
 
August 1987 1988 The Eighteenth Annual Report Of The Council on Environmental...
Obama White House
 
304400_OYDER_MM_2015_Haziran Raporu_v4 0_Basin
Ozgur Tezer
 
Q3 2014 Investor Factbook
TMUS_IR
 
แบบทดสอบ เรื่อง หน่วยการวัด
Chanoknan Chanaram
 
FOTOinformator 1-3-2014
Zbigniew Wlodarski
 
Presentation 1 (2)
Davis Hidalgo
 
LibreOfficeの最近の動向とDebianでのLibreOfficeパッケージについて
Shinji Enoki
 
Question 2
jannesandoy
 
APP Email 08.03.05
Obama White House
 
OPIC Released Documents 1-10
Obama White House
 
LibreOffice No coding extention(ClipArt)
Makoto Takizawa
 
[학생발표]십자성마을_2020에너지자립비전및계획_2014SEL포럼
STUDENT ENERGY LAB
 
GÊNESIS 14
Samuel Oliveira
 
Django
Ksd Che
 
What to do when they've had too much Scratch?
Neil Rickus
 
Ad

Similar to Apache lb (20)

PPT
Tomcat Server
Anirban Majumdar
 
PPT
Tomcat Configuration (1)
nazeer pasha
 
PDF
Tomcat tutorail
Supratim Ray
 
PPT
Tomcat 6: Evolving our server
Jorge S Cruz Lambert
 
PPTX
Apache
reddivarihareesh
 
PDF
Apache Tomcat 8 Application Server
mohamedmoharam
 
PPT
Auxiliary : Tomcat
webhostingguy
 
ODP
For each In MULE
Raj Mevada
 
PPT
B2 2006 tomcat_clusters
Steve Feldman
 
DOCX
Integrating tomcat with apache
govindraj8787
 
PPTX
Information on Tomcat in cPanel & WHM
HTS Hosting
 
DOC
解读server.xml文件
wensheng wei
 
PPT
Introduction to Java Servlets and JSP (1).ppt
ansariparveen06
 
PPT
Web Applications and Deployment
BG Java EE Course
 
PPTX
DataBase Connectivity
Akankshaji
 
PDF
Bt0083 server side programing 2
Techglyphs
 
PPT
Hacking Tomcat
guestc27cd9
 
PPT
Hackingtomcat
Aung Khant
 
PPT
Lect06 tomcat1
Phuc Truong Ba
 
PPT
Tomcat server
Utkarsh Agarwal
 
Tomcat Server
Anirban Majumdar
 
Tomcat Configuration (1)
nazeer pasha
 
Tomcat tutorail
Supratim Ray
 
Tomcat 6: Evolving our server
Jorge S Cruz Lambert
 
Apache Tomcat 8 Application Server
mohamedmoharam
 
Auxiliary : Tomcat
webhostingguy
 
For each In MULE
Raj Mevada
 
B2 2006 tomcat_clusters
Steve Feldman
 
Integrating tomcat with apache
govindraj8787
 
Information on Tomcat in cPanel & WHM
HTS Hosting
 
解读server.xml文件
wensheng wei
 
Introduction to Java Servlets and JSP (1).ppt
ansariparveen06
 
Web Applications and Deployment
BG Java EE Course
 
DataBase Connectivity
Akankshaji
 
Bt0083 server side programing 2
Techglyphs
 
Hacking Tomcat
guestc27cd9
 
Hackingtomcat
Aung Khant
 
Lect06 tomcat1
Phuc Truong Ba
 
Tomcat server
Utkarsh Agarwal
 

Recently uploaded (20)

PDF
Omica Pageant 2025- Premier beauty pageant platform
OmicaPageant
 
PPTX
Understanding Value Education_Lect2.pptx
ssusera15ea5
 
PPTX
159f8c58-e1a2-42dd-a75d-4793a811a857.pptx
kewalsinghpuriya
 
PPTX
Self Refinement According to Psychology
Muhammad Musawar Ali
 
PPTX
Escaping The Digital Noise And Finding Peace In Stillness.pptx
Peony Magazine
 
PDF
Quarterly project_20250727_112257_0000.pdf
monteroemilia873
 
PPTX
Combining Writing, Art, And Affirmations.pptx
eman youssif
 
PPTX
Holistic Development Role of Edu v5.pptx
ssusera15ea5
 
PDF
Nep english aecc-2 about reading techniques
moharananilakantha87
 
PDF
4th Industrial Revolution, Transition Period and Sectors
Sazzad Hossain Riju
 
PDF
The Human Edge: Why A.I. Can’t Steal Your Story!
vijitsrivastava083
 
PPTX
Human_Self_Exploration1_Lecture-III.pptx
ssusera15ea5
 
PPTX
The Journey of Self Refinement and self improvement
Muhammad Musawar Ali
 
PPT
Life Skill_https://www.scribd.com/archive/plans?slideshare=true.ppt
machonvicoti
 
PPTX
Healing Portfolio Presentation.exercisepptx
eman youssif
 
PPTX
Your Personal Growth Journal journaling.pptx
eman youssif
 
PDF
Despre calibrare: O abordare structurată
Răzvan Deaconescu
 
PPTX
Healing Routine Presentation.exercisepptx
eman youssif
 
PDF
Manual-of-Guerilla-Tactics To Protect You
bawga
 
PPTX
Discipline and Positive Behaviour Plan for A Great Day
DarmawanAmbari2
 
Omica Pageant 2025- Premier beauty pageant platform
OmicaPageant
 
Understanding Value Education_Lect2.pptx
ssusera15ea5
 
159f8c58-e1a2-42dd-a75d-4793a811a857.pptx
kewalsinghpuriya
 
Self Refinement According to Psychology
Muhammad Musawar Ali
 
Escaping The Digital Noise And Finding Peace In Stillness.pptx
Peony Magazine
 
Quarterly project_20250727_112257_0000.pdf
monteroemilia873
 
Combining Writing, Art, And Affirmations.pptx
eman youssif
 
Holistic Development Role of Edu v5.pptx
ssusera15ea5
 
Nep english aecc-2 about reading techniques
moharananilakantha87
 
4th Industrial Revolution, Transition Period and Sectors
Sazzad Hossain Riju
 
The Human Edge: Why A.I. Can’t Steal Your Story!
vijitsrivastava083
 
Human_Self_Exploration1_Lecture-III.pptx
ssusera15ea5
 
The Journey of Self Refinement and self improvement
Muhammad Musawar Ali
 
Life Skill_https://www.scribd.com/archive/plans?slideshare=true.ppt
machonvicoti
 
Healing Portfolio Presentation.exercisepptx
eman youssif
 
Your Personal Growth Journal journaling.pptx
eman youssif
 
Despre calibrare: O abordare structurată
Răzvan Deaconescu
 
Healing Routine Presentation.exercisepptx
eman youssif
 
Manual-of-Guerilla-Tactics To Protect You
bawga
 
Discipline and Positive Behaviour Plan for A Great Day
DarmawanAmbari2
 

Apache lb

  • 1. Apache Load Balancing : Basic SW Requirements : 1. java 2. Tomcat 3. Apache web server 4. mod_jk Pre-Check : 1. Java home/path settings in environment 2. Test and ensure tomcat instance / httpd [Apache web server] is running . Basic Configuration: 1. enable mod_jk in apache configuration file . Ensure in below paths and files : 1. /etc/httpd/modules (or) /usr/lib64/httpd/modules/ 2./usr/libexec/ 2. need to create the following files to integrate tomcat app's with apache httpd server under /etc/httpd/conf.d/. 1. worker.properties 2.uriworkermap.properties 3. mod_jk.conf worker.properties file format : worker.list=lb,status worker.tomcat1.port=8009 worker.tomcat1.host=localhost worker.tomcat1.type=ajp13 worker.tomcat1.lbfactor=1 worker.tomcat1.redirect=tomcat2 worker.tomcat2.port=8079 worker.tomcat2.host=localhost worker.tomcat2.type=ajp13 worker.tomcat2.lbfactor=1 worker.tomcat2.redirect=tomcat1 worker.lb.type=lb worker.lb.balance_workers=tomcat1,tomcat2 worker.lb.sticky_session=True worker.lb.sticky_session_force=True worker.status.type=status worker.localhost.host=localhost Note : 1. while enabling LB we need to declare lb worker in worker.list [It is not workers.list] 2. Change the native AJP port as per the infrastructure security policy in tomcat server.xml files . And ensure the tomcat is running on that port while running . [netstat -nap |grep java] 3. update the details for each instances as per the above format . 4. Finally declare loadbalancer with the above attributes [balance_workers[it is not balance_worker],sticky_session.sticky_session_force ] 5. declaring the status worker to check the status of Load Balancing
  • 2. mod_jk.conf configuration: LoadModule jk_module modules/mod_jk.so JkWorkersFile conf.d/worker.properties JkMountFile conf.d/uriworkermap.properties JkLogFile /var/log/mod_jk.log JkLogLevel info JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories JkRequestLogFormat "%w %V %T" JkShmFile logs/jk.shm Note : 1. 1st line including the mod_jk.so with httpd 2. JkWorkersFile Including the worker.properties file 3. JkMountFile we are declaring the worker and mounting point details . 4. 4th line saying the log file location 5. Other attributes saying the log formates and final line is about memory details . uriworkermap.properties file : #/admin/*=lb #/manager/*=lb #/jsp-examples/*=lb #/servlets-examples/*=lb #/examples/*=lb #/jk-manager=status /* =lb /status =status Note : Declaring the mount points with the specific worker details We are using with load balancing so we can declare with loadbalancer worker [lb] . Loadbalancer worker will take care the distribution of the load and session status Tomcat configuration[server.xml]: 1. we need to change the native ports in tomcat server.xml file as per the requirements [We have used here 8009 & 8079] ex : <Connector port="8009" protocol="AJP/1.3" redirectPort="8473" /> in tomcat1 <Connector port="8079" protocol="AJP/1.3" redirectPort="8473" /> in tomcat2 2. change the jvmRoute name as per the workers declaration. Ex: in tomcat1 <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1"> in tomcat1 <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat2">
  • 3. Final steps : 1. Once done all the configuration as per the above details start the tomcat instances and apache server . Check the service status and log details for the information . 2. To verify the session status in load balancing Please create index.jsp with identification [page color/ content different ] in $TOMCAT_HOME/webapps/ROOT/ 3. access the server in two different session and confirm the load balance status. It need to handle the sessions separately. K.KarthiKeyan