You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeffrey Janner <Je...@PolyDyne.com> on 2015/06/15 16:49:07 UTC

Shutdown port and multiple Tomcat instances

I'm making the switch to running all my tomcats on Linux.
I'm planning to deploy multiple instances per machine, splitting catalina_base and catalina_home, and just have question on the shutdown port.
Under Windows, I just deployed the binary with the commons daemon wrapper and set the shutdown port to -1 and let the daemon manage the orderly shutdown.
Is it possible to set the port to -1 under Linux and do something similar? Preferably without deploying the daemon wrapper also, though I'm willing to do if necessary.  I am planning to manage them with service/init scripts for startup and shutdown.


Jeffrey Janner
Sr. Network Administrator
jeffrey.janner@polydyne.com<ma...@polydyne.com>
PolyDyne Software Inc.
Main:   512.343.9100
Direct:  512.583.8930

 [cid:image002.png@01CC0FB7.4FF43CE0]

Speed, Intelligence & Savings in Sourcing


RE: Shutdown port and multiple Tomcat instances

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
Left out the important bits:
Tomcat 7.x - latest release
Ubuntu 14.04 - though could be any Linux
Java 1.7.0_80

Upgrade to Tomcat 8.x

From: Jeffrey Janner [mailto:Jeffrey.Janner@PolyDyne.com]
Sent: Monday, June 15, 2015 9:49 AM
To: 'Tomcat Users List'
Subject: Shutdown port and multiple Tomcat instances

I'm making the switch to running all my tomcats on Linux.
I'm planning to deploy multiple instances per machine, splitting catalina_base and catalina_home, and just have question on the shutdown port.
Under Windows, I just deployed the binary with the commons daemon wrapper and set the shutdown port to -1 and let the daemon manage the orderly shutdown.
Is it possible to set the port to -1 under Linux and do something similar? Preferably without deploying the daemon wrapper also, though I'm willing to do if necessary.  I am planning to manage them with service/init scripts for startup and shutdown.


Jeffrey Janner
Sr. Network Administrator
jeffrey.janner@polydyne.com<ma...@polydyne.com>
PolyDyne Software Inc.
Main:   512.343.9100
Direct:  512.583.8930

 [cid:image002.png@01CC0FB7.4FF43CE0]

Speed, Intelligence & Savings in Sourcing


RE: Shutdown port and multiple Tomcat instances

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Monday, June 15, 2015 9:51 AM
> To: Tomcat Users List
> Subject: Re: Shutdown port and multiple Tomcat instances
> 
> On 15/06/2015 15:49, Jeffrey Janner wrote:
> > I'm making the switch to running all my tomcats on Linux.
> >
> > I'm planning to deploy multiple instances per machine, splitting
> > catalina_base and catalina_home, and just have question on the
> shutdown
> > port.
> >
> > Under Windows, I just deployed the binary with the commons daemon
> > wrapper and set the shutdown port to -1 and let the daemon manage the
> > orderly shutdown.
> >
> > Is it possible to set the port to -1 under Linux and do something
> > similar? Preferably without deploying the daemon wrapper also, though
> > I'm willing to do if necessary.  I am planning to manage them with
> > service/init scripts for startup and shutdown.
> 
> Yes, "kill -15 <pid>" will trigger a clean shutdown.
> 
> Mark
 
Thanks Mark.
Trying to keep the deployment as clean as possible for the moment.
I'll look some more into the benefits of running Tomcat under the commons daemon at a future date.
As it is, I'm probably going to need to deploy it for a couple of related standalone java apps.
Jeff


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


Re: Shutdown port and multiple Tomcat instances

Posted by Mark Thomas <ma...@apache.org>.
On 15/06/2015 15:49, Jeffrey Janner wrote:
> I’m making the switch to running all my tomcats on Linux.
> 
> I’m planning to deploy multiple instances per machine, splitting
> catalina_base and catalina_home, and just have question on the shutdown
> port.
> 
> Under Windows, I just deployed the binary with the commons daemon
> wrapper and set the shutdown port to -1 and let the daemon manage the
> orderly shutdown.
> 
> Is it possible to set the port to -1 under Linux and do something
> similar? Preferably without deploying the daemon wrapper also, though
> I’m willing to do if necessary.  I am planning to manage them with
> service/init scripts for startup and shutdown.

Yes, "kill -15 <pid>" will trigger a clean shutdown.

Mark


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


