0
votes

I am able to achieve load balancing using Tomcat 7 and Apache mod_jk by running the same application from two different tomcat instances using load balancer configured in httpd.conf and worker.properties works fine.

  • httpd.conf
JkMount /myApp/* loadbalancer
  • worker.properties
worker.list= worker,worker1,loadbalancer 
worker.worker1.port=8009 
worker.worker1.host=IP
worker.worker1.type=ajp13
worker.worker.port=8009 
worker.worker.host=IP 
worker.Worker.type=ajp13 
worker.loadbalancer.type=lb 
worker.loadbalancer.balance_workers=worker,worker1

However I am trying to have multiple load balancers so that in case single load balancer fails then in such a case we have a fallback load balancer as in this case there is only one load balancer. Is this possible with Apache mod_jk.

1
As you've unmarked the previously accepted answer: May I ask what additional information you're looking for?Olaf Kock
This resolves my concern. I am trying to create an active passive setup now for the solution using keepalived. Can you suggest on this stackoverflow.com/q/42791699/2821056user2821056

1 Answers

0
votes

In the case you describe in your question, Apache httpd is the loadbalancer, which happens to use mod_jk to do the actual balancing job. If Apache httpd goes away, you'll no longer balance. Therefor the question "I'm trying to have multiple load balancers - is this possible with mod_jk" doesn't make sense to me...

You can have multiple loadbalancers, each of them using their own mod_jk. But it's got nothing to do with this.

Technically a correct answer to this question would be: Sure - just configure an identical Apache httpd and put it onto the same network, then configure whatever you need (IP failover, Round Robin DNS) to make sure that both loadbalancers now distribute the load. Make sure that the tomcat backends accept enough connections to now serve two loadbalancers.

But mod_jk has, IMHO, nothing to say in that question.