Re: Multiple instances?

2015-01-26 Thread Billy Bones
Hi guys, thank for your informations regarding the Wiki, I've finally
managed to create my account ^^ (later is better than never as we said over
there :D) and as expected to add a new entry on the FAQ/HowTo I need to be
whitelisted or granted to edit mode, so if a moderator could add me it
would be nice.

PS: I've found something bizarre on the systemd init process regarding
Tomcat, if I set the CONNECTOR_PORT variable to something (let said 8081)
on the /etc/sysconfig/tomcat-${SERVICE_NAME} it is not use but rather
overrided by the tomcat server.xml file.
Until now, nothing strange, the weird part is that if I disable the
HTTP-BIO or AJP-BIO connectors values on this file tomcat load the unit
without binding any network port at all.

Shouldn't it be suppose tu use the one specified by the CONNECTOR_PORT
variable or did I missed something?

2014-12-23 20:47 GMT+01:00 Christopher Schultz ch...@christopherschultz.net
:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Billy,

 On 12/19/14 1:37 PM, Billy Bones wrote:
  For sure, do I need an account or something special?

 You can sign-up yourself.

  Could you send me the wiki link?

 http://wiki.apache.org/tomcat/

 Choose login at the top of the page and then choose the you can
 create one now at the bottom of the page login page.

 Once you have an account, I think you'll need to be white-listed to
 actually make modifications. Just email a moderator or the whole list
 to request write access to the Wiki.

 - -chris

  2014-12-19 17:05 GMT+01:00 Christopher Schultz
  ch...@christopherschultz.net
  :
 
  Billy,
 
  On 12/19/14 4:46 AM, Billy Bones wrote:
  hum OK many thanks for your hints, I got it, I understand
  what is going on now. Ok, I now have a clean and multiple
  instances running !!
 
  Thanks to everyone!
 
  @Mark Eggers: CentOS systemd units are not quite so far from
  the Fedora ones. Personally I do love the way fedora and
  CentOS are working but I have to confess that sometimes, and
  especially with tomcat everything is a pain in the ass as
  they scatter the components everywhere in the system without
  any (apparent) logics.
 
  WTH with all this /usr/share/blabla ??
 
  @Christopher: Many thanks for your advices, obviously it make
  more sens to keep the catalina_base and derivate the
  catalina_home. I love this method!!
 
  Once again, many thanks to everyone, I now have a clean and
  working server!
 
  Great. Care to post your systemd script template to the wiki? It
  will likely help others trying to do the same thing.
 
  -chris
 
  2014-12-18 19:46 GMT+01:00 Mark Eggers
  its_toas...@yahoo.com.invalid:
 
  On 12/18/2014 10:07 AM, Christopher Schultz wrote:
  Billy,
 
  On 12/18/14 9:25 AM, Billy Bones wrote:
  Ok s, here is a small update.
 
  I've finally found what does this SERVICE_NAME mean,
  indeed you have to copy the original unit, then add
  the Systemd's directive named Environment like this:
 
  Environment=SERVICE_NAME=YOUROWNSERVICENAMEHERE
 
  then you will copy the default tomcat config file
  found on the /etc/sysconfig directory.
 
  And as you supposed it Cristophe and Daniel, you then
  have to copy the whole CATALINA_{HOME/BASE} or update
  the previous config file to point out to another
  tomcat installation.
 
  You should not have to copy the whole CATALINA_HOME.
  Instead, create a CATALINA_BASE (which is basically
  just a few directories and a few configuration files)
  for each service and then set the CATALINA_BASE
  environment variable to point to each one for each
  service, set CATALINA_HOME to point to where the full
  installation of Tomcat is (with no web applications
  installed in it), and each service should operate
  independently.
 
  So you should be able to have something like this:
 
  SERVICE_NAME=tomcat-one
  CATALINA_HOME=/opt/apache-tomcat-7.0.57
  CATALINA_BASE=/opt/tomcat/tomcat-one
 
  SERVICE_NAME=tomcat-two
  CATALINA_HOME=/opt/apache-tomcat-7.0.57
  CATALINA_BASE=/opt/tomcat/tomcat-two
 
  Then you configure /opt/tomcat/tomcat-(one|two) to have
  the configuration and applications you want.
 
  You should be able to start tomcat-one and tomcat-two
  independently of each other. I don't know exactly what
  systemd does with all of this, but once you end up
  calling catalina.sh with the right environment
  variables set, Tomcat will do the right thing.
 
  -chris
 
  Fedora 21 has a relatively nice systemd script for Tomcat.
  It's designed for running multiple Tomcat instances.
 
  If you have a copy of Fedora 21 and yumdownloader (by
  installing yum-utils), you can take a look at the system
  with:
 
  mkdir Temp cd Temp yumdownloader tomcat.noarch rpm2cpio
  tomcat-7.0.54-3.fc21.noarch.rpm | cpio -idmv
 
  All of the files are then accessible in the Temp directory.
 
  I've never liked how Fedora / RedHat / CentOS scatter the
  components all over the landscape. I'm thinking of adapting
  the Fedora systemd scripts to work with Tomcats installed
  under

