Forum Stats

  • 3,837,263 Users
  • 2,262,245 Discussions
  • 7,900,240 Comments

Discussions

apache mod proxy_balancer settings for wcs production

Haythem.ElKhouly
Haythem.ElKhouly Member Posts: 307
edited Apr 18, 2019 11:10AM in WebCenter Sites

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><br/>  Order deny,allow<br/>  Allow from all<br/><br/>  Header add Set-Cookie "ROUTEID=%{UNIQUE_ID}e.%{BALANCER_WORKER_ROUTE}e; path=/; HttpOnly; secure" env=BALANCER_ROUTE_CHANGED<br/>  Header add Set-Cookie "WCSID=%{UNIQUE_ID}e.%{BALANCER_WORKER_ROUTE}e; path=/; HttpOnly; secure" env=BALANCER_ROUTE_CHANGED<br/>  ProxySet lbmethod=byrequests stickysession=ROUTEID nofailover=On timeout=5 maxattempts=5 failonstatus=555<br/><br/><span>  BalancerMember </span><a class="jive-link-external-small" href="http://wcs01/" rel="nofollow">http://wcs01</a><span> route=firstNode connectiontimeout=15 retry=1 acquire=3000 keepalive=On</span><br/><span>  BalancerMember </span><a class="jive-link-external-small" href="http://wcs02/" rel="nofollow">http://wcs02</a><span> route=secondNode connectiontimeout=15 retry=1 acquire=3000 keepalive=On</span><br/></Proxy><br/><br/><Proxy balancer://CLUSTER_2><br/>  Order deny,allow<br/>  Allow from all<br/><br/>  Header add Set-Cookie "ROUTEID=%{UNIQUE_ID}e.%{BALANCER_WORKER_ROUTE}e; path=/; HttpOnly; secure " env=BALANCER_ROUTE_CHANGED<br/>  Header add Set-Cookie "SATELLITEID=%{UNIQUE_ID}e.%{BALANCER_WORKER_ROUTE}e; path=/; HttpOnly; secure" env=BALANCER_ROUTE_CHANGED<br/>  ProxySet lbmethod=byrequests stickysession=ROUTEID nofailover=On timeout=5 maxattempts=5 failonstatus=555<br/><br/><span>  BalancerMember </span><a class="jive-link-external-small" href="http://satellite01/" rel="nofollow">http://satellite01</a><span> route=firstNode connectiontimeout=15 retry=1 acquire=3000 keepalive=On</span><br/><span>  BalancerMember </span><a class="jive-link-external-small" href="http://satellite02/" rel="nofollow">http://satellite02</a><span> route=secondNode connectiontimeout=15 retry=1 acquire=3000 keepalive=On</span><br/></Proxy><br/><br/><LocationMatch ^/(wcs)(.*)$><br/>  RequestHeader unset Authorization<br/>  RequestHeader unset Proxy-Authorization<br/>  RequestHeader unset WWW-Authenticate<br/><br/>  ProxyPassMatch balancer://CLUSTER_1/$1$2 nofailover=On<br/>  ProxyPassReverse balancer://CLUSTER_1/$1$2<br/>  ProxyPassReverseCookiePath / /<br/></LocationMatch><br/><br/><LocationMatch ^/(satellite)(.*)$><br/>  RequestHeader unset Authorization<br/>  RequestHeader unset Proxy-Authorization<br/>  RequestHeader unset WWW-Authenticate<br/><br/>  ProxyPassMatch balancer://CLUSTER_2/$1$2 nofailover=On<br/>  ProxyPassReverse balancer://CLUSTER_2/$1$2<br/>  ProxyPassReverseCookiePath / /<br/></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?