RE: Shutdown port and multiple Tomcat instances

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
> -----Original Message-----
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Sent: Monday, June 15, 2015 10:02 AM
> To: Tomcat Users List
> Subject: Re: Shutdown port and multiple Tomcat instances
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Jeffrey,
> 
> On 6/15/15 10:49 AM, Jeffrey Janner wrote:
> > I’m making the switch to running all my tomcats on Linux.
> >
> > I’m planning to deploy multiple instances per machine, splitting
> > catalina_base and catalina_home, and just have question on the
> > shutdown port.
> >
> > Under Windows, I just deployed the binary with the commons daemon
> > wrapper and set the shutdown port to -1 and let the daemon manage
> > the orderly shutdown.
> >
> > Is it possible to set the port to -1 under Linux and do something
> > similar? Preferably without deploying the daemon wrapper also,
> > though I’m willing to do if necessary.  I am planning to manage
> > them with service/init scripts for startup and shutdown.
> 
> The *NIX analog to the Windows Service runner /is/ jsvc.
> 
> I'm curious why you don't want to run jsvc.
> 
> If you don't want to run jsvc, why not pick a unique shutdown port
> number and use the standard scripts?
> 
> We run multiple JVMs on a single machine, and we even (in dev) have
> multiple users with multiple JVMs, etc. *and* we are using mod_jk to
> connect them all, so we have to manage ports carefully.
> 
> We have come up with this method to organize everything:
> 
> 1. Each user has a "user number" -- let's call that "u"
> 2. Each application has an "app number" -- let's call that "a"
> 
> Port numbers now look like this:
> 
> 8ua5 - ajp port for the application
> 8ua6 - shutdown port for the application
> 8ua7 - secure port for loopback requests from other apps
>        (if necessary for the application)
> 
> We have scripts that use these things so a user just has to set up
> their "u" and "a" values properly and everything works. It's also
> possible to predict who will be using what port, and - ignoring typos
> - - nobody has any conflicts.
> 
> - -chris

Thanks for the tips Chris.  That could really come in useful.
I'm not adverse to running jsvc, I'm just under a current time crunch and have something like 50 of these to turn out in short order.  I didn't want to have to mess with getting another layer to work right now.
Jeff

RE: Shutdown port and multiple Tomcat instances

Posted by Jeffrey Janner <Je...@PolyDyne.com>.

> -----Original Message-----
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Sent: Monday, June 15, 2015 10:02 AM
> To: Tomcat Users List
> Subject: Re: Shutdown port and multiple Tomcat instances
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Jeffrey,
> 
> On 6/15/15 10:49 AM, Jeffrey Janner wrote:
> > I’m making the switch to running all my tomcats on Linux.
> >
> > I’m planning to deploy multiple instances per machine, splitting
> > catalina_base and catalina_home, and just have question on the
> > shutdown port.
> >
> > Under Windows, I just deployed the binary with the commons daemon
> > wrapper and set the shutdown port to -1 and let the daemon manage
> > the orderly shutdown.
> >
> > Is it possible to set the port to -1 under Linux and do something
> > similar? Preferably without deploying the daemon wrapper also,
> > though I’m willing to do if necessary.  I am planning to manage
> > them with service/init scripts for startup and shutdown.
> 
> The *NIX analog to the Windows Service runner /is/ jsvc.
> 
> I'm curious why you don't want to run jsvc.
> 
> If you don't want to run jsvc, why not pick a unique shutdown port
> number and use the standard scripts?
> 
> We run multiple JVMs on a single machine, and we even (in dev) have
> multiple users with multiple JVMs, etc. *and* we are using mod_jk to
> connect them all, so we have to manage ports carefully.
> 
> We have come up with this method to organize everything:
> 
> 1. Each user has a "user number" -- let's call that "u"
> 2. Each application has an "app number" -- let's call that "a"
> 
> Port numbers now look like this:
> 
> 8ua5 - ajp port for the application
> 8ua6 - shutdown port for the application
> 8ua7 - secure port for loopback requests from other apps
>        (if necessary for the application)
> 
> We have scripts that use these things so a user just has to set up
> their "u" and "a" values properly and everything works. It's also
> possible to predict who will be using what port, and - ignoring typos
> - - nobody has any conflicts.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> 
> iQIcBAEBCAAGBQJVfuj7AAoJEBzwKT+lPKRYmSwQAKTsfdDArTB62NLzB8XjiQgy
> 8KzChtOr/kcczKyVJ4Q1WVuraqb0Q5QX89HZT9W/LvQQ0t3RDseXf/cLmicPOkAJ
> iR6EFHugvf3RUCQq96uF4Z4Vm8YJkZyx1ZYPbBhE2yxbqKSguDqeuLApwEmlrIiB
> RWhccMg0l8v5Bn8iqlHvCJEZ0593JB3PPK5cCkNvRQi475VWXnWIGHOfQfJT7Me7
> e3bML4+v+mvkFdOsqGU8uRz8YjArDJlUrPYxs1uAMsc0XaURJ+IZCkKWBWL1Pkem
> 9ht6L+57L/RdUkOtCT56cZ/LkehQHW8e8c8aEwv70ItBfd+1joV47BA/Jz8rkfi/
> 8FWfNiXWwEPEZO/p1WEZETmF+38yhuerB3n5WIfpWWkm1M3K3CHq30J2Kvf7p0Br
> 2N7RwvPL9ZGrA34av0sWnmhpwKqM1+7LttCep7mmPguFgye6CHd9V1hdKIoKaXyP
> mcc8gjukZ24kd/kN6wVCbqwEWtW0+ozcNVA2fF3pkAZB5CUNo4Ooqy+drgWMySUd
> RT0E6f3U7pyvNqAyEPMxMS5ktZKdEqyhVjacuq1eCj0dDmvhYnulQtnzMaBQQMm3
> t1wC0w4Mrd4QH085xJK7FOueOaV5TN0S/QzSJKkgDR8RRBIJZPo8BeTf7xQ3urr6
> RU3E6P54XhRW9ccpXhNl
> =GE4t
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


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