Re: Multiple instances?

2015-01-26 Thread Billy Bones
Hi Markt, my wiki alias username is ArKam and my Real username is
GaelTherond, thank you very much.

@Chris: Ok, thanks a lot for your explanations, it's crystal clear to me
now, as you said, it should be something specific to systemd as it reside
under the /etc/sysconfig/tomcat file which is use to set some variables to
start the JVM.

I'm working on a RHEL 7 right now instead of the CentOS from my first mail
as I'm cooking a new PROD server, the two distro use exactly the same
configs.

2015-01-26 16:15 GMT+01:00 Christopher Schultz ch...@christopherschultz.net
:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Billy,

 On 1/26/15 8:57 AM, Billy Bones wrote:
  PS: I've found something bizarre on the systemd init process
  regarding Tomcat, if I set the CONNECTOR_PORT variable to something
  (let said 8081) on the /etc/sysconfig/tomcat-${SERVICE_NAME} it is
  not use but rather overrided by the tomcat server.xml file.

 That's not surprising, since Tomcat uses the contents of server.xml to
 configure the connectors, and does not look at any environment
 variables for anything.

 Where is CONNECTOR_PORT documented? I suspect it's something supported
 by the systemd scripts simply to differentiate between various Tomcat
 servers but doesn't have any bearing on the actual runtime
 configuration. Remember that Tomcat can bind to an arbitrary number of
 ports, so having a single CONNECTOR_PORT doesn't really make much sense.

  Until now, nothing strange, the weird part is that if I disable
  the HTTP-BIO or AJP-BIO connectors values on this file tomcat load
  the unit without binding any network port at all.

 That's expected behavior: it's possible that Tomcat is coming up with
 no Connectors configured, and that some other software component will
 then configure the connectors after the server is running. Think of an
 embedded use-case and it becomes easier to understand how this would
 not be an error.

  Shouldn't it be [using] the one specified by the CONNECTOR_PORT
  variable or did I missed something?

 No, Tomcat doesn't use environment variables for anything. The launch
 scripts use a handful of environment variables to set up various
 system properties when launching the JVM, and Tomcat uses those if
 necessary.

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

 iQIcBAEBCAAGBQJUxlopAAoJEBzwKT+lPKRYwcUP/0UYgfDJ8XaETTjPkvvN8j08
 mqLeXkP+Mr84MCGtBMTytF9XYi1XXE5FdHdXhtWOScoe+IdYtuM42E4/YubJm7g3
 V99mVbaiw9O5tFm9lDFYUaNhG3r0jLYmbMNGWxNAoWiCL18RKcVQ6tgu74DpBzgH
 XmWaRSB20xAp3iCYP25dRQpwVTmwrCTHeYLOmbeHKqQGRTeA37dQSuisz1SYptgp
 iQs/CXlkumHDRRGmXiihcbUQiMmULmmAZUGyjl3jex9eHfQcDXIZ34edBgh5fMwW
 w6FMUfUTmqVAeZbceCZdoBDtifNkFUbCr0f3eMNGV4oSHrA7fJv/xxi9kUoLpiuG
 5/9j1wK3eOsBKPCVEJkuQ79zQXgI9bOW4/c5mAp3Coq6z8Me8AbYYAuiLhPjaCec
 oBtHc13Lr8HqZW/kdJCNgwN1Y4YDxwYwaNODh966M6ZF3Gsk8aZ6a8P2YI7u5jaW
 ixMxft7lSpNrQWdwHy4DDlPtuwGk3n8ERaxk8d37YOGRxSjk9jS+9Bgdz/Dxznkd
 NQ0IRqwZ9LIuFt/VjYdPPRJDmOm9oIclEDq97aKp2cP3kz7s+JkUBZyLKefynW2Y
 A24ha+4d5Mi8RCj6TTkdFm7mB9WpUQhuSFEw79NpsToz5jv0D43ZsiFdehdukOwc
 fY8+Fsy+LWIwpbIdpM/N
 =9SDP
 -END PGP SIGNATURE-

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




Re: Multiple instances?

2014-12-19 Thread Billy Bones
hum OK many thanks for your hints, I got it, I understand what is going
on now.
Ok, I now have a clean and multiple instances running !!

Thanks to everyone!

@Mark Eggers: CentOS systemd units are not quite so far from the Fedora
ones. Personally I do love the way fedora and CentOS are working but I have
to confess that sometimes, and especially with tomcat everything is a pain
in the ass as they scatter the components everywhere in the system without
any (apparent) logics.

WTH with all this /usr/share/blabla ??

@Christopher: Many thanks for your advices, obviously it make more sens to
keep the catalina_base and derivate the catalina_home. I love this method!!

Once again, many thanks to everyone, I now have a clean and working server!

