----- Original Message -----
From: "Richard M" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Tuesday, August 05, 2008 5:21 AM
Subject: Can two Tomcat's safely share the same webapps directory?
I looked through the documentation and searched the user list and web for
the
answer to this. I found a lot of postings that talked about using NFS
sharing to share the actual Tomcat software directories, but none that
dealt
with trying to share an expanded web application between two instances of
Tomcat Actually one Tomcat instance is on a separate machine - using NFS
to
mount the directory.
Background: This is a legacy application (somewhat of a content management
system) that places user-uploaded files in the web application directory.
The application is not deployed as a WAR file, just the JSP's and classes
directories are updates as needed. No change to change the app in the
short-term. We are trying to move some batch processing to a separate
instance of Tomcat and want both Tomcat's looking at the same webapps
directory so the second Tomcat instance can mostly read, but possibly
update
some of the content files.
Progress: Well so far it seems to work in preliminary testing. Is there
anything or any reason to shy away from this solution? Both Tomcat's will
have separate work directories. The JSP's will run on the first Tomcat
instance, the batch processing on the second.
Thanks in advance for any ideas, thoughts, etc. - Richard
Richard, I got a little Samba link going with a few shared web apps, no high
traffic, but no problems...
Ie sharing a webapp only I think will only give you normal issues... like
for example, if your uploading file is busy writing to a JSP, and that is
viewed at the same time, will probably get a compiler exception... I have
never seen one ;) and you can get uploaders to get the whole file before
writing it to location, so those are normal issues... if it was an html
file, the user may only see half a file, if they just catch it....
But one thing you cannot do, especially on windows is share the catalina
base.... ie the whole TC structure... ie if logs are now trying to share the
same folder, then I think that is definite problems, especially on a MS
system.
A stupid little test I do on windows, is open files with notepad... because
notepad holds the lock... you will see that you can open a JSP in notepad
and TC will still read it... but with log files, you'll see that windows
tells notepad to take a hike... ie one TC owns that log only...
It will work... you just got to think about how you changing files if it
gets really busy... the normal things to worry about..
TC is made... think about the ~user shared folders for example, for one to
drop JSP and html files into it, like say one would when FTPing up to a
site... so you can safely expect that to work.... when it comes to servlet
classes and things like that... then the fun would really start... because
even if you turn on TC's lib change detection, theres dependencies to worry
about etc.... JSP/HTML... no problem... have fun
Of course in your software... you want to make sure you access files read
only and that you dont hold locks... ie if you batch processing software
went an held a JSP file for half an hour... well then TC wouldnt be able to
get at it, should it want to recompile it... normal stuff ;)
---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]