Re: Shutdown port and multiple Tomcat instances

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

Jeffrey,

On 6/15/15 10:49 AM, Jeffrey Janner wrote:
> I’m making the switch to running all my tomcats on Linux.
> 
> I’m planning to deploy multiple instances per machine, splitting 
> catalina_base and catalina_home, and just have question on the
> shutdown port.
> 
> Under Windows, I just deployed the binary with the commons daemon 
> wrapper and set the shutdown port to -1 and let the daemon manage
> the orderly shutdown.
> 
> Is it possible to set the port to -1 under Linux and do something 
> similar? Preferably without deploying the daemon wrapper also,
> though I’m willing to do if necessary.  I am planning to manage
> them with service/init scripts for startup and shutdown.

The *NIX analog to the Windows Service runner /is/ jsvc.

I'm curious why you don't want to run jsvc.

If you don't want to run jsvc, why not pick a unique shutdown port
number and use the standard scripts?

We run multiple JVMs on a single machine, and we even (in dev) have
multiple users with multiple JVMs, etc. *and* we are using mod_jk to
connect them all, so we have to manage ports carefully.

We have come up with this method to organize everything:

1. Each user has a "user number" -- let's call that "u"
2. Each application has an "app number" -- let's call that "a"

Port numbers now look like this:

8ua5 - ajp port for the application
8ua6 - shutdown port for the application
8ua7 - secure port for loopback requests from other apps
       (if necessary for the application)

We have scripts that use these things so a user just has to set up
their "u" and "a" values properly and everything works. It's also
possible to predict who will be using what port, and - ignoring typos
- - nobody has any conflicts.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVfuj7AAoJEBzwKT+lPKRYmSwQAKTsfdDArTB62NLzB8XjiQgy
8KzChtOr/kcczKyVJ4Q1WVuraqb0Q5QX89HZT9W/LvQQ0t3RDseXf/cLmicPOkAJ
iR6EFHugvf3RUCQq96uF4Z4Vm8YJkZyx1ZYPbBhE2yxbqKSguDqeuLApwEmlrIiB
RWhccMg0l8v5Bn8iqlHvCJEZ0593JB3PPK5cCkNvRQi475VWXnWIGHOfQfJT7Me7
e3bML4+v+mvkFdOsqGU8uRz8YjArDJlUrPYxs1uAMsc0XaURJ+IZCkKWBWL1Pkem
9ht6L+57L/RdUkOtCT56cZ/LkehQHW8e8c8aEwv70ItBfd+1joV47BA/Jz8rkfi/
8FWfNiXWwEPEZO/p1WEZETmF+38yhuerB3n5WIfpWWkm1M3K3CHq30J2Kvf7p0Br
2N7RwvPL9ZGrA34av0sWnmhpwKqM1+7LttCep7mmPguFgye6CHd9V1hdKIoKaXyP
mcc8gjukZ24kd/kN6wVCbqwEWtW0+ozcNVA2fF3pkAZB5CUNo4Ooqy+drgWMySUd
RT0E6f3U7pyvNqAyEPMxMS5ktZKdEqyhVjacuq1eCj0dDmvhYnulQtnzMaBQQMm3
t1wC0w4Mrd4QH085xJK7FOueOaV5TN0S/QzSJKkgDR8RRBIJZPo8BeTf7xQ3urr6
RU3E6P54XhRW9ccpXhNl
=GE4t
-----END PGP SIGNATURE-----

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