2014-12-18 19:46 GMT+01:00 Mark Eggers its_toas...@yahoo.com.invalid:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 12/18/2014 10:07 AM, Christopher Schultz wrote:
  Billy,
 
  On 12/18/14 9:25 AM, Billy Bones wrote:
  Ok s, here is a small update.
 
  I've finally found what does this SERVICE_NAME mean, indeed you
  have to copy the original unit, then add the Systemd's directive
   named Environment like this:
 
  Environment=SERVICE_NAME=YOUROWNSERVICENAMEHERE
 
  then you will copy the default tomcat config file found on the
  /etc/sysconfig directory.
 
  And as you supposed it Cristophe and Daniel, you then have to
  copy the whole CATALINA_{HOME/BASE} or update the previous config
  file to point out to another tomcat installation.
 
  You should not have to copy the whole CATALINA_HOME. Instead,
  create a CATALINA_BASE (which is basically just a few directories
  and a few configuration files) for each service and then set the
  CATALINA_BASE environment variable to point to each one for each
  service, set CATALINA_HOME to point to where the full installation
  of Tomcat is (with no web applications installed in it), and each
  service should operate independently.
 
  So you should be able to have something like this:
 
  SERVICE_NAME=tomcat-one CATALINA_HOME=/opt/apache-tomcat-7.0.57
  CATALINA_BASE=/opt/tomcat/tomcat-one
 
  SERVICE_NAME=tomcat-two CATALINA_HOME=/opt/apache-tomcat-7.0.57
  CATALINA_BASE=/opt/tomcat/tomcat-two
 
  Then you configure /opt/tomcat/tomcat-(one|two) to have the
  configuration and applications you want.
 
  You should be able to start tomcat-one and tomcat-two independently
  of each other. I don't know exactly what systemd does with all of
  this, but once you end up calling catalina.sh with the right
  environment variables set, Tomcat will do the right thing.
 
  -chris

 Fedora 21 has a relatively nice systemd script for Tomcat. It's
 designed for running multiple Tomcat instances.

 If you have a copy of Fedora 21 and yumdownloader (by installing
 yum-utils), you can take a look at the system with:

 mkdir Temp
 cd Temp
 yumdownloader tomcat.noarch
 rpm2cpio tomcat-7.0.54-3.fc21.noarch.rpm | cpio -idmv

 All of the files are then accessible in the Temp directory.

 I've never liked how Fedora / RedHat / CentOS scatter the components
 all over the landscape. I'm thinking of adapting the Fedora systemd
 scripts to work with Tomcats installed under a particular user.

 The only issue seems to be that the SHUTDOWN_WAIT (time to wait in
 seconds before killing the process) is documented not to work.

 Sadly, I have some truly misbehaving applications that sometime need a
 kill -9 on the underlying Tomcat. Those misbehaving applications are
 unlikely to be fixed.

 My init scripts take care of this by issuing an orderly shutdown
 command, waiting up to SHUTDOWN_WAIT seconds (checking every second),
 then issuing a kill -9 if the process still exists.

 . . . better late than never (mostly)
 /mde/
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2

 iQEcBAEBAgAGBQJUkyEAAAoJEEFGbsYNeTwtxbEH/jsc5+ywzGWZneOU5eRDt6I6
 k5DWaP0S7OeAEU4FIGN5IK2zGE5ioYITxxQQ+QtWn61QkqkOR4mb6fMe7wNERiP7
 0hX4fs1SXA13H3MdeO1PXRGi0T9f0bnqPmSstpCLHVy7kavy/ywgammOir87moje
 bw58Ga62iM/QhZIAcMksi2V255j+GdKOAgMG0Q9TKapMeDY1t3ywi/HJziTw8NAW
 du/3eniAjM6SGi74GsYTkY44hM4yB7uXko3RDeU+A0I20gz9umWkRf5u39PiRUPL
 RYMP8JAorjI8p4jt9ZnCPAwTrwrnvHLMnTFYYG10xQAkV9j22xgc0Hf49IMOq0k=
 =1cES
 -END PGP SIGNATURE-

 ---
 This email is free from viruses and malware because avast! Antivirus
 protection is active.
 http://www.avast.com


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




Re: Multiple instances?

2014-12-19 Thread Billy Bones
For sure, do I need an account or something special?
Could you send me the wiki link?

