P.S. I see a mention of "cluster" in the documentation for jvmRoute. Do I need to configure a "cluster" perhaps?

   -- Scott.


Scott Danforth wrote:

Mladen Turk wrote:

Scott Danforth wrote:

I'm trying to use jk1.2.20 mod_jk with Apache 1.3 for load balancing two tomcat services and sticky sessions aren't working.



You don't have session affinity mark
For each instance add jvmRoute="tomcat1" or
jvmRoute="tomcat2 for a second instance. See:
http://tomcat.apache.org/tomcat-5.5-doc/config/engine.html



Thanks for your help. That sounds very reasonable, and I modifed the two server.xml Engine elements as suggested, but it appears to make no difference.

Below are 3 segments from mod_jk.log.

The first segment shows the initial request coming in without a sessionid. The request is routed to tomcat1 with route=tomcat1.

The second segment shows the response coming back from tomcat1, with a new session id.

The third segment shows the second request coming in with the expected session id, and shows tomcat2 being selected with route=tomcat2.

You say I don't have session affinity mark. How would that show up in the log? Is the "partial sessionid" an indication of the problem?

   -- Scott.


[Fri Feb 23 09:08:53 2007] [6000:0000] [debug] map_uri_to_worker::jk_uri_worker_map.c (575): Attempting to map URI '/servlets/Build' from 1 maps [Fri Feb 23 09:34:59 2007] [6266:0000] [debug] map_uri_to_worker::jk_uri_worker_map.c (587): Attempting to map context URI '/servlets/*=loadbalancer' source 'JkMount' [Fri Feb 23 09:34:59 2007] [6266:0000] [debug] map_uri_to_worker::jk_uri_worker_map.c (602): Found a wildchar match '/servlets/*=loadbalancer' [Fri Feb 23 09:34:59 2007] [6266:0000] [debug] wc_get_worker_for_name::jk_worker.c (114): found a worker loadbalancer [Fri Feb 23 09:34:59 2007] [6266:0000] [debug] wc_maintain::jk_worker.c (321): Maintaining worker loadbalancer [Fri Feb 23 09:34:59 2007] [6266:0000] [debug] wc_get_name_for_type::jk_worker.c (290): Found worker type 'lb' [Fri Feb 23 09:34:59 2007] [6266:0000] [debug] init_ws_service::mod_jk.c (561): Service protocol=HTTP/1.1 method=GET host=(null) addr=192.168.1.50 name=build port=8008 auth=(null) user=(null) laddr=192.168.1.7 raddr=192.168.1.50 [Fri Feb 23 09:34:59 2007] [6266:0000] [debug] service::jk_lb_worker.c (840): service sticky_session=1 id='empty' [Fri Feb 23 09:34:59 2007] [6266:0000] [debug] get_most_suitable_worker::jk_lb_worker.c (785): found best worker tomcat1 (tomcat1) using method 'Request' [Fri Feb 23 09:34:59 2007] [6266:0000] [debug] service::jk_lb_worker.c (860): service worker=tomcat1 route=tomcat1

...

[Fri Feb 23 09:35:00 2007] [6266:0000] [debug] ajp_unmarshal_response::jk_ajp_common.c (603): status = 200 [Fri Feb 23 09:35:00 2007] [6266:0000] [debug] ajp_unmarshal_response::jk_ajp_common.c (610): Number of headers is = 2 [Fri Feb 23 09:35:00 2007] [6266:0000] [debug] ajp_unmarshal_response::jk_ajp_common.c (666): Header[0] [Set-Cookie] = [JSESSIONID=9E36E3DC58A09ED9045B25F839E37A2C; Path=/] [Fri Feb 23 09:35:00 2007] [6266:0000] [debug] ajp_unmarshal_response::jk_ajp_common.c (666): Header[1] [Content-Type] = [text/html;charset=ISO-8859-1] [Fri Feb 23 09:35:00 2007] [6266:0000] [debug] ajp_connection_tcp_get_message::jk_ajp_common.c (1029): received from ajp13 pos=0 len=2309 max=8192

...

[Fri Feb 23 09:35:10 2007] [6266:0000] [debug] map_uri_to_worker::jk_uri_worker_map.c (575): Attempting to map URI '/servlets/Build' from 1 maps [Fri Feb 23 09:35:10 2007] [6266:0000] [debug] map_uri_to_worker::jk_uri_worker_map.c (587): Attempting to map context URI '/servlets/*=loadbalancer' source 'JkMount' [Fri Feb 23 09:35:10 2007] [6266:0000] [debug] map_uri_to_worker::jk_uri_worker_map.c (602): Found a wildchar match '/servlets/*=loadbalancer' [Fri Feb 23 09:35:10 2007] [6266:0000] [debug] wc_get_worker_for_name::jk_worker.c (114): found a worker loadbalancer [Fri Feb 23 09:35:10 2007] [6266:0000] [debug] wc_get_name_for_type::jk_worker.c (290): Found worker type 'lb' [Fri Feb 23 09:35:10 2007] [6266:0000] [debug] init_ws_service::mod_jk.c (561): Service protocol=HTTP/1.1 method=POST host=(null) addr=192.168.1.50 name=build port=8008 auth=(null) user=(null) laddr=192.168.1.7 raddr=192.168.1.50 [Fri Feb 23 09:35:10 2007] [6266:0000] [debug] service::jk_lb_worker.c (840): service sticky_session=1 id='9E36E3DC58A09ED9045B25F839E37A2C' [Fri Feb 23 09:35:10 2007] [6266:0000] [debug] get_most_suitable_worker::jk_lb_worker.c (733): searching worker for partial sessionid 9E36E3DC58A09ED9045B25F839E37A2C [Fri Feb 23 09:35:10 2007] [6266:0000] [debug] get_most_suitable_worker::jk_lb_worker.c (785): found best worker tomcat2 (tomcat2) using method 'Request' [Fri Feb 23 09:35:10 2007] [6266:0000] [debug] service::jk_lb_worker.c (860): service worker=tomcat2 route=tomcat2



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




--

Scott Danforth, Ph.D.
Director of Technology
ePath Learning, Inc.
70 Howard Street, Suite C
New London, CT 06320
Phone: (860) 444-6989 ext. 3
Fax: (215) 243-7454
email: [EMAIL PROTECTED]




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

Reply via email to