You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jerry Malcolm <te...@malcolms.com> on 2016/05/05 18:56:49 UTC

Auto-bounce a host or webapp?

I am not using WAR files for my apps.  I simply copy updated files to 
the image in \webapps as changes/updates are required.  I have a server 
running on my local dev machine.  When I refresh any webapp file (jars, 
jsps, etc) the server detects the changes, refreshes, and everything is 
good with the new versions running without further intervention.  
However, when I do the exact same thing to my remote server (which is an 
identical mirror of the local TC) almost every time there is a refresh, 
the server webapp stops, and I have to go the manager and restart all of 
the web apps.

I'm suspecting that it might have something to do with the upload 
speed.  Where I can pretty much instantly replace a jar file locally, it 
may take several seconds to replace the same jar file on the remote 
machine due to connection speed to the server.  And I assume TC is ok 
with 'instant' jar replacements, but doesn't like it when it takes too 
long for a jar to finish updating.

Whatever the cause, I've resigned myself to the fact that I'm going to 
have to restart the webapps after every upload.  But I'd love to figure 
out a way to do that automatically (preferably as part of my ant 'build' 
script).  A full refresh can take 20-30 minutes (I have lots of large 
web apps...).  I have to wait around for the upload to complete, else 
the server will be down until I can come back and around and refresh.

So, is there a way to bounce an entire host programatically at the end 
of the upload?  Or is there a way to remotely via a script to bounce all 
of the webapps?

Thx.

Jerry


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


Re: Auto-bounce a host or webapp?

Posted by Anthony Biacco <ab...@handll.com>.
On Fri, May 6, 2016 at 11:05 AM, Jerry Malcolm <te...@malcolms.com>
wrote:

> My web apps are very large.  Typically I only need to refresh a jar file
> or two.  If I went to the WAR approach, I'd have to be uploading several
> hundred MB for each web app every time even if only a small jar actually
> was being replaced.   I really want to stay with the incremental refresh
> approach.
>
> I will look at the program-friendly manager stuff and see if I can make
> that work for me.
>
> Thanks.
>
> Jerry
>
>
I don't know how you upload your files to the app server, but maybe you can
use rsync with the --temp-dir option to specify a scratch dir on the remote
host that the files will go to before their final webapp destination.

if you don't want to use rsync, then maybe uploading to a temp dir and
running a remote command over ssh with pubkey authentication to move the
files.

your-upload-command && ssh -i key.pem user@host "mv tmp-dir/file webapp-dir"

obviously you'd have to play around with the file/directory logic and maybe
not using the tomcat user to ssh, but an upload user in the tomcat group

-Tony


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

Re: Auto-bounce a host or webapp?