2014-12-19 17:05 GMT+01:00 Christopher Schultz ch...@christopherschultz.net
:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Billy,

 On 12/19/14 4:46 AM, Billy Bones wrote:
  hum OK many thanks for your hints, I got it, I understand what
  is going on now. Ok, I now have a clean and multiple instances
  running !!
 
  Thanks to everyone!
 
  @Mark Eggers: CentOS systemd units are not quite so far from the
  Fedora ones. Personally I do love the way fedora and CentOS are
  working but I have to confess that sometimes, and especially with
  tomcat everything is a pain in the ass as they scatter the
  components everywhere in the system without any (apparent) logics.
 
  WTH with all this /usr/share/blabla ??
 
  @Christopher: Many thanks for your advices, obviously it make more
  sens to keep the catalina_base and derivate the catalina_home. I
  love this method!!
 
  Once again, many thanks to everyone, I now have a clean and working
  server!

 Great. Care to post your systemd script template to the wiki? It will
 likely help others trying to do the same thing.

 - -chris

  2014-12-18 19:46 GMT+01:00 Mark Eggers
  its_toas...@yahoo.com.invalid:
 
  On 12/18/2014 10:07 AM, Christopher Schultz wrote:
  Billy,
 
  On 12/18/14 9:25 AM, Billy Bones wrote:
  Ok s, here is a small update.
 
  I've finally found what does this SERVICE_NAME mean, indeed
  you have to copy the original unit, then add the Systemd's
  directive named Environment like this:
 
  Environment=SERVICE_NAME=YOUROWNSERVICENAMEHERE
 
  then you will copy the default tomcat config file found on
  the /etc/sysconfig directory.
 
  And as you supposed it Cristophe and Daniel, you then have
  to copy the whole CATALINA_{HOME/BASE} or update the
  previous config file to point out to another tomcat
  installation.
 
  You should not have to copy the whole CATALINA_HOME.
  Instead, create a CATALINA_BASE (which is basically just a
  few directories and a few configuration files) for each
  service and then set the CATALINA_BASE environment variable
  to point to each one for each service, set CATALINA_HOME to
  point to where the full installation of Tomcat is (with no
  web applications installed in it), and each service should
  operate independently.
 
  So you should be able to have something like this:
 
  SERVICE_NAME=tomcat-one
  CATALINA_HOME=/opt/apache-tomcat-7.0.57
  CATALINA_BASE=/opt/tomcat/tomcat-one
 
  SERVICE_NAME=tomcat-two
  CATALINA_HOME=/opt/apache-tomcat-7.0.57
  CATALINA_BASE=/opt/tomcat/tomcat-two
 
  Then you configure /opt/tomcat/tomcat-(one|two) to have the
  configuration and applications you want.
 
  You should be able to start tomcat-one and tomcat-two
  independently of each other. I don't know exactly what
  systemd does with all of this, but once you end up calling
  catalina.sh with the right environment variables set, Tomcat
  will do the right thing.
 
  -chris
 
  Fedora 21 has a relatively nice systemd script for Tomcat. It's
  designed for running multiple Tomcat instances.
 
  If you have a copy of Fedora 21 and yumdownloader (by installing
  yum-utils), you can take a look at the system with:
 
  mkdir Temp cd Temp yumdownloader tomcat.noarch rpm2cpio
  tomcat-7.0.54-3.fc21.noarch.rpm | cpio -idmv
 
  All of the files are then accessible in the Temp directory.
 
  I've never liked how Fedora / RedHat / CentOS scatter the
  components all over the landscape. I'm thinking of adapting the
  Fedora systemd scripts to work with Tomcats installed under a
  particular user.
 
  The only issue seems to be that the SHUTDOWN_WAIT (time to wait in
  seconds before killing the process) is documented not to work.
 
  Sadly, I have some truly misbehaving applications that sometime
  need a kill -9 on the underlying Tomcat. Those misbehaving
  applications are unlikely to be fixed.
 
  My init scripts take care of this by issuing an orderly shutdown
  command, waiting up to SHUTDOWN_WAIT seconds (checking every
  second), then issuing a kill -9 if the process still exists.
 
  . . . better late than never (mostly) /mde/
 
  --- This email is free from viruses and malware because avast!
  Antivirus protection is active. http://www.avast.com
 
 
  -
 
 
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org

 iQIcBAEBCAAGBQJUlEzdAAoJEBzwKT+lPKRYDcUP/j4pL9nN2SJp6A16T6f8HhEC
 uXRd+10RRZOtiwen0+h/M6h/YKhvWarCnVeGiBEWz82LvvfKTxMnGzNdHSMHBi2a
 nLdCWWEPYDCHWxwX+VpjyMwvanyK0Dl2zjeEfu0XGz4kf8Q0y+hPbMCa0bUUjHIQ
 B+3UcPvss2YmaZUAb+FKodFVUJNSLBKYCNTtRJL/+LO6TlriQIIa18kNujNk3ric
 W/cQAdreCd3HOjpopa/U0Bsxvplt+DLU2JAU+ooquupzIRR7+9/Z6JlyKX8Q+5du
 o9pjiDAYneRr1NWMVGFjAyxIqK2HNS1ARKn

Re: Multiple instances?

2014-12-18 Thread Billy Bones
Ok s, here is a small update.

I've finally found what does this SERVICE_NAME mean, indeed you have to
copy the original unit, then add the Systemd's directive
 named Environment like this:

Environment=SERVICE_NAME=YOUROWNSERVICENAMEHERE

then you will copy the default tomcat config file found on the
/etc/sysconfig directory.

And as you supposed it Cristophe and Daniel, you then have to copy the
whole CATALINA_{HOME/BASE} or update the previous config file to point out
to another tomcat installation.

I hope it would help someone ;-)

