RE: mod_jk sticky session still not working
Scott Ensure that the following line is commented out. You may have already done this !-- Define the top level container in our container hierarchy -- !-- Engine name=Catalina defaultHost=localhost -- And uncomment Engine name=Standalone defaultHost=localhost jvmRoute=worker1 Hope that will help. Rasool Asal -Original Message- From: Scott Danforth [mailto:[EMAIL PROTECTED] Sent: 23 February 2007 15:04 To: Tomcat Users List Subject: Re: mod_jk sticky session still not working 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:] [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:] [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:] [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:] [debug] wc_get_worker_for_name::jk_worker.c (114): found a worker loadbalancer [Fri Feb 23 09:34:59 2007] [6266:] [debug] wc_maintain::jk_worker.c (321): Maintaining worker loadbalancer [Fri Feb 23 09:34:59 2007] [6266:] [debug] wc_get_name_for_type::jk_worker.c (290): Found worker type 'lb' [Fri Feb 23 09:34:59 2007] [6266:] [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:] [debug] service::jk_lb_worker.c (840): service sticky_session=1 id='empty' [Fri Feb 23 09:34:59 2007] [6266:] [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:] [debug] service::jk_lb_worker.c (860): service worker=tomcat1 route=tomcat1 ... [Fri Feb 23 09:35:00 2007] [6266:] [debug] ajp_unmarshal_response::jk_ajp_common.c (603): status = 200 [Fri Feb 23 09:35:00 2007] [6266:] [debug] ajp_unmarshal_response::jk_ajp_common.c (610): Number of headers is = 2 [Fri Feb 23 09:35:00 2007] [6266:] [debug] ajp_unmarshal_response::jk_ajp_common.c (666): Header[0] [Set-Cookie] = [JSESSIONID=9E36E3DC58A09ED9045B25F839E37A2C; Path=/] [Fri Feb 23 09:35:00 2007] [6266:] [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:] [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:] [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:] [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:] [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:] [debug] wc_get_worker_for_name::jk_worker.c (114): found a worker loadbalancer [Fri Feb 23 09:35:10 2007] [6266:] [debug] wc_get_name_for_type::jk_worker.c (290): Found worker type 'lb' [Fri Feb 23 09:35:10 2007] [6266:] [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:] [debug] service::jk_lb_worker.c (840): service sticky_session=1
Tomcat Clustring Problem- Session issue?
Gents, I have successfully installed Apache 2.2.3 in front of a couple of Tomcat server using the mod_jk (1.2.20). I have configured the system to perform round-robin load balancing based on sticky session principle. The problem I have is that the Apache is trying to cross the same session between the two tomcat servers and then through some errors. With sticky session I was expecting that each session will be server by one tomcat server and the session will not be duplicated across the cluster and the load distributed on round-robin bases. I have looked at the Tomcat Apache documents and it appears that the jvmRoute has been depreciated and replaced by route since the release of mod_jk 1.2.20, so I have replaced the jvmRoute with route on the server.xml configuration files to reflect this change but the problem still there. It is important to note that the Apache is working fine if one of the tomcat server shutdown (not load balancing) which suggest that there is no problem with mounting the files (Jkmount). I should be grateful if you could help or provide some hints. Here is my server.xml files For Tomcat 1 I tried it with this line first Engine name=Standalone defaultHost=localhost jvmRoute=worker1/ Then replaced with: Engine name=Standalone defaultHost=localhost route=worker1/ For tomcat 2 Engine name=Standalone defaultHost=localhost jvmRoute=worker2/ Engine name=Standalone defaultHost=localhost route=worker2/ Here is my workers.properties file workers.tomcat_home=/export/home/tomcat/apache-tomca workers.java_home=/export/home/tomcat/jre1.5.0_09 # The advanced router LB worker #The workers that are member of load balancer do not need to appear in the worker.list directive according to Apache Tomcat Doucementions. worker.list=router ( # Define a worker using ajp13 worker.worker1.port=8009 # worker.worker1.host=node1.domain.org worker.worker1.host=132.146.234.35 worker.worker1.type=ajp13 worker.worker1.lbfactor=1 # Define preferred failover node for worker1 ###worker.worker1.redirect=worker2 # Define another worker using ajp13 worker.worker2.port=8009 # worker.worker2.host=node2.domain.org worker.worker2.host=132.146.234.65 worker.worker2.type=ajp13 worker.worker2.lbfactor=1 # Disable worker2 for all requests except failover# ## # Define the LB worker worker.router.type=lb worker.router.balance_workers=worker1,worker2 ###worker.worker2.activation=disabled Here is my httpd.conf LoadModule jk_module modules/mod_jk.so JkWorkersFile /usr/apche2/conf/workers.properties JkLogFile /usr/apche2/logs/mod_jk.log JkLogLevel debug JkLogStampFormat [%a %b %d %H:%M:%S %Y] JkOptions +ForwardKeySize +ForwardURICompat -Forward JkRequestLogFormat %w %V %T!-- JkMount /gvp/*.* router - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]