On 16/01/2019 10:26, Vinu Vibhu Sobhana wrote:
> Hai,
> 
> Iam new to mailing list and I apologize in advance if this is not the
> correct place..

Welcome to the Tomcat community. No need to apologise. And you are in
the right place.

> I am a system administrator and my development team creates application
> in JAVA that are been hosted on tomcat web-servers. While hosting the
> application, I was asked to explore the feasibility on the below
> points
> 
> 1. Can I have centralized web-apps directory for multiple tomcat
> instances hosted on the same or different servers. ie tomcat1 running
> on server1 and tomcat2 running on server2. Both servers are been
> assigned a common storage folder (via NFS) named "webstore" which has
> been mapped to both servers webapps directories. Now my query is upon
> starting tomcat instances on both servers, I should receive a working
> instance of my application on both servers.>
> Is this possible in any way or is there any other recommended method
> that I should follow. Providing individual webapps folder to all
> tomcat instances would be a waste of storage space for our project as
> our application warsize is large. I have searched the internet and
> found nothing clarifying my point. Hence I though to post here and
> collect your vaild comments.

It is possible but not generally recommended.

Experience of shared network storage is that it is not 100% reliable. If
the Tomcat server's connection to the shared server drops, then all the
applications will be undeployed on that Tomcat instance.

Reliable network storage is available but it is generally significantly
more expensive to purchase and even more expensive to maintain than
simply buying a few TB of local disk storage for each Tomcat instance.

Other factors to bear in mind:
- running from a WAR is slower than running from an unpacked directory
- you can't have multiple Tomcat instances unpacking WARs into the same
  shared storage
- your options are:
  1) Run web apps from WARs on shared storage (slow plus see above)
  2) Run web apps from unpacked diretcories on shared storage
     (see above)
  3) Have the web apps in shares storage but have each Tomcat instance
     unpack them to local disk (may as well use local disk in the first
     place)

> 2. Deploying a patched/updated web application to the current live
> production tomcat server should require least deployment time. For us,
> it takes too long to update the web application war file on most of
> our servers. Hence we have to shutdown the server, update the new war
> file and then starts up tomcat. Is there any best practices that I
> should follow so that I can reduce the deployment time to minimum.

Parallel deployment should help with that.

http://tomcat.apache.org/tomcat-9.0-doc/config/context.html

Roughly it works like this:

- deploy app##001.war
- users get directed to version 001
- deploy app##002.war
- once that web application starts any new users (i.e. new HTTP
  sessions) will be directed to version 002. Users with sessions in
  version 001 will continue to be directed to version 001.
- undeploy version 001 once all the sessions have expired (Tomcat can do
  this for you automatically)
- repeat for app##003.war, app##004.war etc

It also works in a cluster.

HTH,

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to