2014-12-11 17:58 GMT+01:00 Billy Bones gael.ther...@gmail.com:

 No problems, I'll keep you updated ;-)

 Thanks for your answers.

 2014-12-11 15:24 GMT+01:00 Daniel Mikusa dmik...@pivotal.io:

 On Thu, Dec 11, 2014 at 3:45 AM, Billy Bones gael.ther...@gmail.com
 wrote:

  Ok, then I'll completly wright another systemd unit derivated from the
 one
  provided by CentOS.
 
  Yup, that what I thought about the CATALINA_HOME and BASE, so as you
  suggested, I'll test to run individual units and saw how it's going on.
 
  Many thanks guys.
 

 When you get something working, please share your solution :)

 I'm interested to see what you work out and I'm sure others will be as
 well.

 Dan



 
  2014-12-10 18:10 GMT+01:00 Daniel Mikusa dmik...@pivotal.io:
 
   On Wed, Dec 10, 2014 at 10:35 AM, Billy Bones gael.ther...@gmail.com
 
   wrote:
  
Hi Christopher,
   
Many thanks for your answer, well, I'm pretty comfortable with
 systemd
myself as I rely on it for my Fedora box for a long time ago, but on
  this
particular topic regarding tomcat, I don't really understand the
  purpose
   of
this special sentence.
As you pointed it, for me too usually caps names == env variables
 but
  as
   on
the tomcat-sysd script it's simply called without futher sources I'm
  not
quite sure for now.
   
Well, lets see if another *NIX Admin already had started
  multi-instances
tomcat on systemd distributions :D
   
  
   Starting different instances of Tomcat is mostly just a matter of
 setting
   the CATALINA_HOME and CATALINA_BASE environment variables to the right
   locations.  I'm sure systemd has a way for you to set environment
   variables, so that should be sufficient to start different instances.
  
   For more details on CATALINA_HOME and CATALINA_BASE, check out the
   RUNNING.txt file in your download or look here.
  
  
  
 
 http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/RUNNING.txt?view=markup
  
   I'd suggest getting everything working with multiple instance first.
  Once
   you can start the instances from the command line then worry about
  starting
   them with systemd.
  
  
   
Another way would be to completly duplicate the tomcat directory and
service unit and start both at runtime but... doesn't seems too
 shiny
   for a
new server :D
   
  
   Also an option, but not as efficient.
  
   Dan
  
  
   
2014-12-10 16:27 GMT+01:00 Christopher Schultz 
ch...@christopherschultz.net
:
   
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Billy,

 On 12/10/14 9:57 AM, Billy Bones wrote:
  Hi guys,
 
  I'm currently preparing a migration of our Operating System
 which
  handle our current tomcat installation from an OLD Linux using
 init
  scripts to a CentOS7 release using sytemd.

 Hrm. Good luck getting help with systemd. The ASF doesn't even
  support
 init.d scripts, though I'm sure many *NIX admins here can help
 with
 init.d scripts (including myself). systemd is a bit new, to ...
 we'll
see.

  Because I don't want to disturb the way the old server handle
 the
  webapps (not yet :-) ), I have to start 2 separated instances of
  tomcat on the new machine.
 
  Using init script to boot multiples instance is quite easy, but
  know I'll use systemd and I have to adapt.
 
  I installed my OS and Tomcat from the CentOS repos, take a look
 at
  the tomcat.service unit and tomcat-sysd script to see how the
  things work. But now I'm a little bit disappointed, I don't
  understand how to have multiple instances.
 
  I created a tomcat@jcr.service unit file on my systemd
 directory
  and read about the steps to achieve.
 
  The first step said that *by default SERVICE_NAME=tomcat. and
 must
  be defined BEFORE tomcat-sysd is called*
 
  Well, OK, but how am I suppose to do that? Using environnement
  variables? PreStartExec directive? Environnement directive?

 I have no idea. Generally, whenever I see something in ALL_CAPS
 that
 needs to be set to a value, it's an environment variable. With
 systemd, it could mean just about anything.

  I really don't get it, even looking at the tomcat-sysd wrapper
  script which indicate me HOW the system run multiple instance
 don't
  help me to understand WHERE am I suppose to put

Re: Multiple instances?

2014-12-11 Thread Billy Bones
Ok, then I'll completly wright another systemd unit derivated from the one
provided by CentOS.

Yup, that what I thought about the CATALINA_HOME and BASE, so as you
suggested, I'll test to run individual units and saw how it's going on.

Many thanks guys.