Posted by Jerry Malcolm <te...@malcolms.com>.
On 5/6/2016 8:54 AM, Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jerry,
>
> On 5/6/16 1:01 AM, Jerry Malcolm wrote:
>> On 5/5/2016 2:05 PM, David kerber wrote:
>>> On 5/5/2016 2:56 PM, Jerry Malcolm wrote:
>>>> I am not using WAR files for my apps.  I simply copy updated
>>>> files to the image in \webapps as changes/updates are required.
>>>> I have a server running on my local dev machine.  When I
>>>> refresh any webapp file (jars, jsps, etc) the server detects
>>>> the changes, refreshes, and everything is good with the new
>>>> versions running without further intervention. However, when I
>>>> do the exact same thing to my remote server (which is an
>>>> identical mirror of the local TC) almost every time there is a
>>>> refresh, the server webapp stops, and I have to go the manager
>>>> and restart all of the web apps.
>>>>
>>>> I'm suspecting that it might have something to do with the
>>>> upload speed.  Where I can pretty much instantly replace a jar
>>>> file locally, it may take several seconds to replace the same
>>>> jar file on the remote machine due to connection speed to the
>>>> server.  And I assume TC is ok with 'instant' jar replacements,
>>>> but doesn't like it when it takes too long for a jar to finish
>>>> updating.
>>>>
>>>> Whatever the cause, I've resigned myself to the fact that I'm
>>>> going to have to restart the webapps after every upload.  But
>>>> I'd love to figure out a way to do that automatically
>>>> (preferably as part of my ant 'build' script).  A full refresh
>>>> can take 20-30 minutes (I have lots of large web apps...).  I
>>>> have to wait around for the upload to complete, else the server
>>>> will be down until I can come back and around and refresh.
>>>>
>>>> So, is there a way to bounce an entire host programatically at
>>>> the end of the upload?  Or is there a way to remotely via a
>>>> script to bounce all of the webapps?
>>> I believe the Manager app can force a reload of your webapps,
>>> though I never use it.
>>>
>>> But what about this, to make the process more closely mirror what
>>> you see locally:  Upload the updated files to a temporary holding
>>> spot on the remote server, and then after they're all there, move
>>> them en-mass to the webapps directory.  That final copy will be
>>> very fast, and would likely allow the server to pick up the
>>> changes just like it does locally.
>>>
>> Thanks for the info.  I had thought about the option of caching on
>> the server and doing a fast copy.  But that will still require code
>> on the server to execute the copy from the cache, and somehow the
>> server code will need to be triggered by the build/upload process
>> on the build machine or otherwise I have to log onto the server
>> desktop and run it manually.  My build/upload process is totally
>> automated using ant except for this one nagging issue with the
>> webapps.
>>
>> The manager has the web interface to restart the web apps.  But I
>> have 20 web apps.  And the manager makes me start each web app one
>> at a time and wait for the page to reload before going to next app.
>> Cumbersome at best.
>>
>> Any other suggestions?
> You can use the manager to upload and deploy your web application
> simultaneously. It will handle stashing the WAR file you upload and
> then re-deploying the webapp once it's arrived.
>
> You said you weren't using WAR files, but would it be inconvenient for
> you to just zip-up your applications into WAR files?
>
> - -chris
>
My web apps are very large.  Typically I only need to refresh a jar file 
or two.  If I went to the WAR approach, I'd have to be uploading several 
hundred MB for each web app every time even if only a small jar actually 
was being replaced.   I really want to stay with the incremental refresh 
approach.

I will look at the program-friendly manager stuff and see if I can make 
that work for me.

Thanks.

Jerry

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


Re: Auto-bounce a host or webapp?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jerry,

On 5/6/16 1:01 AM, Jerry Malcolm wrote:
> On 5/5/2016 2:05 PM, David kerber wrote:
>> On 5/5/2016 2:56 PM, Jerry Malcolm wrote:
>>> I am not using WAR files for my apps.  I simply copy updated
>>> files to the image in \webapps as changes/updates are required.
>>> I have a server running on my local dev machine.  When I
>>> refresh any webapp file (jars, jsps, etc) the server detects
>>> the changes, refreshes, and everything is good with the new
>>> versions running without further intervention. However, when I
>>> do the exact same thing to my remote server (which is an 
>>> identical mirror of the local TC) almost every time there is a
>>> refresh, the server webapp stops, and I have to go the manager
>>> and restart all of the web apps.
>>> 
>>> I'm suspecting that it might have something to do with the
>>> upload speed.  Where I can pretty much instantly replace a jar
>>> file locally, it may take several seconds to replace the same
>>> jar file on the remote machine due to connection speed to the
>>> server.  And I assume TC is ok with 'instant' jar replacements,
>>> but doesn't like it when it takes too long for a jar to finish
>>> updating.
>>> 
>>> Whatever the cause, I've resigned myself to the fact that I'm
>>> going to have to restart the webapps after every upload.  But
>>> I'd love to figure out a way to do that automatically
>>> (preferably as part of my ant 'build' script).  A full refresh
>>> can take 20-30 minutes (I have lots of large web apps...).  I
>>> have to wait around for the upload to complete, else the server
>>> will be down until I can come back and around and refresh.
>>> 
>>> So, is there a way to bounce an entire host programatically at
>>> the end of the upload?  Or is there a way to remotely via a
>>> script to bounce all of the webapps?
>> 
>> I believe the Manager app can force a reload of your webapps,
>> though I never use it.
>> 
>> But what about this, to make the process more closely mirror what
>> you see locally:  Upload the updated files to a temporary holding
>> spot on the remote server, and then after they're all there, move
>> them en-mass to the webapps directory.  That final copy will be
>> very fast, and would likely allow the server to pick up the
>> changes just like it does locally.
>> 
> Thanks for the info.  I had thought about the option of caching on
> the server and doing a fast copy.  But that will still require code
> on the server to execute the copy from the cache, and somehow the
> server code will need to be triggered by the build/upload process
> on the build machine or otherwise I have to log onto the server
> desktop and run it manually.  My build/upload process is totally
> automated using ant except for this one nagging issue with the
> webapps.
> 
> The manager has the web interface to restart the web apps.  But I
> have 20 web apps.  And the manager makes me start each web app one
> at a time and wait for the page to reload before going to next app.
> Cumbersome at best.
> 
> Any other suggestions?

You can use the manager to upload and deploy your web application
simultaneously. It will handle stashing the WAR file you upload and
then re-deploying the webapp once it's arrived.

You said you weren't using WAR files, but would it be inconvenient for
you to just zip-up your applications into WAR files?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlcsogkACgkQ9CaO5/Lv0PDCwACgm8vyVtVb6mdLfwGvdtwn3keF
u10AoKOsl/1x1NeOqH7yvQ93iyqF0fOS
=AqYt
-----END PGP SIGNATURE-----

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


Re: Auto-bounce a host or webapp?

Posted by "André Warnier (tomcat)" <aw...@ice-sa.com>.
On 06.05.2016 07:01, Jerry Malcolm wrote:
> On 5/5/2016 2:05 PM, David kerber wrote:
>> On 5/5/2016 2:56 PM, Jerry Malcolm wrote:
>>> I am not using WAR files for my apps.  I simply copy updated files to
>>> the image in \webapps as changes/updates are required.  I have a server
>>> running on my local dev machine.  When I refresh any webapp file (jars,
>>> jsps, etc) the server detects the changes, refreshes, and everything is
>>> good with the new versions running without further intervention.
>>> However, when I do the exact same thing to my remote server (which is an
>>> identical mirror of the local TC) almost every time there is a refresh,
>>> the server webapp stops, and I have to go the manager and restart all of
>>> the web apps.
>>>
>>> I'm suspecting that it might have something to do with the upload
>>> speed.  Where I can pretty much instantly replace a jar file locally, it
>>> may take several seconds to replace the same jar file on the remote
>>> machine due to connection speed to the server.  And I assume TC is ok
>>> with 'instant' jar replacements, but doesn't like it when it takes too
>>> long for a jar to finish updating.
>>>
>>> Whatever the cause, I've resigned myself to the fact that I'm going to
>>> have to restart the webapps after every upload.  But I'd love to figure
>>> out a way to do that automatically (preferably as part of my ant 'build'
>>> script).  A full refresh can take 20-30 minutes (I have lots of large
>>> web apps...).  I have to wait around for the upload to complete, else
>>> the server will be down until I can come back and around and refresh.
>>>
>>> So, is there a way to bounce an entire host programatically at the end
>>> of the upload?  Or is there a way to remotely via a script to bounce all
>>> of the webapps?
>>
>> I believe the Manager app can force a reload of your webapps, though I never use it.
>>
>> But what about this, to make the process more closely mirror what you see locally:
>> Upload the updated files to a temporary holding spot on the remote server, and then
>> after they're all there, move them en-mass to the webapps directory.  That final copy
>> will be very fast, and would likely allow the server to pick up the changes just like it
>> does locally.
>>
> Thanks for the info.  I had thought about the option of caching on the server and doing a
> fast copy.  But that will still require code on the server to execute the copy from the
> cache, and somehow the server code will need to be triggered by the build/upload process
> on the build machine or otherwise I have to log onto the server desktop and run it
> manually.  My build/upload process is totally automated using ant except for this one
> nagging issue with the webapps.
>
> The manager has the web interface to restart the web apps.  But I have 20 web apps.  And
> the manager makes me start each web app one at a time and wait for the page to reload
> before going to next app. Cumbersome at best.
>

The Manager also has a "program-friendly text interface", see :
http://tomcat.apache.org/tomcat-8.0-doc/manager-howto.html#Configuring_Manager_Application_Access
--> List Currently Deployed Applications  (e.g.)
So, at the least, you could write some simple script which could trigger this remotely.
A scripting language like Perl or Python would be ideal for that kind of thing.
Just make sure that you properly secure the access to the Manager app.



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


Re: Auto-bounce a host or webapp?

Posted by Jerry Malcolm <te...@malcolms.com>.
On 5/5/2016 2:05 PM, David kerber wrote:
> On 5/5/2016 2:56 PM, Jerry Malcolm wrote:
>> I am not using WAR files for my apps.  I simply copy updated files to
>> the image in \webapps as changes/updates are required.  I have a server
>> running on my local dev machine.  When I refresh any webapp file (jars,
>> jsps, etc) the server detects the changes, refreshes, and everything is
>> good with the new versions running without further intervention.
>> However, when I do the exact same thing to my remote server (which is an
>> identical mirror of the local TC) almost every time there is a refresh,
>> the server webapp stops, and I have to go the manager and restart all of
>> the web apps.
>>
>> I'm suspecting that it might have something to do with the upload
>> speed.  Where I can pretty much instantly replace a jar file locally, it
>> may take several seconds to replace the same jar file on the remote
>> machine due to connection speed to the server.  And I assume TC is ok
>> with 'instant' jar replacements, but doesn't like it when it takes too
>> long for a jar to finish updating.
>>
>> Whatever the cause, I've resigned myself to the fact that I'm going to
>> have to restart the webapps after every upload.  But I'd love to figure
>> out a way to do that automatically (preferably as part of my ant 'build'
>> script).  A full refresh can take 20-30 minutes (I have lots of large
>> web apps...).  I have to wait around for the upload to complete, else
>> the server will be down until I can come back and around and refresh.
>>
>> So, is there a way to bounce an entire host programatically at the end
>> of the upload?  Or is there a way to remotely via a script to bounce all
>> of the webapps?
>
> I believe the Manager app can force a reload of your webapps, though I 
> never use it.
>
> But what about this, to make the process more closely mirror what you 
> see locally:  Upload the updated files to a temporary holding spot on 
> the remote server, and then after they're all there, move them en-mass 
> to the webapps directory.  That final copy will be very fast, and 
> would likely allow the server to pick up the changes just like it does 
> locally.
>
Thanks for the info.  I had thought about the option of caching on the 
server and doing a fast copy.  But that will still require code on the 
server to execute the copy from the cache, and somehow the server code 
will need to be triggered by the build/upload process on the build 
machine or otherwise I have to log onto the server desktop and run it 
manually.  My build/upload process is totally automated using ant except 
for this one nagging issue with the webapps.

The manager has the web interface to restart the web apps.  But I have 
20 web apps.  And the manager makes me start each web app one at a time 
and wait for the page to reload before going to next app. Cumbersome at 
best.

Any other suggestions?

Thanks.

Jerry

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


Re: Auto-bounce a host or webapp?

Posted by David kerber <dc...@verizon.net>.
On 5/5/2016 2:56 PM, Jerry Malcolm wrote:
> I am not using WAR files for my apps.  I simply copy updated files to
> the image in \webapps as changes/updates are required.  I have a server
> running on my local dev machine.  When I refresh any webapp file (jars,
> jsps, etc) the server detects the changes, refreshes, and everything is
> good with the new versions running without further intervention.
> However, when I do the exact same thing to my remote server (which is an
> identical mirror of the local TC) almost every time there is a refresh,
> the server webapp stops, and I have to go the manager and restart all of
> the web apps.
>
> I'm suspecting that it might have something to do with the upload
> speed.  Where I can pretty much instantly replace a jar file locally, it
> may take several seconds to replace the same jar file on the remote
> machine due to connection speed to the server.  And I assume TC is ok
> with 'instant' jar replacements, but doesn't like it when it takes too
> long for a jar to finish updating.
>
> Whatever the cause, I've resigned myself to the fact that I'm going to
> have to restart the webapps after every upload.  But I'd love to figure
> out a way to do that automatically (preferably as part of my ant 'build'
> script).  A full refresh can take 20-30 minutes (I have lots of large
> web apps...).  I have to wait around for the upload to complete, else
> the server will be down until I can come back and around and refresh.
>
> So, is there a way to bounce an entire host programatically at the end
> of the upload?  Or is there a way to remotely via a script to bounce all
> of the webapps?

I believe the Manager app can force a reload of your webapps, though I 
never use it.

But what about this, to make the process more closely mirror what you 
see locally:  Upload the updated files to a temporary holding spot on 
the remote server, and then after they're all there, move them en-mass 
to the webapps directory.  That final copy will be very fast, and would 
likely allow the server to pick up the changes just like it does locally.


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