You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Zemian Deng <ke...@gmail.com> on 2008/03/28 14:38:09 UTC

what's your best way to redeploy webapp with least amount of downtime?

Hello list,

I have two instances of Tomcat running the same webapp behind a load
balancer. My current redeployment method is just simply shut one instance
down(undeploy), replace warfile, deploy latest war back online, and then
proceed to the seond instance.

This works most of the time, but for those users who are happens on the
instances I shut down, they lost the session at best, and lost a form
submission while middle of request at worst.

Can you share your story of how you solve your redeployment problem to keep
max availability of your webapp?

Thanks,
Zemian Deng

Re: what's your best way to redeploy webapp with least amount of downtime?

Posted by Mark Thomas <ma...@apache.org>.
Zemian Deng wrote:
> Hi Mark,
> How do you "- disable worker1" and still let Tomcat1 to process remaining
> requests? I guess I am not sure what "worker1" is, where to disable that.
> Can you explain little more on this?

I was assuming you were using httpd and mod_jk or mod_proxy_ajp to do the 
load balancing. These use the concept of workers to connect httpd and 
Tomcat which, when disabled allow existing requests to continue to completion.

There is a special worker, the balancer-manager that you use to control 
worker state.

See:
http://tomcat.apache.org/connectors-doc/
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html
http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html

Mark


---------------------------------------------------------------------
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


Re: what's your best way to redeploy webapp with least amount of downtime?

Posted by Zemian Deng <ke...@gmail.com>.
Hi Mark,
How do you "- disable worker1" and still let Tomcat1 to process remaining
requests? I guess I am not sure what "worker1" is, where to disable that.
Can you explain little more on this?

Yes, I have heard of LambdaProbe. I will check this out in more detail
later.

Thanks for sharing.
-Z

On Fri, Mar 28, 2008 at 9:53 AM, Mark Thomas <ma...@apache.org> wrote:

> Zemian Deng wrote:
> > Can you share your story of how you solve your redeployment problem to
> keep
> > max availability of your webapp?
>
> 1. Write stateless apps and where you can't, use sticky sessions and
> clustering.
>
> 2. When upgrading. I:
>  - disable worker1
>  - wait for all requests on Tomcat 1 to complete (LambdaProbe is great for
> monitoring this and a bunch of other stuff)
>  - upgrade Tomcat 1
>  - enable worker 1
>  - repeat for worker 2
>
> Using this approach I never had any downtime associated with an upgrade.
> There were plenty of other causes of downtime ;), but upgrade wasn't one
> of
> them.
>
> Mark
>
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Thanks,
Zemian Deng

Re: what's your best way to redeploy webapp with least amount of downtime?

Posted by Mark Thomas <ma...@apache.org>.
Zemian Deng wrote:
> Can you share your story of how you solve your redeployment problem to keep
> max availability of your webapp?

1. Write stateless apps and where you can't, use sticky sessions and 
clustering.

2. When upgrading. I:
  - disable worker1
  - wait for all requests on Tomcat 1 to complete (LambdaProbe is great for 
monitoring this and a bunch of other stuff)
  - upgrade Tomcat 1
  - enable worker 1
  - repeat for worker 2

Using this approach I never had any downtime associated with an upgrade. 
There were plenty of other causes of downtime ;), but upgrade wasn't one of 
them.

Mark


---------------------------------------------------------------------
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