2014-12-10 18:10 GMT+01:00 Daniel Mikusa dmik...@pivotal.io:

 On Wed, Dec 10, 2014 at 10:35 AM, Billy Bones gael.ther...@gmail.com
 wrote:

  Hi Christopher,
 
  Many thanks for your answer, well, I'm pretty comfortable with systemd
  myself as I rely on it for my Fedora box for a long time ago, but on this
  particular topic regarding tomcat, I don't really understand the purpose
 of
  this special sentence.
  As you pointed it, for me too usually caps names == env variables but as
 on
  the tomcat-sysd script it's simply called without futher sources I'm not
  quite sure for now.
 
  Well, lets see if another *NIX Admin already had started multi-instances
  tomcat on systemd distributions :D
 

 Starting different instances of Tomcat is mostly just a matter of setting
 the CATALINA_HOME and CATALINA_BASE environment variables to the right
 locations.  I'm sure systemd has a way for you to set environment
 variables, so that should be sufficient to start different instances.

 For more details on CATALINA_HOME and CATALINA_BASE, check out the
 RUNNING.txt file in your download or look here.


 http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/RUNNING.txt?view=markup

 I'd suggest getting everything working with multiple instance first.  Once
 you can start the instances from the command line then worry about starting
 them with systemd.


 
  Another way would be to completly duplicate the tomcat directory and
  service unit and start both at runtime but... doesn't seems too shiny
 for a
  new server :D
 

 Also an option, but not as efficient.

 Dan


 
  2014-12-10 16:27 GMT+01:00 Christopher Schultz 
  ch...@christopherschultz.net
  :
 
   -BEGIN PGP SIGNED MESSAGE-
   Hash: SHA256
  
   Billy,
  
   On 12/10/14 9:57 AM, Billy Bones wrote:
Hi guys,
   
I'm currently preparing a migration of our Operating System which
handle our current tomcat installation from an OLD Linux using init
scripts to a CentOS7 release using sytemd.
  
   Hrm. Good luck getting help with systemd. The ASF doesn't even support
   init.d scripts, though I'm sure many *NIX admins here can help with
   init.d scripts (including myself). systemd is a bit new, to ... we'll
  see.
  
Because I don't want to disturb the way the old server handle the
webapps (not yet :-) ), I have to start 2 separated instances of
tomcat on the new machine.
   
Using init script to boot multiples instance is quite easy, but
know I'll use systemd and I have to adapt.
   
I installed my OS and Tomcat from the CentOS repos, take a look at
the tomcat.service unit and tomcat-sysd script to see how the
things work. But now I'm a little bit disappointed, I don't
understand how to have multiple instances.
   
I created a tomcat@jcr.service unit file on my systemd directory
and read about the steps to achieve.
   
The first step said that *by default SERVICE_NAME=tomcat. and must
be defined BEFORE tomcat-sysd is called*
   
Well, OK, but how am I suppose to do that? Using environnement
variables? PreStartExec directive? Environnement directive?
  
   I have no idea. Generally, whenever I see something in ALL_CAPS that
   needs to be set to a value, it's an environment variable. With
   systemd, it could mean just about anything.
  
I really don't get it, even looking at the tomcat-sysd wrapper
script which indicate me HOW the system run multiple instance don't
help me to understand WHERE am I suppose to put that information.
   
I understand that I have to create a new unit file, a new
/etc/sysconfig/tomcat file named according to the systemd unit, but
I don't get it about the SERVICE_NAME.
   
So if someone could help me a little bit, I'll be happy ^^
  
   Ultimately, it will all boil down to CATALINA_BASE and CATALINA_HOME
   as far as Tomcat is concerned. The SERVICE_NAME is probably a
   systemd-only thing.
  
   Good luck,
   - -chris
   -BEGIN PGP SIGNATURE-
   Version: GnuPG v1
   Comment: GPGTools - http://gpgtools.org
  
   iQIcBAEBCAAGBQJUiGZWAAoJEBzwKT+lPKRYsI0QAMI0IOCB2PjgBFKKb7Q1KtfF
   EpplWZmWEg7FL20HzTTjWM41r0IX5jZv1zFVBI8Na2mjtQ0v1KUUzPWnWo2+mGus
   nyrHl7HcY80LL9t4v3XwIpY0wE5pNgmTtnH+6JdHsahNNTN6NceK/j1IJoUPUFBj
   9tdWHCM+bM6rP49nYBvBV3XPClw7nEc+NO3ddMeAY+zli71TuTnwIyC3Dp1v6ONW
   iNxheXHfDGACU1Qo7t9xL33g8cng06RD+LOjV/0d7JX3YJh5okoLL2m6ACHrQI7c
   knlon9yX0skzLhesZnkPeePli7Atk0s54SdH71MZe41ZJvlb/DAYmIqlkg1H7CGA
   fJlWmCfU0RwwNDdNq9prfQt/LFePnKQJ6PNO75afkfROKqnklYBe4imqpGqg1ij1
   vRMyemYobM83m2/xpZ3l5FWwk+DoJiWBC9MdAJ/M6TYXU8y3ERPtyzEfVfsTRnzu
   Q6XQ5wcJzJmazA3SK4h743auSbNLp9iVrAH5Rhh5iAxCZTtf5Et1zgBfocpTh12X

Re: Multiple instances?

2014-12-11 Thread Billy Bones
No problems, I'll keep you updated ;-)

Thanks for your answers.

2014-12-11 15:24 GMT+01:00 Daniel Mikusa dmik...@pivotal.io:

 On Thu, Dec 11, 2014 at 3:45 AM, Billy Bones gael.ther...@gmail.com
 wrote:

  Ok, then I'll completly wright another systemd unit derivated from the
 one
  provided by CentOS.
 
  Yup, that what I thought about the CATALINA_HOME and BASE, so as you
  suggested, I'll test to run individual units and saw how it's going on.
 
  Many thanks guys.
 

 When you get something working, please share your solution :)

 I'm interested to see what you work out and I'm sure others will be as
 well.

 Dan



 
  2014-12-10 18:10 GMT+01:00 Daniel Mikusa dmik...@pivotal.io:
 
   On Wed, Dec 10, 2014 at 10:35 AM, Billy Bones gael.ther...@gmail.com
   wrote:
  
