Hi,
I followed the instructions in /etc/sysconfig/tomcat6 to create a second tomcat6 instance:
- created a link in /etc/init.d/tomcat6-dev - created a file in /etc/sysconfig/tomcat6-dev - created /usr/share/tomcat6-dev - created therein symlins conf, work, temp, webapps to resp. separate dirs - copied standard conf files to new dir (besides tomcat6.conf)
I edited the configuration files not to interfere regarding port number, pid file, etc. and defined CATALINA_BASE = /usr/share/tomcat6-dev
Problem: "service tomcat6 {start|stop}" works, "service tomcat6-dev start" fails.
I would like to share the tomcat binaries and libs, therefore use the same CATALINA_HOME, but a different CATALINA_BASE.
I'm not so familiar with bash programming, but inspecting /etc/init.d/tomcat6 I found some fix configuration option (to my understanding, may be wrong), e.g.
TOMCAT_LOG="${TOMCAT_LOG:-/var/log/tomcat6/catalina.out}"
where TOMCAT_LOG is not part of any instance specific configuration file nor does it seem to use $CATALINA_BASE/logs for logging (which I would expect).
Questions:
- is it possible to share Tomcat binaries and libs between different instances or do I have to define different CATALINA_HOME as well as different CATALINA_BASE?
- Does someone know a Howto to create separate instances the Fedora way? (My googling didn't yield any insights)
Thanks in advance
Peter
Hi!
First question:
Why do you want/need another instance? Want to run the same app (in another version) on the same server!?
-of
Am 05.03.2010 12:58, schrieb Peter Boy:
Hi,
I followed the instructions in /etc/sysconfig/tomcat6 to create a second tomcat6 instance:
- created a link in /etc/init.d/tomcat6-dev
- created a file in /etc/sysconfig/tomcat6-dev
- created /usr/share/tomcat6-dev
- created therein symlins conf, work, temp, webapps to resp. separate dirs
- copied standard conf files to new dir (besides tomcat6.conf)
I edited the configuration files not to interfere regarding port number, pid file, etc. and defined CATALINA_BASE = /usr/share/tomcat6-dev
Problem: "service tomcat6 {start|stop}" works, "service tomcat6-dev start" fails.
I would like to share the tomcat binaries and libs, therefore use the same CATALINA_HOME, but a different CATALINA_BASE.
I'm not so familiar with bash programming, but inspecting /etc/init.d/tomcat6 I found some fix configuration option (to my understanding, may be wrong), e.g.
TOMCAT_LOG="${TOMCAT_LOG:-/var/log/tomcat6/catalina.out}"
where TOMCAT_LOG is not part of any instance specific configuration file nor does it seem to use $CATALINA_BASE/logs for logging (which I would expect).
Questions:
- is it possible to share Tomcat binaries and libs between different
instances or do I have to define different CATALINA_HOME as well as different CATALINA_BASE?
- Does someone know a Howto to create separate instances the Fedora way?
(My googling didn't yield any insights)
Thanks in advance
Peter
Hi,
Am Freitag, den 05.03.2010, 13:21 +0100 schrieb Oliver Falk:
First question:
Why do you want/need another instance? Want to run the same app (in another version) on the same server!?
There are 2 reasons:
1) During kind of (semi-)public testing of one of our Web assplications I sometimes have to restart the whole Tomcat. I would prefer not to affect the other applications.
2) Currently we are running a lot of applications in several virtual hosts of one Tomcat instance and I would like to have a better separation of some of them so a problem will not affect all the others (Tomcat is running as a backend to Apache via ajp here).
Thanks Peter
Am 05.03.2010 17:38, schrieb Peter Boy:
Hi,
Am Freitag, den 05.03.2010, 13:21 +0100 schrieb Oliver Falk:
First question:
Why do you want/need another instance? Want to run the same app (in another version) on the same server!?
There are 2 reasons:
- During kind of (semi-)public testing of one of our Web assplications
I sometimes have to restart the whole Tomcat. I would prefer not to affect the other applications.
- Currently we are running a lot of applications in several virtual
hosts of one Tomcat instance and I would like to have a better separation of some of them so a problem will not affect all the others (Tomcat is running as a backend to Apache via ajp here).
I usually achieve this via seperate context - you can reastart each app seperatly. And (usually) the apps don't step on each other toes and a broken app doesn't kill the whole Tomcat.
However. With multiple Tomcats I usually run multiple (virtual) servers. In my old company we used to have seperate tarball-installs running from /home/tomcat/<instancename>. Used to work fine as well - with a special initscript that could start/stop all instances, as well as a specific one. However, it was a update nightmare, as you can guess. Links would have done a fine job in that case - I guess.
-of
Hi Oliver,
Am Samstag, den 06.03.2010, 09:15 +0100 schrieb Oliver Falk:
I usually achieve this via seperate context - you can reastart each app seperatly. And (usually) the apps don't step on each other toes and a broken app doesn't kill the whole Tomcat.
Our problem is that this currently doesn't work correctly :-) We have to do a lot of development work taming several background threads during context shutdown.
However. With multiple Tomcats I usually run multiple (virtual) servers. In my old company we used to have seperate tarball-installs running from /home/tomcat/<instancename>. Used to work fine as well - with a special initscript that could start/stop all instances, as well as a specific one. However, it was a update nightmare, as you can guess. Links would have done a fine job in that case - I guess.
Yes, and I hope it will be less terrible using the Fedora init scripts.
Well, I found the fault in the current tomcat init scripts. In /usr/sbin/tomcat6 the standard config file is "sourced" (lines 13-19) and makes the parameters, prepared by /etc/init.d/tomcat6 to be passed in using environment variables inaccessible. Removed those lines and it flies.
I'll file a bugzilla entry and provide a patch.
Thanks for your efforts.
Peter
Hi,
some additional findings:
As i wrote: - I created a symbolic link tomcat6-dev to tomcat6 in init.d - I created an /etc/sysconfig/tomcat6-dev file: # Where your tomcat installation lives #CATALINA_BASE="/usr/share/tomcat6" CATALINA_BASE="/usr/share/tomcat6-dev" #CATALINA_HOME="/usr/share/tomcat6" #JASPER_HOME="/usr/share/tomcat6" JASPER_HOME="/usr/share/tomcat6-dev" CATALINA_TMPDIR="/var/cache/tomcat6-dev/temp" .... # Set the TOMCAT_PID location CATALINA_PID="/var/run/tomcat6-dev.pid"
# Connector port is 8080 for this tomcat6 instance #CONNECTOR_PORT="8080" CONNECTOR_PORT="8090"
Command service tomcat6-dev start results in a fail message, nevertheless:
[root@shuttle run]# ll tom* -rw-r--r-- 1 tomcat tomcat 0 5. Mär 17:46 tomcat6-dev.pid
A pid file is created, but empty
[root@shuttle run]# ps -ef | grep tomcat tomcat 16229 1 26 17:46 ? 00:00:04 /usr/lib/jvm/java-1.6.0/bin/java -classpath :/usr/share/tomcat6/bin/bootstrap.jar: /usr/share/tomcat6/bin/tomcat-juli.jar: /usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat6 -Dcatalina.home=/usr/share/tomcat6 -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat6/temp -Djava.util.logging.config.file= /usr/share/tomcat6/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start root 16354 30833 0 17:46 pts/5 00:00:00 grep tomcat
A tomcat process is startet, but uses the standard directories and configuration instead of the additional separate ones as intended. It even responses to the standard port 8080 (instead of the configured 8090).
Same is true if I set CATALINA_HOME to /usr/share/tomcat6-dev as well and create a complete clone of the bin and lib directory.
So, I supposes I'm missing something, but don't catch what I'm missing :-)
Any help greatly appreciated.
Peter