In this document, we have explained how we can do load balancing in Helical Insight application using Tomcat. The cluster consists of a set of connected Tomcat Servers that work together so that, in many respects, they can be viewed as a single system. Each node sets to perform the same task, controlled and scheduled by the load balancer.
- Tools Used:
- Java JDK 1.8
- Apache Tomcat servers
- Apache httpd server
- Mod_jk connector
- Download and Install Tomcat:
- Download and Install Apache httpd server:
- Download mod_jk :
Here Download mod_jk as zip or compressed file:
- mod_jk installation:
- Add mod_jk to the httpd.conf:
- Create the workers.properties file:
Download any version of tomcat (7.0+) and install it. This will act as one of the nodes and deploy Helical Insight application in it. In order to understand how to install Helical Insight application, please refer to this blog: Helical Insight Application Installation Guide
Similarly, download and install another tomcat (version 7.0+) on a different port then already existing port and this will be another node. Again deploy Helical Insight application in it by referring the same Installation blog.
Note: You are having 2 different tomcats running on different ports. But keep hi-repository and back end Helical Insight database (which stores User Role Management information) as common for both of these tomcat instances.
Check and confirm that both tomcat instances are running and with both Helical Insight application is accessible.
Download apache server (version 2.0 +) and install it.
Extract the mod_jk compressed file and copy the file “mod_jk.so” into the httpd server modules directory.
Edit the “httpd.conf” file and add following lines:
LoadModule jk_module modules/mod_jk.so JkWorkersFile E:\Apache2.2\conf\workers.properties JkShmFile E:\Apache2.2\logs\mod_jk.shm JkLogFile E:\Apache2.2\logs\mod_jk.log JkLogLevel error JkMount /status status JkMount /* balancer
Note: Modify paths according to your installation directory.
In the conf directory of the Apache httpd server, create a new text file with the name “workers.properties”
Edit this “workers.properties” file and put the following lines:
worker.list=balancer,status worker.tomcat1.type=ajp13 worker.tomcat1.port=8009 worker.tomcat1.host=localhost worker.tomcat2.type=ajp13 worker.tomcat2.port=8010 worker.tomcat2.host=localhost worker.balancer.type=lb worker.balancer.balance_workers=tomcat1,tomcat2 worker.status.type=status
From outside we have 2 visible workers: balancer and stat. All the request that comes to the balancer are managed by the balancer worker.
Restart apache httpd service.
At this point the Apache httpd server is working as a front end of the Tomcat Load Balancer.Reference : Apache Tomcat Load Balancing Tutorials
Now the request will get distributed between the various Helical Insight installations via apache tomcat.
If you have any queries please get us at firstname.lastname@example.org