You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Allistair Crossley <Al...@QAS.com> on 2005/08/18 18:03:04 UTC
load balancing 2 tomcats on 1 machine question
Hi,
I thought I had this sussed but it seems I haven't :( 2 tomcats, 1 machine, JK to balance with stick sessions. The following configuration works in that JK routes requests to both the tomcats and so on.
The issue is that if I look in the access logs for each tomcat I can see that 1 session gets spread across both tomcats rather than staying on one.
This question is ever so slightly related to a post earlier today by a poster who was seeing JK actually stay with the same tomcat, but still create a new session. My issue is that the requests do not stay with the same tomcat.
Is anyone able to suggest why this is?
Regards, Allistair.
workers.tomcat_home="d:\jakarta-tomcat"
workers.java_home="c:\Program Files\Java\jdk1.5.0"
ps=\
worker.list=loadbalancer
worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1
worker.tomcat1.cachesize=1
worker.tomcat2.port=8109
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1
worker.tomcat2.cachesize=1
worker.loadbalancer.type=lb
worker.loadbalancer.sticky_session=true
worker.loadbalancer.method=R
worker.loadbalancer.balanced_workers=tomcat1,tomcat2
worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr
<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE>
-------------------------------------------------------
QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>
Re: load balancing 2 tomcats on 1 machine question
Posted by Mladen Turk <ml...@jboss.com>.
Allistair Crossley wrote:
> Hi,
>
> I thought I had this sussed but it seems I haven't :( 2 tomcats, 1 machine, JK to balance with stick sessions. The following configuration works in that JK routes requests to both the tomcats and so on.
>
Did you set the jvmRoute="tomcat1" inside server.xml <Engine tag
for the first and jvmRoute="tomcat2" for the second instance.
>
> workers.tomcat_home="d:\jakarta-tomcat"
> workers.java_home="c:\Program Files\Java\jdk1.5.0"
> ps=\
>
You don't need that
>
> worker.inprocess.type=jni
> worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
> worker.inprocess.cmd_line=start
> worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)jvm.dll
> worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
> worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr
>
You don't need that too.
Regards,
Mladen.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org