简体   繁体   English

使用Apache mod_jk,tomcat的后备负载均衡器

[英]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和worker.properties中配置的负载平衡器从两个不同的tomcat实例运行同一应用程序,我能够使用Tomcat 7和Apache mod_jk实现负载平衡。

  • httpd.conf httpd.conf文件
JkMount /myApp/* loadbalancer
  • worker.properties 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. 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. 就您在问题中描述的情况而言,Apache httpd 负载平衡器,它恰好使用mod_jk来完成实际的平衡工作。 If Apache httpd goes away, you'll no longer balance. 如果Apache httpd消失,您将不再平衡。 Therefor the question "I'm trying to have multiple load balancers - is this possible with mod_jk" doesn't make sense to me... 因此,问题“我正在尝试拥有多个负载平衡器-mod_jk是否可能”对我来说就没有意义...

You can have multiple loadbalancers, each of them using their own mod_jk. 您可以有多个负载均衡器,每个负载均衡器都使用自己的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. 从技术上讲,此问题的正确答案是:当然-只需配置一个相同的Apache httpd并将其放置在同一网络上,然后配置所需的任何内容(IP故障转移,Round Robin DNS)以确保两个负载均衡器现在都可以分配负载。 Make sure that the tomcat backends accept enough connections to now serve two loadbalancers. 确保tomcat后端接受足够的连接以现在为两个负载平衡器提供服务。

But mod_jk has, IMHO, nothing to say in that question. 但是恕我直言,mod_jk在该问题上无话可说。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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