简体   繁体   中英

Fallback Load balancer with apache mod_jk, tomcat

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM