Assume that we have servers like below:
Level 1: Internet - Apache 2.2 HTTP server + mod_proxy_balancer (www.mydomain.com)
Level 2: Intranet - Oracle WebLogic Managed server 1 (clustered) (intradomain1.com - 10.10.10.133)
Level 2: Intranet - Oracle WebLogic Managed server 2 (clustered) (intradomain2.com - 10.10.10.134)
httpd.conf:
....
#Switching off facilities of forwarding proxy server
ProxyRequests Off
#Actual balancing settings with two members of balancer group. Balancer is accessed by balancer://lb link.
#ProxySet lbmethod sets balancer load-balance method as byrequest to perform weighted request counting.
#loadfactor is normalized weighted load applied to the worker. I set it to 50/50 to equal balancing between nodes.
#route is a value appended to session id. Usually used with inside balancers, for instance, when we need to used predefined requests direction using subsequent balancers.
<Proxy>
BalancerMember http://10.10.10.133:7003 loadfactor=50 route=r1
BalancerMember http://10.10.10.134:7003 loadfactor=50 route=r2
ProxySet lbmethod=byrequest
</Proxy>
#Allow everyone to access any proxied content
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
#Every request to http://www.mydomain.com/analytics goes through Apache balancer to pass into intranet Weblogic application servers.
ProxyPass /analytics balancer://lb/analytics/
#Reverse intranet servers requests back
ProxyPassReverse / balancer://lb/analytics/
ProxyPassReverse / http://10.10.10.133/analytics/
ProxyPassReverse / http://10.10.10.134/analytics/
#Set location accessable by http://www.mydomain.com/lbm to see actual balancing state.
<Location>
SetHandler balancer-manager
</Location>
.
ProxyPass directive allows remote servers to be mapped into the space of the local server; the local server does not act as a proxy in the conventional sense, but appears to be a mirror of the remote server. The local server is often called a reverse proxy or gateway. The path is the name of a local virtual path; url is a partial URL for the remote server and cannot include a query string.
ProxyPassReverse directive lets Apache adjust the URL in the Location, Content-Location and URI headers on HTTP redirect responses. This is essential when Apache is used as a reverse proxy (or gateway) to avoid by-passing the reverse proxy because of HTTP redirects on the backend servers which stay behind the reverse proxy.
Only the HTTP response headers specifically mentioned above will be rewritten. Apache will not rewrite other response headers, nor will it rewrite URL references inside HTML pages. This means that if the proxied content contains absolute URL references, they will by-pass the proxy. A third-party module that will look inside the HTML and rewrite URL references is Nick Kew's mod_proxy_html
For details please check documentation:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
Please note with setting i've mentioned if there is no session's replication between application servers you could have a problems with application access or its work. The one of the other possible solution is to use session ID as identifier of the backend node e.g preventing of switching nodes in the same session (it's called sticky session). I'm going to describe in future posts how to make replication and how to use session ID to identify required destination.
2 comments:
You mentioned that you'd write something up about how you setup session replication with mod_proxy_balancer, but I can't find the post. Do you have any tips? I can only find the configuration steps for when you are using the Weblogic Plugin.
I am also looking for your blog about how you setup session replication with mod_proxy_balancer, but I can't find the post.Can you share the link here?Your blog about loadbalancing between clustered Oracle WebLogic servers and proxing facilities to pass external request to our intranet for specific Oracle BI application (analytics) is really helpful
Post a Comment