Hi again,
I tried your suggestion but couldn't get it working for me. It
got me thinking, though, and what I did was add a different JSP page to
the application that sets a cookie, correctly formatted (you're right it
expects the cookie to be 'value.route') to indicate the server that it
came from, and then redirects to the start page of the application. That
works a treat for our purposes.
Thanks for your help!
Brendan
"Axel-Stephane SMORGRAV" <[EMAIL PROTECTED]>
08/01/2008 12:45
Please respond to
[email protected]
To
<[email protected]>
cc
Subject
RE: [EMAIL PROTECTED] Load balancing problem
Hello there,
Although I am not very experienced in using proxy_balancer, I did
experiment with it a little bit a while ago.
>From what I remember, it expects the route to be appended to the balancer
cookie value. In your example it is expecting a cookie of
JSESSIONID=0000K8zpkCtCy6l9Y91Q86bETpX:-1.1 or
JSESSIONID=0000K8zpkCtCy6l9Y91Q86bETpX:-1.2
If a valid route is not found in the cookie, it will not apply stickiness.
Unless you can actually yourself determine part of the value of JSESSIONID
in order to include a route which can be interpreted by proxy_balancer,
JSESSIONID is not a good balancer cookie. What I did myself was to set a
cookie on the browser whenever I detected a request not containing a
balancer cookie.
RewriteMap bID rnd:/path/balancers.map
RewriteCond %{HTTP_COOKIE} !BALANCER=route
RewriteRule . - [CO=BALANCER:route.${bID:rand}:%{ENV:domain}]
The balancers.map file may contain:
rnd 1|2|3|4
Another way of setting the cookie would be to direct a request not
containing a cookie to a specific path on the application server, let the
balancer determine which application server that should be, and let the
application server set a cookie corresponding to itself.
RewriteCond %{HTTP_COOKIE} !BALANCER=route
RewriteRule . /myapp/setbalancercookieandcreatesessionobject
or something like that.
It would be interesting to know what others are doing on that subject.
-ascs
________________________________
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Envoyé : mardi 8 janvier 2008 13:06
À : [email protected]
Objet : [EMAIL PROTECTED] Load balancing problem
Hi,
I am running httpd version 2.2.6 on Windows XP SP2. I am trying
to use sticky sessions to route users to a server, based on the value of
the JSESSIONID cookie in their request. While the load balancing does
appear to work, the sticky sessions don't appear to be working. My
configuration looks like this:
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
" from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________