AW: [Linux-HA] Tomcat times out

Ehlers, Kolja ehlers at clinresearch.com
Fri Jul 4 08:53:41 MDT 2008


Thanks Peter, I will definitely take a good look at those scipts.

The problem that this ocf tomcat script im using does not realize that
tomcat is running is probably this line in the monitor function:

monitor_tomcat()
{
---->	if ! pgrep -f "java -Dname=$TOMCAT_NAME" > /dev/null; then
		return $OCF_NOT_RUNNING
	fi
	isrunning_tomcat
	if [ $? != $OCF_SUCCESS ]; then
		return $OCF_NOT_RUNNING
	fi
}

Actually the TOMCAT_NAME is optional and by default tomcat. I am not sure if
my Tomcat sets a Dname at all. I will have to look into it after the
weekend.

Thanks again Peter for your help


-----Ursprüngliche Nachricht-----
Von: Peter Clapham [mailto:pc7 at sanger.ac.uk]
Gesendet: Freitag, 4. Juli 2008 16:48
An: ehlers at clinresearch.com
Betreff: Re: [Linux-HA] Tomcat times out


Hello Kolja,

We had plenty of "fun" getting Tomcat to do things in a sane way as a
non-privileged user and fail over reliably with heartbeat.

Here's a very basic over view of what we've done and copies of the
scripts in case they are of any use to you.


Following the Apache Tomcat instructions we compiled the jsvc daemon and
put the jsvcd wrapper together with permissions allowing external
modification without touching the actual resource script (this is not a
requirement but it works so it's in the attachment jsvcd)

The HB resource script is also included (Tomcat). It'll need modifying
for directory and if you're not using Debian then an alternative to
start-stop-daemon *may* be required.

caveats,

Tomcat needs to be able to write to it's logs so make sure that if you
fire it off by hand then the log permissions may change on you. If this
happens re-chown or heartbeat will fail.

A sensible monitor section is absent from this script revision. It's
relatively trivial to add :-D

Enjoy

Pete
> Hello,
>
> to begin with I am trying to startup a single tomcat instance. Even if I
do
> it by hand:
>
> export OCF_RESKEY_java_home=/usr/lib/java
> export OCF_RESKEY_catalina_home=/opt/jakarta/tomcat-5
> export OCF_ROOT=/usr/lib/ocf
> /usr/lib/ocf/resource.d/heartbeat/tomcat start
>
> on the shell, the system just hangs. To get the cursor back to the prompt
I
> need to cancel the script with crtl+c. The thing is that Tomcat actually
> gets started. The pid file is located in the default dir
> OCF_RESKEY_catalina_home/logs/catalina.pid.
>
> If I run heartbeats the tomcat start fails with -2
>
> tomcat_21_start_0 (node=www1test, call=19, rc=-2): Timed Out
>
> Maybe the problem is that even when using my standard tomcat start script
> the start takes almost 50 seconds to start up. Can I define timeouts for
> single resources?
>
> Thanks
>
> Kolja
>
> Geschäftsführung: Dr. Michael Fischer, Reinhard Eisebitt
> Amtsgericht Köln HRB 32356
> Steuer-Nr.: 217/5717/0536
> Ust.Id.-Nr.: DE 204051920
> --
> This email transmission and any documents, files or previous email
> messages attached to it may contain information that is confidential or
> legally privileged. If you are not the intended recipient or a person
> responsible for delivering this transmission to the intended recipient,
> you are hereby notified that any disclosure, copying, printing,
> distribution or use of this transmission is strictly prohibited. If you
> have received this transmission in error, please immediately notify the
> sender by telephone or return email and delete the original transmission
> and its attachments without reading or saving in any manner.
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>




--
 The Wellcome Trust Sanger Institute is operated by Genome Research
 Limited, a charity registered in England with number 1021457 and a
 company registered in England with number 2742969, whose registered
 office is 215 Euston Road, London, NW1 2BE.

Geschäftsführung: Dr. Michael Fischer, Reinhard Eisebitt
Amtsgericht Köln HRB 32356
Steuer-Nr.: 217/5717/0536
Ust.Id.-Nr.: DE 204051920
--
This email transmission and any documents, files or previous email
messages attached to it may contain information that is confidential or
legally privileged. If you are not the intended recipient or a person
responsible for delivering this transmission to the intended recipient,
you are hereby notified that any disclosure, copying, printing,
distribution or use of this transmission is strictly prohibited. If you
have received this transmission in error, please immediately notify the
sender by telephone or return email and delete the original transmission
and its attachments without reading or saving in any manner.



More information about the Linux-HA mailing list