Hi Christopher,
   
Many thanks for your answer, well, I'm pretty comfortable with
 systemd
myself as I rely on it for my Fedora box for a long time ago, but on
  this
particular topic regarding tomcat, I don't really understand the
  purpose
   of
this special sentence.
As you pointed it, for me too usually caps names == env variables but
  as
   on
the tomcat-sysd script it's simply called without futher sources I'm
  not
quite sure for now.
   
Well, lets see if another *NIX Admin already had started
  multi-instances
tomcat on systemd distributions :D
   
  
   Starting different instances of Tomcat is mostly just a matter of
 setting
   the CATALINA_HOME and CATALINA_BASE environment variables to the right
   locations.  I'm sure systemd has a way for you to set environment
   variables, so that should be sufficient to start different instances.
  
   For more details on CATALINA_HOME and CATALINA_BASE, check out the
   RUNNING.txt file in your download or look here.
  
  
  
 
 http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/RUNNING.txt?view=markup
  
   I'd suggest getting everything working with multiple instance first.
  Once
   you can start the instances from the command line then worry about
  starting
   them with systemd.
  
  
   
Another way would be to completly duplicate the tomcat directory and
service unit and start both at runtime but... doesn't seems too shiny
   for a
new server :D
   
  
   Also an option, but not as efficient.
  
   Dan
  
  
   
2014-12-10 16:27 GMT+01:00 Christopher Schultz 
ch...@christopherschultz.net
:
   
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Billy,

 On 12/10/14 9:57 AM, Billy Bones wrote:
  Hi guys,
 
  I'm currently preparing a migration of our Operating System which
  handle our current tomcat installation from an OLD Linux using
 init
  scripts to a CentOS7 release using sytemd.

 Hrm. Good luck getting help with systemd. The ASF doesn't even
  support
 init.d scripts, though I'm sure many *NIX admins here can help with
 init.d scripts (including myself). systemd is a bit new, to ...
 we'll
see.

  Because I don't want to disturb the way the old server handle the
  webapps (not yet :-) ), I have to start 2 separated instances of
  tomcat on the new machine.
 
  Using init script to boot multiples instance is quite easy, but
  know I'll use systemd and I have to adapt.
 
  I installed my OS and Tomcat from the CentOS repos, take a look
 at
  the tomcat.service unit and tomcat-sysd script to see how the
  things work. But now I'm a little bit disappointed, I don't
  understand how to have multiple instances.
 
  I created a tomcat@jcr.service unit file on my systemd directory
  and read about the steps to achieve.
 
  The first step said that *by default SERVICE_NAME=tomcat. and
 must
  be defined BEFORE tomcat-sysd is called*
 
  Well, OK, but how am I suppose to do that? Using environnement
  variables? PreStartExec directive? Environnement directive?

 I have no idea. Generally, whenever I see something in ALL_CAPS
 that
 needs to be set to a value, it's an environment variable. With
 systemd, it could mean just about anything.

  I really don't get it, even looking at the tomcat-sysd wrapper
  script which indicate me HOW the system run multiple instance
 don't
  help me to understand WHERE am I suppose to put that information.
 
  I understand that I have to create a new unit file, a new
  /etc/sysconfig/tomcat file named according to the systemd unit,
 but
  I don't get it about the SERVICE_NAME.
 
  So if someone could help me a little bit, I'll be happy ^^

 Ultimately, it will all boil down to CATALINA_BASE and
 CATALINA_HOME
 as far as Tomcat is concerned. The SERVICE_NAME is probably a
 systemd-only thing.

 Good luck,
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org

 iQIcBAEBCAAGBQJUiGZWAAoJEBzwKT

Multiple instances?

2014-12-10 Thread Billy Bones
Hi guys,

I'm currently preparing a migration of our Operating System which handle
our current tomcat installation from an OLD Linux using init scripts to a
CentOS7 release using sytemd.

Because I don't want to disturb the way the old server handle the webapps
(not yet :-) ), I have to start 2 separated instances of tomcat on the new
machine.

Using init script to boot multiples instance is quite easy, but know I'll
use systemd and I have to adapt.

I installed my OS and Tomcat from the CentOS repos, take a look at the
tomcat.service unit and tomcat-sysd script to see how the things work.
But now I'm a little bit disappointed, I don't understand how to have
multiple instances.

I created a tomcat@jcr.service unit file on my systemd directory and read
about the steps to achieve.

The first step said that *by default SERVICE_NAME=tomcat. and must be
defined BEFORE tomcat-sysd is called*

Well, OK, but how am I suppose to do that? Using environnement variables?
PreStartExec directive? Environnement directive?

