LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-26-2012, 07:19 AM   #1
sanjay87
Member
 
Registered: Oct 2011
Posts: 164

Rep: Reputation: Disabled
Load Balancing Configuration error in tomcat


Hi
im very new to tomcat ,i tried out to configure Load balancing in tomcat .configured tomcat1 and tomcat2 .tomcat 1 made to run on port 80 and tomcat 2 made it to run on pot 90.I had deployed the same patch on both the tomcat instant.But whenver tomcat1 get fails tomcat2 never servers tomcat1.server and site get down.Im very new to tomcat application can anyone help me how can i configured load balancing in tomcat server

Httpd.conf

#apache tomcat connector propertise file location
JkWorkersFile "/etc/httpd/conf/workers.properties"
JkLogFile "logs/mod_jk.log"

JkLogLevel debug,error,info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

workers.properties

ps=/


worker.list=worker1,worker2
worker.list=balancer
worker.worker1.port=8081

worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1


worker.worker2.port=9092
worker.worker2.host=localhost
worker.worker2.type=ajp13
worker.worker2.lbfactor=2
worker.balancer.type=1b
worker.balancer.balance_workers=worker1,worker2
worker.balance.method=B
worker.balancer.sticky_session=True


worker.balancer.type=1b
worker,balancer.balance_workers=worker1,worker2
worker.balancer.method=B

worker.balancer.sticky_session =True


when i try to start the apache service it not starting up.when i uncomment the below line

worker.balancer.type=1b
worker,balancer.balance_workers=worker1,worker2
worker.balancer.method=B

worker.balancer.sticky_session =True


apache getting started up .Can anyone help me wat could b problem in my conf

Last edited by sanjay87; 03-26-2012 at 09:22 AM.
 
Old 03-28-2012, 09:50 AM   #2
sanjay87
Member
 
Registered: Oct 2011
Posts: 164

Original Poster
Rep: Reputation: Disabled
Hi,


i had configured Multiple instant of tomcat and configured workers.properties for loadbalancing the worker1,worker2.when i stop the tomcat process on running on port 80 .i could int find worker2 running on port 90 serving apache automatically .Can any one help me how can u loadbalancethe tomcat application server when tomcat1 get crashed i m trying out thetomcat2 to server apache automatically on port 80.




[root@localhost ~]# cd /etc/httpd/conf
[root@localhost conf]# ls
bak1.workers httpd.conf httpd-qa.conf workers.properties
bak.workers.properties httpd-prod.conf magic
[root@localhost conf]# cat workers.properties
#workers.properties

ps=/

worker.list=loadbalancer,status,worker1,worker2


#worker.list=worker1,worker2
#worker.list=balancer

worker.worker1.port=8081
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1

worker.worker2.port=9092
worker.worker2.host=localhost
worker.worker2.type=ajp13
worker.worker2.lbfactor=1

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=worker1,worker2
worker.loadbalancer.sticky_session=True
#worker.loadbalancer.sticky_session_force=True
worker.status.type=status


[root@localhost conf]# cd
[root@localhost ~]# cd /opt/apps/tomcat1/conf/
[root@localhost conf]# cat server.xml
<?xml version='1.0' encoding='utf-8'?>
<Server port="6075" shutdown="SHUTDOWN">

<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

<Service name="Catalina">

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8081" URIEncoding="UTF-8" />
<Connector port="8081" protocol="AJP/1.3" redirectPort="8081" />

<Engine name="Catalina" defaultHost="localhost">

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<Listener className="org.apache.jk.config.ApacheConfig"
modJk="/etc/httpd/modules/mod_jk.so" />

</Host>
</Engine>
</Service>
</Server>

[root@localhost conf]# cat /opt/apps/tomcat2/conf/server.xml
<?xml version='1.0' encoding='utf-8'?>
<Server port="6095" shutdown="SHUTDOWN">

<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

<Service name="Catalina">

<Connector port="9090" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="9092" URIEncoding="UTF-8" />
<Connector port="9092" protocol="AJP/1.3" redirectPort="9092" />

<Engine name="Catalina" defaultHost="localhost">

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<Listener className="org.apache.jk.config.ApacheConfig"
modJk="/etc/httpd/modules/mod_jk.so" />

</Host>
</Engine>
</Service>
</Server>
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid load balancing configuration maxy Linux - Server 2 10-07-2011 09:19 AM
Load balancing and high availability configuration enid Linux - Software 1 09-17-2010 12:39 AM
Load balancing theuser26 Linux - Networking 15 10-14-2009 08:01 AM
Network Load balancing + squid server with multiple uplink configuration ntlinn Linux - Server 0 08-19-2009 02:43 AM
load balancing cirogl Linux - Enterprise 3 05-25-2006 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration