Re: pushing updates to a running tomcat instance

2012-10-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

S Ahmed,

On 10/15/12 3:59 PM, S Ahmed wrote:
> so when you don't have reloads enabled, any updates (copying a new
> version of a .jar) to a folder will not do anything?

Correct: Tomcat will basically ignore them. If you update a class file
(or JAR file) before Tomcat loads it, then when it gets loaded,
obviously it will get the latest one from the disk.

> This is a spring mvc application, and I'm scared of leaks via
> logging etc., I'll take the safe route and just recycle or whatever
> I have to do.

That's one of the reasons I don't want the webapp auto-reloading
without my explicit action.

> I have to explicitly start/stop the service if am doing this via
> the command line?

That depends upon how you want everything to work. If you use the
manager webapp, you can point-and-click the re-deployment. You can
also script the redeployment using the ant tasks that Tomcat provides
for working with the manager app. Or, you can just use the REST-based
API to do the same thing (the ant tasks are just a wrapper around the
REST-based API).

Or, you can restart Tomcat entirely if that's what you want to do.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlB9qZQACgkQ9CaO5/Lv0PA/sACgopOKfJFLepusk05S3OKNtybn
8U4AoI3MkjRBYZ+lH8RXx4ZM6MLhBS5Q
=gHYN
-END PGP SIGNATURE-

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



Re: pushing updates to a running tomcat instance

2012-10-15 Thread S Ahmed
so when you don't have reloads enabled, any updates (copying a new version
of a .jar) to a folder will not do anything?

This is a spring mvc application, and I'm scared of leaks via logging etc.,
I'll take the safe route and just recycle or whatever I have to do.

I have to explicitly start/stop the service if am doing this via the
command line?

On Mon, Oct 15, 2012 at 12:45 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> S Ahmed,
>
> On 10/15/12 11:39 AM, S Ahmed wrote:
> > So when I have my server setup with tomcat, I normally do this
> > first:
> >
> > sudo mv /var/lib/tomcat6/webapps/ROOT/
> > /var/lib/tomcat6/webapps/old_ROOT
> >
> > I then move my .war file:
> >
> > sudo cp hello_world_war.war
> > /var/lib/tomcat6/webapps/hello_world_war.war
>
> If you have a large WAR file, you might want to copy it somewhere else
> first, then 'mv' it. Otherwise, Tomcat might attempt to re-deploy the
> WAR file before the copy is complete. Maybe:
>
> sudo cp hello_world_war.war /var/lib/tomcat6/staging/hello_world_war.war
> sudo mv /var/lib/tomcat6/webapps/hello_world_war.war \
> /var/lib/tomcat6/webapps/hello_world_war.war
> sudo mv /var/lib/tomcat6/staging/hello_world_war.war \
> /var/lib/tomcat6/webapps/hello_world_war.war
>
> > And everything works as expected for me.
> >
> > Now say locally in development I update a .jar file, and I want to
> > push a hotfix to my server.
> >
> > What is the best way to do this? If I simply ftp the file and copy
> > it to the correct folder in my expanded war, will that suffice w/o
> > downtime?
>
> There is always some measurable "downtime" here, even if it is just
> that requests are queued while the webapp reloads.
>
> I usually don't run in production with 'reloadable' enabled because a)
> I don't want any surprise reloads and b) I don't want to waste any
> resources checking for file updates.
>
> If you are not enabling 'reloadable' and want to reload the context,
> consider using the manager webapp to explicitly reload the context.
> During the reload, Tomcat should queue all requests to the reloading
> webapp and allow them to continue once the webapp has relaoded.
>
> Just make sure that the webapp a) doesn't leak any resources when it
> reloads and b) doesn't take forever to reload.
>
> Hope that helps,
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlB8PakACgkQ9CaO5/Lv0PAtsQCeKRhKXcTtJkCd1JQ5AsIP6uzY
> 7l0An14ZjVnzD4OsVxIhB30LT7l3Pzze
> =1aiJ
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: pushing updates to a running tomcat instance

2012-10-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

S Ahmed,

On 10/15/12 11:39 AM, S Ahmed wrote:
> So when I have my server setup with tomcat, I normally do this
> first:
> 
> sudo mv /var/lib/tomcat6/webapps/ROOT/
> /var/lib/tomcat6/webapps/old_ROOT
> 
> I then move my .war file:
> 
> sudo cp hello_world_war.war
> /var/lib/tomcat6/webapps/hello_world_war.war

If you have a large WAR file, you might want to copy it somewhere else
first, then 'mv' it. Otherwise, Tomcat might attempt to re-deploy the
WAR file before the copy is complete. Maybe:

sudo cp hello_world_war.war /var/lib/tomcat6/staging/hello_world_war.war
sudo mv /var/lib/tomcat6/webapps/hello_world_war.war \
/var/lib/tomcat6/webapps/hello_world_war.war
sudo mv /var/lib/tomcat6/staging/hello_world_war.war \
/var/lib/tomcat6/webapps/hello_world_war.war

> And everything works as expected for me.
> 
> Now say locally in development I update a .jar file, and I want to
> push a hotfix to my server.
> 
> What is the best way to do this? If I simply ftp the file and copy
> it to the correct folder in my expanded war, will that suffice w/o
> downtime?

There is always some measurable "downtime" here, even if it is just
that requests are queued while the webapp reloads.

I usually don't run in production with 'reloadable' enabled because a)
I don't want any surprise reloads and b) I don't want to waste any
resources checking for file updates.

If you are not enabling 'reloadable' and want to reload the context,
consider using the manager webapp to explicitly reload the context.
During the reload, Tomcat should queue all requests to the reloading
webapp and allow them to continue once the webapp has relaoded.

Just make sure that the webapp a) doesn't leak any resources when it
reloads and b) doesn't take forever to reload.

Hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlB8PakACgkQ9CaO5/Lv0PAtsQCeKRhKXcTtJkCd1JQ5AsIP6uzY
7l0An14ZjVnzD4OsVxIhB30LT7l3Pzze
=1aiJ
-END PGP SIGNATURE-

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