Hi Folks,
I hope I can clearly state my issue... In Apache configuration there are two clusters defined for load balancing, and I would like to use sticky session to route user requests always on the first member or always on the second member of the clusters.
Infrastructure 2 X Webservers (apache01 and apache02) - OS Linux - Apache 2.2.34
2 X Oracle Satellite (satellite01 and satellite02) - cache application - OS Solaris
2 X Oracle WCS (wcs01 and wcs02) - cms - OS Solaris
The details about Oracle Satellite and Oracle WCS are not important for the time being. My issue is on Webserver and to be more specific to the Apache and load balancing.
Some environment specifics. - There is no memory/session replication between any Application server - satellite01 will always send the request to wcs01, and satellite02 will always send the request to wcs02 - Apache is checking the request and can send the request * directly to wcs servers, or * apache can send the request to satellite. Satellite may further forward the request to wcs if need it.
user --> Apache --> Satellite --> WCS
OR
user --> Apache --> WCS
Currently in Apache configuration, there are two cluster defined. One for Satellite servers and one for WCS servers. My goal here is all user requests to be served from the same servers. For instance, if the first request goes to wcs01, all further request should be served from wcs01 or satellite01 and vice versa.
My current set up is as follows
<Proxy balancer://CLUSTER_1>
Order deny,allow
Allow from all
Header add Set-Cookie "ROUTEID=%{UNIQUE_ID}e.%{BALANCER_WORKER_ROUTE}e; path=/; HttpOnly; secure" env=BALANCER_ROUTE_CHANGED
Header add Set-Cookie "WCSID=%{UNIQUE_ID}e.%{BALANCER_WORKER_ROUTE}e; path=/; HttpOnly; secure" env=BALANCER_ROUTE_CHANGED
ProxySet lbmethod=byrequests stickysession=ROUTEID nofailover=On timeout=5 maxattempts=5 failonstatus=555
BalancerMember http://wcs01 route=firstNode connectiontimeout=15 retry=1 acquire=3000 keepalive=On
BalancerMember http://wcs02 route=secondNode connectiontimeout=15 retry=1 acquire=3000 keepalive=On
</Proxy>
<Proxy balancer://CLUSTER_2>
Order deny,allow
Allow from all
Header add Set-Cookie "ROUTEID=%{UNIQUE_ID}e.%{BALANCER_WORKER_ROUTE}e; path=/; HttpOnly; secure " env=BALANCER_ROUTE_CHANGED
Header add Set-Cookie "SATELLITEID=%{UNIQUE_ID}e.%{BALANCER_WORKER_ROUTE}e; path=/; HttpOnly; secure" env=BALANCER_ROUTE_CHANGED
ProxySet lbmethod=byrequests stickysession=ROUTEID nofailover=On timeout=5 maxattempts=5 failonstatus=555
BalancerMember http://satellite01 route=firstNode connectiontimeout=15 retry=1 acquire=3000 keepalive=On
BalancerMember http://satellite02 route=secondNode connectiontimeout=15 retry=1 acquire=3000 keepalive=On
</Proxy>
<LocationMatch ^/(wcs)(.*)$>
RequestHeader unset Authorization
RequestHeader unset Proxy-Authorization
RequestHeader unset WWW-Authenticate
ProxyPassMatch balancer://CLUSTER_1/$1$2 nofailover=On
ProxyPassReverse balancer://CLUSTER_1/$1$2
ProxyPassReverseCookiePath / /
</LocationMatch>
<LocationMatch ^/(satellite)(.*)$>
RequestHeader unset Authorization
RequestHeader unset Proxy-Authorization
RequestHeader unset WWW-Authenticate
ProxyPassMatch balancer://CLUSTER_2/$1$2 nofailover=On
ProxyPassReverse balancer://CLUSTER_2/$1$2
ProxyPassReverseCookiePath / /
</LocationMatch>
SATELLITEID and WCSID cookies are not in use to my understanding. I have checked applications servers as well. I think I can ignore them for now.
My last update in the above configuration was the "nofailover" to On inside LocationMatch, because I've missed it, but it will take some time to be able to test it. So, my question is, am I missing anything else. Is this set up appropriate to keep the request on the same path?