You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Sivapatham, Hari" <HS...@empirix.com> on 2008/11/05 18:10:18 UTC

Designing tomcat failover

Hello,
I have to design a failover setup and I am looking for rough
ideas/pointers. Here is our scenario...
 
TomcatServer1  <-------/Cannot communicate to one another/----->
TomcatServer2(hot backup)
       ^         ^
^
       |           \
| 
        |             \                      --- TO DO: Switch to
TomcatServer2 if server 1 is down---|
        |               \                   /
TomcatClient1     TomcatClient2
 
(Following text simply puts the above picture in words, in case it
doesnt show up aligned on some email clients)
- TomcatServer1 is a 5.5 tomcat that provides services. Its clients are
other tomcat instances (say TomcatClient1, TomcatClient2). 
- We have a redundant TomcatServer2 that is a hot backup for server1. 
- For simplicity sake, we can assume that there is no need to share
session information among TomcatServer1 and TomcatServer2. Also, for
practical reasons, we cannot have any communication between them (our
clients would resist opening up ports).
 
Our applications on TomcatClient1 and TomcatClient2 are configured to
talk to TomcatServer1. The task at hand is, the client tomcat instances
should automatically switch to TomcatServer2 if they detect that
TomcatServer1 is down. 
 
So, I am looking for a failover solution for outgoing requests from
TomcatClient1 and TomcatClient2. The only option I have right now is for
our apps to handle the failover. I wanted to check if there is some
module that I can use (filter/valve/apache module) that would handle the
failover.
 
I appreciate any ideas you might suggest.
Thanks!
Hari
 
 

RE: Designing tomcat failover

Posted by "Sivapatham, Hari" <HS...@empirix.com>.
Hi Leandro,
Your solution seems to be exactly what I was looking for. Could you please explain more about what you had in mind about the wrapper? Is there a standard I can use (like a valve or filter) or is it custom one? I assume that the wrapper will be used at the tomcat level and is outside the scope of my app.

Thanks again for taking the time to answer the question!
Cheers
Hari 

-----Original Message-----
From: Leandro Dardini [mailto:l.dardini@comune.prato.it] 
Sent: Thursday, November 06, 2008 3:04 AM
To: Tomcat Users List
Subject: R: Designing tomcat failover

 

> -----Messaggio originale-----
> Da: Sivapatham, Hari [mailto:HSivapatham@empirix.com]
> Inviato: mercoledì 5 novembre 2008 18.10
> A: users@tomcat.apache.org
> Oggetto: Designing tomcat failover
> 
> Hello,
> I have to design a failover setup and I am looking for rough 
> ideas/pointers. Here is our scenario...
>  
> TomcatServer1  <-------/Cannot communicate to one another/-----> 
> TomcatServer2(hot backup)
>        ^         ^
> ^
>        |           \
> | 
>         |             \                      --- TO DO: Switch to
> TomcatServer2 if server 1 is down---|
>         |               \                   /
> TomcatClient1     TomcatClient2
>  
> (Following text simply puts the above picture in words, in case it 
> doesnt show up aligned on some email clients)
> - TomcatServer1 is a 5.5 tomcat that provides services. Its clients 
> are other tomcat instances (say TomcatClient1, TomcatClient2).
> - We have a redundant TomcatServer2 that is a hot backup for server1. 
> - For simplicity sake, we can assume that there is no need to share 
> session information among TomcatServer1 and TomcatServer2. Also, for 
> practical reasons, we cannot have any communication between them (our 
> clients would resist opening up ports).
>  
> Our applications on TomcatClient1 and TomcatClient2 are configured to 
> talk to TomcatServer1. The task at hand is, the client tomcat 
> instances should automatically switch to
> TomcatServer2 if they detect that
> TomcatServer1 is down. 
>  
> So, I am looking for a failover solution for outgoing requests from
> TomcatClient1 and TomcatClient2. The only option I have right now is 
> for our apps to handle the failover. I wanted to check if there is 
> some module that I can use (filter/valve/apache
> module) that would handle the failover.
>  
> I appreciate any ideas you might suggest.
> Thanks!
> Hari
>  
>  
> 

The simplest solution popping in my mind is to use a wrapper on tomcatclient1 and tomcatclient2 togheter with a "mon" probe. You can configure tomcatclient1 to talk to a local wrapper who send the connection to tomcatserver1. The same on tomcatclient2. The "mon" probe will test the connection to tomcatserver1 and if it detects a failure it reconfigure the wrapper to let the connection go to tomcatserver2. 

Let me know if you'd like more details on this.

Leandro

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


R: Designing tomcat failover

Posted by Leandro Dardini <l....@comune.prato.it>.
 

> -----Messaggio originale-----
> Da: Sivapatham, Hari [mailto:HSivapatham@empirix.com] 
> Inviato: mercoledì 5 novembre 2008 18.10
> A: users@tomcat.apache.org
> Oggetto: Designing tomcat failover
> 
> Hello,
> I have to design a failover setup and I am looking for rough 
> ideas/pointers. Here is our scenario...
>  
> TomcatServer1  <-------/Cannot communicate to one 
> another/-----> TomcatServer2(hot backup)
>        ^         ^
> ^
>        |           \
> | 
>         |             \                      --- TO DO: Switch to
> TomcatServer2 if server 1 is down---|
>         |               \                   /
> TomcatClient1     TomcatClient2
>  
> (Following text simply puts the above picture in words, in 
> case it doesnt show up aligned on some email clients)
> - TomcatServer1 is a 5.5 tomcat that provides services. Its 
> clients are other tomcat instances (say TomcatClient1, 
> TomcatClient2). 
> - We have a redundant TomcatServer2 that is a hot backup for server1. 
> - For simplicity sake, we can assume that there is no need to 
> share session information among TomcatServer1 and 
> TomcatServer2. Also, for practical reasons, we cannot have 
> any communication between them (our clients would resist 
> opening up ports).
>  
> Our applications on TomcatClient1 and TomcatClient2 are 
> configured to talk to TomcatServer1. The task at hand is, the 
> client tomcat instances should automatically switch to 
> TomcatServer2 if they detect that
> TomcatServer1 is down. 
>  
> So, I am looking for a failover solution for outgoing requests from
> TomcatClient1 and TomcatClient2. The only option I have right 
> now is for our apps to handle the failover. I wanted to check 
> if there is some module that I can use (filter/valve/apache 
> module) that would handle the failover.
>  
> I appreciate any ideas you might suggest.
> Thanks!
> Hari
>  
>  
> 

The simplest solution popping in my mind is to use a wrapper on tomcatclient1 and tomcatclient2 togheter with a "mon" probe. You can configure tomcatclient1 to talk to a local wrapper who send the connection to tomcatserver1. The same on tomcatclient2. The "mon" probe will test the connection to tomcatserver1 and if it detects a failure it reconfigure the wrapper to let the connection go to tomcatserver2. 

Let me know if you'd like more details on this.

Leandro

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org