Question
1
Replies
534
Views
Pegasystems Limited
Posted: December 4, 2017
Last activity: December 5, 2017
Closed
Load balance on Apache httpd web server
Hello Team,
We have 4 standalone JVM nodes working individually on a single redhat Linux tomcat server. We now wish to load balance these nodes through Apache httpd web server. We are able to configure the Apache web server but it is failing during "make" and "make install".
Pls direct us to the right resource/documentation to set up load balance on Apache httpd web server.
I can't really help you with your compilation issues regarding Apache, that is out of scope for this support area and is covered in the Apache documentation. Usually when my Apache fails to build it's missing library dependencies.
Once you get it compiled you want to look at using mod_proxy for your load balancing needs. Make sure you use the AJP protocol that also requires you to have a AJP connector defined in tomcat which is usually there by default on port 8009. Also PRPC requires sticky sessions so that needs to be configured as well.
Modules required:
mod_proxy.so
mod_proxy_balancer.so
mod_proxy_http.so
mod_proxy_ajp.so
Below is a simple example Apache mod_proxy configuration load balancing between two nodes on same server using AJP ports 8009 and 8010 and using JSESSIONID cookie as the sticky session identifier. The PRPC server is using the default context root of /prweb.
ProxyRequests Off
ProxyPass /prweb balancer://mycluster stickysession=JSESSIONID
ProxyPassReverse /prweb balancer://mycluster stickysession=JSESSIONID
<Proxy balancer://mycluster>
BalancerMember ajp://localhost:8009/prweb route=server1
BalancerMember ajp://localhost:8010/prweb route=server2
</Proxy>
The Server.xml of Tomcat usually has the AJP port defined. So in the above example the server.xml for "server2" would have been updated to use AJP port 8010.
Documentation on mod_proxy, mod_proxy_balancer can be found at the main Apache web site.