httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Ruggeri <DRugg...@primary.net>
Subject Re: [users@httpd] Customized Stickiness
Date Wed, 12 Sep 2012 22:41:37 GMT
On 9/12/2012 9:14 AM, sol myr wrote:
> Now we'd like the load-balancer to make sure all requests from the same city - go to
the same Tomcat.
> E.g:
> - All requests from NY (namely with cookie "city=NY" go to the same Tomcat
> - All requests from Paris (namely with cookie "city=Paris" go to the same Tomcat
> - We don't mind which tomcat... just never to find 2 new yorkers connected to different
Tomcats.

If you can control the cookie Tomcat sets and set it to be
"city=<something>.city" you can set the balancer configuration like so:

LoadModule headers_module modules/mod_headers.so
<Proxy balancer://AppCluster>
   BalancerMember http://1.2.3.4:8009 route=NY
   BalancerMember http://1.2.3.5:8009 route=Paris
   ProxySet stickysession=city
</Proxy>

This way, when Tomcat sets the cookie called "city", httpd will parse
the cookie looking for the route (after the "." in the cookie value) and
match it to the BalancerMember being used.

-- 
Daniel Ruggeri


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message