You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by sol myr <so...@yahoo.com> on 2012/09/12 16:14:50 UTC
[users@httpd] Customized Stickiness
Hi,
We're using Apache2.2. as a load-balancer, in front of some Tomcats.
Our Tomcats has some logic that calculates user's CITY of residence, and sends a corresponding cookie to the browser.
E.g:
- all HTTP requests from a New Yorker browser carry the cookie: "city=NY"
- all HTTP requests from a Parisian browser carry the cookie: "city=Paris"
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.
Is there an easy way to handle it with Session Stickiness?
I've looked at "stickysession" and "Header add set-cookie" , but couldn't quite put it together.
Do I need some "_mod" that's stronger that mod_headers?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Customized Stickiness
Posted by sol myr <so...@yahoo.com>.
Thanks very much.
Would you happen to know if there's a way to control stickiness if my cookies don't include a ".route", I mean they can't be in the format "cookie.route"?
But your original reply is appreciated regardless, thanks very much.
----- Original Message -----
From: Daniel Ruggeri <DR...@primary.net>
To: users@httpd.apache.org
Cc:
Sent: Thursday, September 13, 2012 1:41 AM
Subject: Re: [users@httpd] Customized Stickiness
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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Customized Stickiness
Posted by Daniel Ruggeri <DR...@primary.net>.
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