> From: "Faine, Mark" <[EMAIL PROTECTED]>
> Sent: Wednesday, May 11, 2005 11:24 AM

> Tomcat 5.0.28
>
> We seem to often have to make minor changes that cause us to have to
restart
> our tomcat server (the whole server, not just a web application) and this
> has lead me to decide to research load balancing.  The idea would be to
have
> two servers that would be exact duplicates.  One of the servers would only
> become available when the other was not running.  This way we could make
the
> change on server2 (and restart it) and then bring server1 down and make
the
> change to it as well.  This would prevent any real downtime for our users.
> Where should I look for info on how to implement this type of failover?
> Thanks for your help

Yeah, it's a mix of load balancing and clustering.

The primary challenge you have to deal with is session replication so that
when you fail your primary Tomcat, the stand by will have the same sessions
in play.

Once you have the sessions clustered, then it's a matter of redirecting
traffic from the primary to secondary.

This is what a load balancer system can do for you, in that it can help you
cleanly switch over.

What you need to do here is tell the load balancer to direct all new traffic
to the secondary Tomcat, but still let any pending transactions go to your
primary.

Once the load balancer has shifted the traffic, you bounce the primary, let
the primary add itself back in to your cluster and resynchronize the
sessions, then you finally have the load balancer start shifting traffic
back to the primary.

Now, note that at some point during your switchover, you will be having both
Tomcats live and working against the same DB or whatever your backend, so
you need to make sure that it can handle that (if it's just a DB it's
typically not a problem).

Finally, once you've gone to all of this trouble, frankly, I'd just run both
machines 100% and load balance between them, either round robin, or you can
use session pinning (so that when a request comes in, their session sticks
to a single machine barring machine failure).

The reason I would do this is simply that I'm just philisophically opposed
to having idle machines do nothing and waiting for something to happen. To
me, an idle machine is simply a room heater. I don't need a $2000 room
heater.

In this case, since you need to have cluster aware sessions and replication
anyway, and you have to have a load balancer fronting them anyway, why not
simply double your performance (ideally) and run both machines if you're
going to keep one idle anyway? You have to go through all the configuration
headache anyway, so you may as well get some free performance out of it.

It is my understanding that you can do most of this with 3 machines and
stock Tomcat, as it already supports clustering, and there is a
load-balancing application as well, but I don't know how good or featureful
the load balancer is. Of course, you can do a function test on only a single
machine with 3 interfaces as well.

Regards,

Will Hartung
([EMAIL PROTECTED])



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to