-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Francesco,
On 11/18/11 5:29 AM, Francesco Sordillo wrote: > I'm using Tomcat 6.0.26 on RHEL 5.6 machine and Apache 2.2.3. I > don't understand if the jvmroute for stickysession must be unique! jvmroute must be unique. It's pretty clear from the documentation both here: http://tomcat.apache.org/connectors-doc/reference/workers.html " If you want to use session stickiness, you must set different jvmRoute attributes in the Engine element in Tomcat's server.xml. Furthermore the names of the workers which are managed by the balancer have to be equal to the jvmRoute of the Tomcat instance they connect with. " and here: http://tomcat.apache.org/tomcat-7.0-doc/config/engine.html " jvmRoute - Identifier which must be used in load balancing scenarios to enable session affinity. The identifier, which must be unique across all Tomcat servers which participate in the cluster, will be appended to the generated session identifier, therefore allowing the front end proxy to always forward a particular session to the same Tomcat instance. " Is there something that should be added to the documentation to make this more clear? > My scenario is this: - two machine - two tomcat instance per > machine - proxy balancer on apache actived and connected with > tomcat in full mesh > > So I have: - node01, node02 (the machines) - istance01, instance02 > on node01 and node02 > > Tomcat instances are not configured for Cluster/Session > Replication. On each tomcat instance I setted jvmroute parameter as > follow: > > a. on node01, jvmroute="istance01_node01" and "instance02_node01" > for instance01 and istance02, respectively; b. on node01, > jvmroute="istance01_node02" and "instance02_node02" for instance01 > and istance02, respectively. I see a lot of typos "istance" instead of "instance". Are you sure you have everything spelled correctly in your configuration? > So my Apache configuration for stickysession is as follow: > > ----- ProxyPass /myApp/ balancer://balance-this/myApp/ > > <Proxy balancer://balance-this> BalancerMember ajp://node01:10505 > route=instance01_node01 BalancerMember ajp://node01:10505 > route=instance02_node01 BalancerMember ajp://node02:10505 > route=instance01_node02 BalancerMember ajp://node02:10505 > route=instance02_node02 > > ProxySet stickysession=JSESSIONID nofailover=On </Proxy> ----- > > And this works fine! Good. > BUT, if I have jvmroute parameter configured with the same value > for all my tomcat instance (e.g. jvmroute="myRoute") and so apache > configured as follow > > [...] > > it still works!!! I do not lose my session! Why??? Have to jvmroute > be unique or not??? That's probably because you are only being directed to a single Tomcat backend. mod_proxy_ajp probably picks the first worker that matches the jvmRoute and it doesn't care that they are all the same. If you run a load test against the cluster, I suspect that you'll end up with 100% of the load going to a single Tomcat backend. > Remember, I don't use cluster/session replication feature.... Good. :) - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7GdREACgkQ9CaO5/Lv0PBALQCeO3zJLwIYGo9E9zxkCPlt52ld QwMAn2O4DKFQqtflvsWZPoa4XnLybJsO =7T22 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org