tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Multiple instances?
Date Fri, 19 Dec 2014 16:05:49 GMT
Hash: SHA256


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
> <>:
> On 12/18/2014 10:07 AM, Christopher Schultz wrote:
>>>> Billy,
>>>> On 12/18/14 9:25 AM, Billy Bones wrote:
>>>>> Ok soooo, 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:
>>>>> 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
>>>> 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.
>> ---------------------------------------------------------------------
To unsubscribe, e-mail:
>> For additional commands, e-mail:
Version: GnuPG v1
Comment: GPGTools -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message