You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ari King <ar...@gmail.com> on 2010/11/04 17:56:00 UTC

Secondary instance of Tomcat on single server does not process requests

Hi all,

My secondary instance of Tomcat 6 does not process requests -- it simply
times out for everything. The only log is catalina.out and there are not
errors in it. Anyone know what could be wrong? I'm using Tomcat 6, Java
1.6.0_20, on Centos 5.5 Final.

I've set the secondary instance to use port 8081 for http and 8010 for AJP,
both have redirect ports of 8444.

Below is the directory structure of the secondary instance:

/data/tomcat2
|-- bin
     |-- setenv.sh
     |-- catalina.sh
|-- conf
     |-- server.xml
     |-- web.xml
|-- logs
|-- temp
|-- webapps
    |-- ROOT
    |-- manager
    |-- host-manager
|-- work

Following is the startup/shutdown/restart script I'm using:

#!/bin/sh

if [ "$CATALINA_BASE" = "" ]; then
        export CATALINA_BASE=/data/tomcat2
fi

case "$1" in
'start')
. /data/tomcat2/bin/catalina.sh start
;;
'stop')
. /data/tomcat2/bin/catalina.sh stop
;;
'restart')
. /data/tomcat2/bin/catalina.sh stop
sleep 10
. /data/tomcat2/bin/catalina.sh start
;;
*)
echo "Usage: {start|stop|restart}"
;;
esac

Re: Secondary instance of Tomcat on single server does not process requests

Posted by Ari King <ar...@gmail.com>.
Thanks for pointing out that I needed tomcat-juli.jar and for the detailed
explanation of your setup; it was very helpful. By adding tomcat-juli.jar to
the instance bin directory and modifiying my startup/shutdown scripts
accordingly, I was able to get the second tomcat instance working.

I appreciate everyones help.

Best,
Ari

On Thu, Nov 4, 2010 at 3:30 PM, Mark Eggers <it...@yahoo.com> wrote:

> From the RUNNING.txt you will need tomcat-juli.jar in $CATALINA_BASE/bin.
>
> That being said, I start up and shut down 4 Tomcat instances when I'm
> working on
> cluster issues. Here's a typical directory structure I use for each Tomcat
> that's a part of the cluster:
>
> deimos-host/
> ├── bin
> │   ├── setenv.sh
> │   ├── shutdown.sh
> │   ├── startup.sh
> │   └── tomcat-juli.jar
> ├── conf
> │   ├── Catalina
> │   │   └── localhost
> │   │       ├── host-manager.xml
> │   │       ├── manager.xml
> │   ├── catalina.policy
> │   ├── catalina.properties
> │   ├── context.xml
> │   ├── logging.properties
> │   ├── server.xml
> │   ├── tomcat-users.xml
> │   └── web.xml
> ├── lib
> ├── logs
> ├── temp
> ├── temp-dir
> ├── watch-dir
> ├── webapps
> │   ├── docs
> │   ├── manager
> │   ├── ROOT
> └── work
>
> I've left out the actual web applications and permissions.
>
> Here's my startup.sh script for the above host.
>
> #!/bin/bash
> export CATALINA_BASE=/someplace/deimos-host
> export CATALINA_HOME=/reference-place/apache-tomcat-6.0.29
> $CATALINA_HOME/bin/startup.sh
>
> The shutdown.sh script is similar.
>
> I have a bunch of environment variables in setenv.sh. They reference where
> log4j
> logs should go and enables JMX. Those aren't really important.
>
> Finally, I start the entire cluster with the following script.
>
> #!/bin/bash
> ( phobos-host/bin/startup.sh )
> sleep 5
> ( deimos-host/bin/startup.sh )
> sleep 5
> ( mars-host/bin/startup.sh )
> sleep 5
> ( xerxes-host/bin/startup.sh )
>
> The cluster shutdown script is similar.
>
> There are a few things to note in the above script. The parentheses are
> necessary around each startup script. If you take a look at the stock
> startup.sh
> script in $CATALINA_HOME/bin, you'll find that the last line is:
>
> exec "$PRGDIR"/"$EXECUTABLE" start "$@"
>
> exec replaces the current shell. So if you write a script that tries to
> start
> multiple Tomcats, the first time you run the stock startup.sh script, your
> shell
> gets replaced.
>
> I have sleep statements in my script since this is for a cluster and I
> don't
> define a port in the Receiver element of the cluster. This allows Tomcat to
> find
> open ports for cluster communication.
>
> . . . . just my two cents
>
> /mde/
>
> ----- Original Message ----
> From: Ari King <ar...@gmail.com>
> To: Tomcat Users List <us...@tomcat.apache.org>
> Sent: Thu, November 4, 2010 11:21:58 AM
> Subject: Re: Secondary instance of Tomcat on single server does not process
> requests
>
> On Thu, Nov 4, 2010 at 1:09 PM, Konstantin Kolinko
> <kn...@gmail.com>wrote:
>
> > 2010/11/4 Ari King <ar...@gmail.com>:
> > > |-- conf
> > >     |-- server.xml
> > >     |-- web.xml
> >
> > Those two files are not sufficient.
> >
> > Note, that the conf folder is read only from the second instance.
> > (The files in CATALINA_HOME\conf are never read).
> >
> >
> Which other files are needed? I tried copying all the files from the conf
> directory of the base configuration, but that didn't resolve the issue
> either.
>
> Also, I have changed the shutdown port from 8005 to 8006. Any other
> ideas/suggestions? Thanks.
>
>
>
>
>
>  ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Secondary instance of Tomcat on single server does not process requests

Posted by Mark Eggers <it...@yahoo.com>.
>From the RUNNING.txt you will need tomcat-juli.jar in $CATALINA_BASE/bin.

