I am trying to configure an Apache load balancing solution with mod_jk. The clustering works but not load balancing.
I have Apache httpd 2.2 server running on my laptop. I have two VMWare Virtual Machine Guest Operating systems. All three are windows. The VMware machines hosts Apache Tomcat Server serving the web application. I have configured httpd.conf file with mod_jk and a workers properties file with the worker information. I am able to access my web application using the URL : http://localhost/Web-application . If I stop one server then the application is served from the other. However not both at the same time. Some extracts are below:
httpd.conf file:
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile "logs/mod_jk.log"
JkLogLevel info
JkMount /MovieBooking loadbalancer
JkMount /MovieBooking/* loadbalancer
workers.properties File
workers.tomcat_home=/worker1
workers.java_home=$JAVA_HOME
worker.list=loadbalancer,jkstatus,worker1,worker2
#Declare Tomcat server workers 1 through n
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=worker1,worker2
worker.loadbalancer.sticky_session=1
worker.worker1.type=ajp13
worker.worker1.host=192.168.200.244
worker.worker1.port=8109
worker.worker1.lbfactor=1
worker.worker2.type=ajp13
worker.worker2.port=8109
worker.worker2.host=192.168.200.243
worker.worker2.lbfactor=1
worker.jkstatus.type=status
I have also set jvmroute in the server.xml files on these servers:
Server.xml
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker1">
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
if any more extracts are required I can upload them