tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashley Hayes <ashley.ha...@macalla.com>
Subject RE: tomat5 / sticky sessions / missing route?
Date Thu, 12 Oct 2006 09:03:02 GMT
Hi Daniel,
	I recently setup some similar architecture and documentation for
tomcat mod-jk integration with proper sticky sessions is very poor. I am not
that familiar with the jk logs but do know I had to do the following to get
sticky sessions to work:

Think your problem may be with only one "jvmRoute" configured correctly?
i.e.

On your host 172.26.19.16 edit tomcats server.xml, add/update the jvmRoute
attribute to be the name of the worker pointing at this tomcat, e.g.

<Engine name="Catalina" .... jvmRoute="tomcatlb1">

On host 172.26.19.17, set it as :
<Engine name="Catalina" ....  jvmRoute="tomcatlb2">
	

>From what I have tested so far the user will get directed to the correct
tomcat regardless of apache they use (as long as the same cookie is send to
both apache's, hardware loadbalancer, dns loadbalaning etc...)

I have an outstanding problem with tomcat redirects using the full URL of
the internal server IP rather than the domainname in the URL. I'd be
interested in hearing what configuration you have for this.
Thanks
A



-----Original Message-----
From: Daniel Eckstein [mailto:de@it-eckstein.de] 
Sent: 12 October 2006 09:38
To: users@tomcat.apache.org
Subject: tomat5 / sticky sessions / missing route?


Dear listmember,

Ive searched the docs and the web and couldnt find an answer to the 
following:

The setup is like 2 apaches are connecting to 2 tomcats crosswise, 
apache1 to tomcat1/tomcat2 and
apache2 to tomcat1/tomcat2 by using

workers.java_home=/usr/bin/java
ps=/
worker.list=lb,jkstatus
worker.lb.type=lb
worker.lb.sticky_session=true
worker.jkstatus.type=status
worker.tomcatlb1.type=ajp13
worker.tomcatlb1.host=172.26.19.16
worker.tomcatlb1.port=8009
worker.tomcatlb1.lbfactor=10
worker.tomcatlb1.socket_timeout=120
worker.tomcatlb1.connection_pool_size=50
worker.tomcatlb1.type=ajp13
worker.tomcatlb2.type=ajp13
worker.tomcatlb2.host=172.26.19.17
worker.tomcatlb2.port=8009
worker.tomcatlb2.lbfactor=10
worker.tomcatlb2.socket_timeout=120
worker.tomcatlb2.connection_pool_size=50
worker.lb.balance_workers=tomcatlb1,tomcatlb2

which is working so far. Sticky connection is absolutely neccessary due 
to application "design".
(not able to take any influence here)

This setup exists twice. One environment keeps directing the user within 
one session to one tomcat like it
should, the other one does not.

Looking at mod_jk debug output at the not working one, I can see, that 
for every request mod_jk generates
a new session id:

[Thu Oct 12 09:59:11 2006] [11822:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (514): total sessionid is
DA9D99BE9ECB77C69A3B799FC122F670
[Thu Oct 12 09:59:11 2006] [11822:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (524): searching worker for partial
sessionid DA9D99BE9ECB77C69A3B799FC122F670
[Thu Oct 12 09:59:11 2006] [11822:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (564): found best worker
(tomcatlb1) using by request method
[Thu Oct 12 09:59:15 2006] [11820:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (514): total sessionid is
DFAFEE609A2DFEF179D5D6B1CCF030A3
[Thu Oct 12 09:59:15 2006] [11820:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (524): searching worker for partial
sessionid DFAFEE609A2DFEF179D5D6B1CCF030A3
[Thu Oct 12 09:59:15 2006] [11820:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (564): found best worker
(tomcatlb2) using by request method

These are simple reloads within one session.

I noticed one more thing:

This is debug output from the working environment:

[Thu Oct 12 10:11:50 2006] [0517:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (514): total sessionid is
0EC77EB2BBA412F4C40F6033B9AD16C4.tomcatlb1
[Thu Oct 12 10:11:50 2006] [0517:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (524): searching worker for partial
sessionid 0EC77EB2BBA412F4C40F6033B9AD16C4.tomcatlb1
[Thu Oct 12 10:11:50 2006] [0517:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (532): searching worker for session
route tomcatlb1
[Thu Oct 12 10:11:50 2006] [0517:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (541): found worker tomcatlb1 for
route tomcatlb1 and partial sessionid
0EC77EB2BBA412F4C40F6033B9AD16C4.tomcatlb1

This from the not working one:

[Thu Oct 12 10:16:26 2006] [12189:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (514): total sessionid is
ADE09C3AD588F82F34E0B7C23E5F01D7
[Thu Oct 12 10:16:26 2006] [12189:42688] [debug]
get_most_suitable_worker::jk_lb_worker.c (524): searching worker for partial
sessionid ADE09C3AD588F82F34E0B7C23E5F01D7

Note the difference in the generated session ids:


DFAFEE609A2DFEF179D5D6B1CCF030A3

vs. 

0EC77EB2BBA412F4C40F6033B9AD16C4.tomcatlb1

ie. on the not working environment theres the ".<worker>" missing.

But why? The two environments are identical in terms of tomcat/mod_jk 
version.

Thanks alot in advance!!

Regards,
Daniel


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message