That being said, I start up and shut down 4 Tomcat instances when I'm working on 
cluster issues. Here's a typical directory structure I use for each Tomcat 
that's a part of the cluster:

deimos-host/
├── bin
│   ├── setenv.sh
│   ├── shutdown.sh
│   ├── startup.sh
│   └── tomcat-juli.jar
├── conf
│   ├── Catalina
│   │   └── localhost
│   │       ├── host-manager.xml
│   │       ├── manager.xml
│   ├── catalina.policy
│   ├── catalina.properties
│   ├── context.xml
│   ├── logging.properties
│   ├── server.xml
│   ├── tomcat-users.xml
│   └── web.xml
├── lib
├── logs
├── temp
├── temp-dir
├── watch-dir
├── webapps
│   ├── docs
│   ├── manager
│   ├── ROOT
└── work

I've left out the actual web applications and permissions.

Here's my startup.sh script for the above host.

#!/bin/bash
export CATALINA_BASE=/someplace/deimos-host
export CATALINA_HOME=/reference-place/apache-tomcat-6.0.29
$CATALINA_HOME/bin/startup.sh

The shutdown.sh script is similar.

I have a bunch of environment variables in setenv.sh. They reference where log4j 
logs should go and enables JMX. Those aren't really important.

Finally, I start the entire cluster with the following script.

#!/bin/bash
( phobos-host/bin/startup.sh )
sleep 5
( deimos-host/bin/startup.sh )
sleep 5
( mars-host/bin/startup.sh )
sleep 5
( xerxes-host/bin/startup.sh )

The cluster shutdown script is similar.

There are a few things to note in the above script. The parentheses are 
necessary around each startup script. If you take a look at the stock startup.sh 
script in $CATALINA_HOME/bin, you'll find that the last line is:

exec "$PRGDIR"/"$EXECUTABLE" start "$@"

exec replaces the current shell. So if you write a script that tries to start 
multiple Tomcats, the first time you run the stock startup.sh script, your shell 
gets replaced.

I have sleep statements in my script since this is for a cluster and I don't 
define a port in the Receiver element of the cluster. This allows Tomcat to find 
open ports for cluster communication.

. . . . just my two cents

/mde/

----- Original Message ----
From: Ari King <ar...@gmail.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Thu, November 4, 2010 11:21:58 AM
Subject: Re: Secondary instance of Tomcat on single server does not process 
requests

On Thu, Nov 4, 2010 at 1:09 PM, Konstantin Kolinko
<kn...@gmail.com>wrote:

> 2010/11/4 Ari King <ar...@gmail.com>:
> > |-- conf
> >     |-- server.xml
> >     |-- web.xml
>
> Those two files are not sufficient.
>
> Note, that the conf folder is read only from the second instance.
> (The files in CATALINA_HOME\conf are never read).
>
>
Which other files are needed? I tried copying all the files from the conf
directory of the base configuration, but that didn't resolve the issue
either.

Also, I have changed the shutdown port from 8005 to 8006. Any other
ideas/suggestions? Thanks.



      

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


Re: Secondary instance of Tomcat on single server does not process requests

Posted by Pid <pi...@pidster.com>.
On 04/11/2010 19:21, Ari King wrote:
> On Thu, Nov 4, 2010 at 1:09 PM, Konstantin Kolinko
> <kn...@gmail.com>wrote:
> 
>> 2010/11/4 Ari King <ar...@gmail.com>:
>>> |-- conf
>>>     |-- server.xml
>>>     |-- web.xml
>>
>> Those two files are not sufficient.
>>
>> Note, that the conf folder is read only from the second instance.
>> (The files in CATALINA_HOME\conf are never read).
>>
>>
> Which other files are needed? I tried copying all the files from the conf
> directory of the base configuration, but that didn't resolve the issue
> either.
> 
> Also, I have changed the shutdown port from 8005 to 8006. Any other
> ideas/suggestions? Thanks.

What does the log say?


p

Re: Secondary instance of Tomcat on single server does not process requests

Posted by Ari King <ar...@gmail.com>.
On Thu, Nov 4, 2010 at 1:09 PM, Konstantin Kolinko
<kn...@gmail.com>wrote:

> 2010/11/4 Ari King <ar...@gmail.com>:
> > |-- conf
> >     |-- server.xml
> >     |-- web.xml
>
> Those two files are not sufficient.
>
> Note, that the conf folder is read only from the second instance.
> (The files in CATALINA_HOME\conf are never read).
>
>
Which other files are needed? I tried copying all the files from the conf
directory of the base configuration, but that didn't resolve the issue
either.

Also, I have changed the shutdown port from 8005 to 8006. Any other
ideas/suggestions? Thanks.

Re: Secondary instance of Tomcat on single server does not process requests

Posted by Konstantin Kolinko <kn...@gmail.com>.
2010/11/4 Ari King <ar...@gmail.com>:
> |-- conf
>     |-- server.xml
>     |-- web.xml

Those two files are not sufficient.

Note, that the conf folder is read only from the second instance.
(The files in CATALINA_HOME\conf are never read).

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


Re: Secondary instance of Tomcat on single server does not process requests

Posted by David kerber <dc...@verizon.net>.
On 11/4/2010 12:56 PM, Ari King wrote:
> Hi all,
>
> My secondary instance of Tomcat 6 does not process requests -- it simply
> times out for everything. The only log is catalina.out and there are not
> errors in it. Anyone know what could be wrong? I'm using Tomcat 6, Java
> 1.6.0_20, on Centos 5.5 Final.
>
> I've set the secondary instance to use port 8081 for http and 8010 for AJP,
> both have redirect ports of 8444.

...

What about the shutdown port?  POssible conflict there?


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