I really don't get it, even looking at the tomcat-sysd wrapper script which
indicate me HOW the system run multiple instance don't help me to
understand WHERE am I suppose to put that information.

I understand that I have to create a new unit file, a new
/etc/sysconfig/tomcat file named according to the systemd unit, but I don't
get it about the SERVICE_NAME.

So if someone could help me a little bit, I'll be happy ^^


Re: Multiple instances?

2014-12-10 Thread Billy Bones
Hi Christopher,

Many thanks for your answer, well, I'm pretty comfortable with systemd
myself as I rely on it for my Fedora box for a long time ago, but on this
particular topic regarding tomcat, I don't really understand the purpose of
this special sentence.
As you pointed it, for me too usually caps names == env variables but as on
the tomcat-sysd script it's simply called without futher sources I'm not
quite sure for now.

Well, lets see if another *NIX Admin already had started multi-instances
tomcat on systemd distributions :D

Another way would be to completly duplicate the tomcat directory and
service unit and start both at runtime but... doesn't seems too shiny for a
new server :D

2014-12-10 16:27 GMT+01:00 Christopher Schultz ch...@christopherschultz.net
:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Billy,

 On 12/10/14 9:57 AM, Billy Bones wrote:
  Hi guys,
 
  I'm currently preparing a migration of our Operating System which
  handle our current tomcat installation from an OLD Linux using init
  scripts to a CentOS7 release using sytemd.

 Hrm. Good luck getting help with systemd. The ASF doesn't even support
 init.d scripts, though I'm sure many *NIX admins here can help with
 init.d scripts (including myself). systemd is a bit new, to ... we'll see.

  Because I don't want to disturb the way the old server handle the
  webapps (not yet :-) ), I have to start 2 separated instances of
  tomcat on the new machine.
 
  Using init script to boot multiples instance is quite easy, but
  know I'll use systemd and I have to adapt.
 
  I installed my OS and Tomcat from the CentOS repos, take a look at
  the tomcat.service unit and tomcat-sysd script to see how the
  things work. But now I'm a little bit disappointed, I don't
  understand how to have multiple instances.
 
  I created a tomcat@jcr.service unit file on my systemd directory
  and read about the steps to achieve.
 
  The first step said that *by default SERVICE_NAME=tomcat. and must
  be defined BEFORE tomcat-sysd is called*
 
  Well, OK, but how am I suppose to do that? Using environnement
  variables? PreStartExec directive? Environnement directive?

 I have no idea. Generally, whenever I see something in ALL_CAPS that
 needs to be set to a value, it's an environment variable. With
 systemd, it could mean just about anything.

  I really don't get it, even looking at the tomcat-sysd wrapper
  script which indicate me HOW the system run multiple instance don't
  help me to understand WHERE am I suppose to put that information.
 
  I understand that I have to create a new unit file, a new
  /etc/sysconfig/tomcat file named according to the systemd unit, but
  I don't get it about the SERVICE_NAME.
 
  So if someone could help me a little bit, I'll be happy ^^

 Ultimately, it will all boil down to CATALINA_BASE and CATALINA_HOME
 as far as Tomcat is concerned. The SERVICE_NAME is probably a
 systemd-only thing.

 Good luck,
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1
 Comment: GPGTools - http://gpgtools.org

 iQIcBAEBCAAGBQJUiGZWAAoJEBzwKT+lPKRYsI0QAMI0IOCB2PjgBFKKb7Q1KtfF
 EpplWZmWEg7FL20HzTTjWM41r0IX5jZv1zFVBI8Na2mjtQ0v1KUUzPWnWo2+mGus
 nyrHl7HcY80LL9t4v3XwIpY0wE5pNgmTtnH+6JdHsahNNTN6NceK/j1IJoUPUFBj
 9tdWHCM+bM6rP49nYBvBV3XPClw7nEc+NO3ddMeAY+zli71TuTnwIyC3Dp1v6ONW
 iNxheXHfDGACU1Qo7t9xL33g8cng06RD+LOjV/0d7JX3YJh5okoLL2m6ACHrQI7c
 knlon9yX0skzLhesZnkPeePli7Atk0s54SdH71MZe41ZJvlb/DAYmIqlkg1H7CGA
 fJlWmCfU0RwwNDdNq9prfQt/LFePnKQJ6PNO75afkfROKqnklYBe4imqpGqg1ij1
 vRMyemYobM83m2/xpZ3l5FWwk+DoJiWBC9MdAJ/M6TYXU8y3ERPtyzEfVfsTRnzu
 Q6XQ5wcJzJmazA3SK4h743auSbNLp9iVrAH5Rhh5iAxCZTtf5Et1zgBfocpTh12X
 xmgnsJtLTZ3jKNxdx9wD8zsXK0JYtWCYwisXRj6fGQuUU7INLDqRL7dVdl8VrHRQ
 ra4UXRhg8cKLd8YFbd78UxJK66TP/EyQqv1cIwTGF+XSS87pvAnR1T36cQ4e5KIB
 xwylVvlwSd9BvhatJtJw
 =w7Y2
 -END PGP SIGNATURE-

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