0
votes

I have a host running Tomcat. Updating my web application is quite straight, upload the WAR package of the new web application to the Tomcat's webapps directory, then it is done. However, in the uploading process, the web application becomes invalid, I will get a 404 error if I try to access the web application when the WAR package is uploading. That means I get a short time break. Obviously, this is not good for production environment. How can I do if I want a no-break update?

1

1 Answers

0
votes

Basically, your application is not running until Tomcat fully deploys it. There is no easy way to solve that. Well, not as easy as you put. But, there are ways to avoid that.

You need to have more than one Tomcat instance running. You need to make sure one will be up until the other can server the application. Two terms that can help you: Load Balance and Cluster. They might overlap each other but they are two different things, specially in Tomcat world.

You could try to bind your Tomcat with an Apache HTTP or any other web server, reverse proxy your application (let's say /app1) and when you need to deploy a new version, you would deploy the application under a new context (/app2) and redirect to the new context (Apache reverse proxy /app2 instead of /app1).

That is one way to do it with one host. You just need to be creative. :) Searching for Load Balance and/or Cluster might give you other ideas as well.

Please feel free to ask more as you question was quite generic and you didn't provide much more information. :)