0

Can one tomcat instance (with an ajp connector) be accessed by two different loadbalancers (httpd+mod_jk)?

Thanks!

  • 1
    the goal of having Loadbalancers is to share (balance) load on multiple application/service nodes and not having a single node being available through multiple lb's – m0ntassar Aug 13 '12 at 09:10

3 Answers3

1

Possible but futile, in fact completely pointless. The load balancers won't know about each other, so they will make wrong decisions about the load on the Tomcat in question, so they won't load-balance at all. Instead they will overload the shared Tomcat.

user207421
  • 1,010
  • 6
  • 16
  • The idea is to have a primary loadbalancer and a backup one. Both would be running at the same time; but only the primary would be serving request. If it fails, a virtual IP would float to the backup LB. –  Aug 14 '12 at 08:55
0

I guess that you're going to build Tomcat servers with high availability, something like this:

+------------+  (VIP)  +------------+
|  Apache 1  |---------|  Apache 2  |
+------------+         +------------+
        |(mod_jk)            |(mod_jk)
     +---------------------------+
    |                             |
+-----------+            +-----------+   
| Tomcat 1  |            | Tomcat 2  |
+-----------+            +-----------+

If so, I'm pretty sure you can because at a momment, you'e working with only one LB via virtual IP.

quanta
  • 51,413
  • 19
  • 159
  • 217
  • That's exactly what i'm planning to do. But I'd like to have both HTTPd running all the time, so that there is no down time when the Apache1 fails and the IP floats to Apache2. –  Aug 14 '12 at 08:59
  • Do it and let us know if you have any problem. The downtime ~ 10 seconds if you use a cluster management such as Pacemaker. – quanta Aug 14 '12 at 09:03
  • As a matter of fact, I've prototyped this architecture. It's been running for two weeks in our preproduction environment. No pb so far but maybe i've been lucky... I'd like some official reference saying that it's ok to do it; but couldn't find on Tomcat's site. –  Aug 14 '12 at 09:09
0

I have several customers using Equalizer hardware load balancers in front of Apache/Tomcat in exactly this configuration. Does your application have any persistence requirements (Client must always be directed to the same server)? If yes, configuring the LBs persistence properly is the only potential issue I can see. You should be on safe ground.