Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Users

Tomcat times out

 

 

Linux-HA users RSS feed   Index | Next | Previous | View Threaded


ehlers at clinresearch

Jul 4, 2008, 5:57 AM

Post #1 of 12 (305 views)
Permalink
Tomcat times out

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


nick at mobilia

Jul 4, 2008, 6:17 AM

Post #2 of 12 (297 views)
Permalink
Re: Tomcat times out [In reply to]

Ehlers, Kolja ha scritto:
> 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

tomcat meta-data output..

The start <operation> can have whatever timeout you want.


<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="tomcat">
<version>1.0</version>

<longdesc lang="en">
Resource script for tomcat. It manages a Tomcat instance as an HA resource.
</longdesc>
<shortdesc lang="en">tomcat resource agent</shortdesc>

<parameters>

<parameter name="tomcat_name" unique="1" >
<longdesc lang="en">
The name of the resource
</longdesc>
<shortdesc>The name of the resource</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="script_log" unique="1">
<longdesc lang="en">
A destination of the log of this script
</longdesc>
<shortdesc>A destination of the log of this script</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="tomcat_stop_timeout" unique="0">
<longdesc lang="en">
Time-out at the time of the stop
</longdesc>
<shortdesc>Time-out at the time of the stop</shortdesc>
<content type="integer" default="" />
</parameter>

<parameter name="tomcat_suspend_trialcount" unique="0">
<longdesc lang="en">
The re-try number of times awaiting a stop
</longdesc>
<shortdesc>The re-try number of times awaiting a stop</shortdesc>
<content type="integer" default="" />
</parameter>

<parameter name="tomcat_user" unique="0">
<longdesc lang="en">
A user name to start a resource
</longdesc>
<shortdesc>A user name to start a resource</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="statusurl" unique="0">
<longdesc lang="en">
URL for state confirmation
</longdesc>
<shortdesc>URL for state confirmation</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="java_home" unique="1" required="1">
<longdesc lang="en">
Home directory of the Java
</longdesc>
<shortdesc>Home directory of the Java</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="catalina_home" unique="1" required="1">
<longdesc lang="en">
Home directory of Tomcat
</longdesc>
<shortdesc>Home directory of Tomcat</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="catalina_pid" unique="1">
<longdesc lang="en">
A PID file name of Tomcat
</longdesc>
<shortdesc>A PID file name of Tomcat</shortdesc>
<content type="string" default="" />
</parameter>

</parameters>

<actions>
<action name="start" timeout="60s" />
<action name="stop" timeout="120s" />
<action name="status" timeout="60" />
<action name="monitor" depth="0" timeout="30s" interval="10s"
start-delay="10s" />
<action name="meta-data" timeout="5s" />
<action name="validate-all" timeout="5"/>
</actions>
</resource-agent>



_______________________________________________
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


ehlers at clinresearch

Jul 4, 2008, 7:07 AM

Post #3 of 12 (292 views)
Permalink
AW: Tomcat times out [In reply to]

Thanks for your help now I raised the timeout to 120s and I see it trying
for 180 seconds:

tomcat[1861]: 2008/07/04_15:55:27 DEBUG: start_tomcat[tomcat]: retry
monitor_tomcat
...
tomcat[1861]: 2008/07/04_15:58:23 DEBUG: start_tomcat[tomcat]: retry
monitor_tomcat

Is it waiting for a RC or is the monitor trying to connect to the statusurl?
Like I said after ~50 seconds tomcat is running but heartbeat does not see
that. I connect to the statusurl fine.

Then heartbeats kills it and tomcat is stopped:

lrmd[7325]: 2008/07/04_15:58:24 WARN: tomcat_21:start process (PID 1861)
timed out (try 1). Killing with signal SIGTERM (15).
lrmd[7325]: 2008/07/04_15:58:24 WARN: operation start[31] on
ocf::tomcat::tomcat_21 for client 7328, its parameters:
catalina_home=[/opt/jakarta/tomcat-5] CRM_meta_interval=[0]
catalina_pid=[/opt/jakarta/tomcat-5/logs/catalina.pid]
CRM_meta_id=[tomcat_start] CRM_meta_timeout=[180000] crm_feature_set=[2.0]
java_home=[/usr/lib/java]
statusurl=[http://localhost:8085/startcenter/jsp/login.jsp]
CRM_meta_name=[start] : pid [1861] timed out
crmd[7328]: 2008/07/04_15:58:24 ERROR: process_lrm_event: LRM operation
tomcat_21_start_0 (31) Timed Out (timeout=180000ms)

Its also strange that this PID 1861 is different with the one in
/opt/jakarta/tomcat-5/logs/catalina.pid still it does kill tomcat.

Thanks for helping


-----Ursprüngliche Nachricht-----
Von: linux-ha-bounces[at]lists.linux-ha.org
[mailto:linux-ha-bounces[at]lists.linux-ha.org]Im Auftrag von Nick
Gesendet: Freitag, 4. Juli 2008 15:17
An: General Linux-HA mailing list
Betreff: Re: [Linux-HA] Tomcat times out


Ehlers, Kolja ha scritto:
> 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

tomcat meta-data output..

The start <operation> can have whatever timeout you want.


<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="tomcat">
<version>1.0</version>

<longdesc lang="en">
Resource script for tomcat. It manages a Tomcat instance as an HA resource.
</longdesc>
<shortdesc lang="en">tomcat resource agent</shortdesc>

<parameters>

<parameter name="tomcat_name" unique="1" >
<longdesc lang="en">
The name of the resource
</longdesc>
<shortdesc>The name of the resource</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="script_log" unique="1">
<longdesc lang="en">
A destination of the log of this script
</longdesc>
<shortdesc>A destination of the log of this script</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="tomcat_stop_timeout" unique="0">
<longdesc lang="en">
Time-out at the time of the stop
</longdesc>
<shortdesc>Time-out at the time of the stop</shortdesc>
<content type="integer" default="" />
</parameter>

<parameter name="tomcat_suspend_trialcount" unique="0">
<longdesc lang="en">
The re-try number of times awaiting a stop
</longdesc>
<shortdesc>The re-try number of times awaiting a stop</shortdesc>
<content type="integer" default="" />
</parameter>

<parameter name="tomcat_user" unique="0">
<longdesc lang="en">
A user name to start a resource
</longdesc>
<shortdesc>A user name to start a resource</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="statusurl" unique="0">
<longdesc lang="en">
URL for state confirmation
</longdesc>
<shortdesc>URL for state confirmation</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="java_home" unique="1" required="1">
<longdesc lang="en">
Home directory of the Java
</longdesc>
<shortdesc>Home directory of the Java</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="catalina_home" unique="1" required="1">
<longdesc lang="en">
Home directory of Tomcat
</longdesc>
<shortdesc>Home directory of Tomcat</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="catalina_pid" unique="1">
<longdesc lang="en">
A PID file name of Tomcat
</longdesc>
<shortdesc>A PID file name of Tomcat</shortdesc>
<content type="string" default="" />
</parameter>

</parameters>

<actions>
<action name="start" timeout="60s" />
<action name="stop" timeout="120s" />
<action name="status" timeout="60" />
<action name="monitor" depth="0" timeout="30s" interval="10s"
start-delay="10s" />
<action name="meta-data" timeout="5s" />
<action name="validate-all" timeout="5"/>
</actions>
</resource-agent>



_______________________________________________
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

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


ehlers at clinresearch

Jul 4, 2008, 7:24 AM

Post #4 of 12 (292 views)
Permalink
AW: Tomcat times out [In reply to]

root 17084 0.1 0.1 2940 1404 ? S 16:17 0:00 /bin/sh
/usr/lib/ocf/resource.d//heartbeat/tomcat start
wwwrun 17658 37.4 7.7 921944 80172 ? Sl 16:17 0:18
/usr/lib/java/bin/java -server -Xms256m -Xmx700m -Djava.net.preferIPv4Stack=
true -Djava.endor

these are my two processes at the moment that heartbeat has started tomcat
but hasnt realized it. Then it kills the tomcat start process

lrmd[7325]: 2008/07/04_16:20:09 WARN: tomcat_21:start process (PID 17084)
timed out (try 1). Killing with signal SIGTERM (15).

So it is the same problem as if I try to start tomcat by hand using
/usr/lib/ocf/resource.d//heartbeat/tomcat start

it just hangs there and doesnt know that tomcat is started. Can somebody
explain what it is waiting for?

Thanks


-----Ursprüngliche Nachricht-----
Von: linux-ha-bounces[at]lists.linux-ha.org
[mailto:linux-ha-bounces[at]lists.linux-ha.org]Im Auftrag von Ehlers, Kolja
Gesendet: Freitag, 4. Juli 2008 16:08
An: General Linux-HA mailing list
Betreff: AW: [Linux-HA] Tomcat times out


Thanks for your help now I raised the timeout to 120s and I see it trying
for 180 seconds:

tomcat[1861]: 2008/07/04_15:55:27 DEBUG: start_tomcat[tomcat]: retry
monitor_tomcat
...
tomcat[1861]: 2008/07/04_15:58:23 DEBUG: start_tomcat[tomcat]: retry
monitor_tomcat

Is it waiting for a RC or is the monitor trying to connect to the statusurl?
Like I said after ~50 seconds tomcat is running but heartbeat does not see
that. I connect to the statusurl fine.

Then heartbeats kills it and tomcat is stopped:

lrmd[7325]: 2008/07/04_15:58:24 WARN: tomcat_21:start process (PID 1861)
timed out (try 1). Killing with signal SIGTERM (15).
lrmd[7325]: 2008/07/04_15:58:24 WARN: operation start[31] on
ocf::tomcat::tomcat_21 for client 7328, its parameters:
catalina_home=[/opt/jakarta/tomcat-5] CRM_meta_interval=[0]
catalina_pid=[/opt/jakarta/tomcat-5/logs/catalina.pid]
CRM_meta_id=[tomcat_start] CRM_meta_timeout=[180000] crm_feature_set=[2.0]
java_home=[/usr/lib/java]
statusurl=[http://localhost:8085/startcenter/jsp/login.jsp]
CRM_meta_name=[start] : pid [1861] timed out
crmd[7328]: 2008/07/04_15:58:24 ERROR: process_lrm_event: LRM operation
tomcat_21_start_0 (31) Timed Out (timeout=180000ms)

Its also strange that this PID 1861 is different with the one in
/opt/jakarta/tomcat-5/logs/catalina.pid still it does kill tomcat.

Thanks for helping


-----Ursprüngliche Nachricht-----
Von: linux-ha-bounces[at]lists.linux-ha.org
[mailto:linux-ha-bounces[at]lists.linux-ha.org]Im Auftrag von Nick
Gesendet: Freitag, 4. Juli 2008 15:17
An: General Linux-HA mailing list
Betreff: Re: [Linux-HA] Tomcat times out


Ehlers, Kolja ha scritto:
> 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

tomcat meta-data output..

The start <operation> can have whatever timeout you want.


<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="tomcat">
<version>1.0</version>

<longdesc lang="en">
Resource script for tomcat. It manages a Tomcat instance as an HA resource.
</longdesc>
<shortdesc lang="en">tomcat resource agent</shortdesc>

<parameters>

<parameter name="tomcat_name" unique="1" >
<longdesc lang="en">
The name of the resource
</longdesc>
<shortdesc>The name of the resource</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="script_log" unique="1">
<longdesc lang="en">
A destination of the log of this script
</longdesc>
<shortdesc>A destination of the log of this script</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="tomcat_stop_timeout" unique="0">
<longdesc lang="en">
Time-out at the time of the stop
</longdesc>
<shortdesc>Time-out at the time of the stop</shortdesc>
<content type="integer" default="" />
</parameter>

<parameter name="tomcat_suspend_trialcount" unique="0">
<longdesc lang="en">
The re-try number of times awaiting a stop
</longdesc>
<shortdesc>The re-try number of times awaiting a stop</shortdesc>
<content type="integer" default="" />
</parameter>

<parameter name="tomcat_user" unique="0">
<longdesc lang="en">
A user name to start a resource
</longdesc>
<shortdesc>A user name to start a resource</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="statusurl" unique="0">
<longdesc lang="en">
URL for state confirmation
</longdesc>
<shortdesc>URL for state confirmation</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="java_home" unique="1" required="1">
<longdesc lang="en">
Home directory of the Java
</longdesc>
<shortdesc>Home directory of the Java</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="catalina_home" unique="1" required="1">
<longdesc lang="en">
Home directory of Tomcat
</longdesc>
<shortdesc>Home directory of Tomcat</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="catalina_pid" unique="1">
<longdesc lang="en">
A PID file name of Tomcat
</longdesc>
<shortdesc>A PID file name of Tomcat</shortdesc>
<content type="string" default="" />
</parameter>

</parameters>

<actions>
<action name="start" timeout="60s" />
<action name="stop" timeout="120s" />
<action name="status" timeout="60" />
<action name="monitor" depth="0" timeout="30s" interval="10s"
start-delay="10s" />
<action name="meta-data" timeout="5s" />
<action name="validate-all" timeout="5"/>
</actions>
</resource-agent>



_______________________________________________
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

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

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


ehlers at clinresearch

Jul 4, 2008, 7:53 AM

Post #5 of 12 (293 views)
Permalink
AW: Tomcat times out [In reply to]

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.

_______________________________________________
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


ehlers at clinresearch

Jul 7, 2008, 2:40 AM

Post #6 of 12 (269 views)
Permalink
AW: Tomcat times out [In reply to]

Hello all,

I have a general question about bash programming since yet I am not too
familiar with it. The isrunning_tomcat() function in the tomcat ocf keeps
returning an error code. This is the function:

if wget -O /dev/null $RESOURCE_STATUSURL 2>/dev/null; then
return $OCF_SUCCESS
fi
return $OCF_ERR_GENERIC

The problem is the if condition keeps returning false. I just dont get this
part:

wget -O /dev/null $RESOURCE_STATUSURL 2>/dev/null;

What does especially the 2 mean? I know that wget tries to connect to the
statusurl, but the wget responds is directed to dev/null so how can this be
true or false?

Thanks


-----Ursprüngliche Nachricht-----
Von: linux-ha-bounces[at]lists.linux-ha.org
[mailto:linux-ha-bounces[at]lists.linux-ha.org]Im Auftrag von Nick
Gesendet: Freitag, 4. Juli 2008 15:17
An: General Linux-HA mailing list
Betreff: Re: [Linux-HA] Tomcat times out


Ehlers, Kolja ha scritto:
> 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

tomcat meta-data output..

The start <operation> can have whatever timeout you want.


<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="tomcat">
<version>1.0</version>

<longdesc lang="en">
Resource script for tomcat. It manages a Tomcat instance as an HA resource.
</longdesc>
<shortdesc lang="en">tomcat resource agent</shortdesc>

<parameters>

<parameter name="tomcat_name" unique="1" >
<longdesc lang="en">
The name of the resource
</longdesc>
<shortdesc>The name of the resource</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="script_log" unique="1">
<longdesc lang="en">
A destination of the log of this script
</longdesc>
<shortdesc>A destination of the log of this script</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="tomcat_stop_timeout" unique="0">
<longdesc lang="en">
Time-out at the time of the stop
</longdesc>
<shortdesc>Time-out at the time of the stop</shortdesc>
<content type="integer" default="" />
</parameter>

<parameter name="tomcat_suspend_trialcount" unique="0">
<longdesc lang="en">
The re-try number of times awaiting a stop
</longdesc>
<shortdesc>The re-try number of times awaiting a stop</shortdesc>
<content type="integer" default="" />
</parameter>

<parameter name="tomcat_user" unique="0">
<longdesc lang="en">
A user name to start a resource
</longdesc>
<shortdesc>A user name to start a resource</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="statusurl" unique="0">
<longdesc lang="en">
URL for state confirmation
</longdesc>
<shortdesc>URL for state confirmation</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="java_home" unique="1" required="1">
<longdesc lang="en">
Home directory of the Java
</longdesc>
<shortdesc>Home directory of the Java</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="catalina_home" unique="1" required="1">
<longdesc lang="en">
Home directory of Tomcat
</longdesc>
<shortdesc>Home directory of Tomcat</shortdesc>
<content type="string" default="" />
</parameter>

<parameter name="catalina_pid" unique="1">
<longdesc lang="en">
A PID file name of Tomcat
</longdesc>
<shortdesc>A PID file name of Tomcat</shortdesc>
<content type="string" default="" />
</parameter>

</parameters>

<actions>
<action name="start" timeout="60s" />
<action name="stop" timeout="120s" />
<action name="status" timeout="60" />
<action name="monitor" depth="0" timeout="30s" interval="10s"
start-delay="10s" />
<action name="meta-data" timeout="5s" />
<action name="validate-all" timeout="5"/>
</actions>
</resource-agent>



_______________________________________________
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

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


linux-ha at mm

Jul 7, 2008, 2:57 AM

Post #7 of 12 (268 views)
Permalink
Re: Tomcat times out [In reply to]

On Mon, Jul 07, 2008 at 11:40:06AM +0200, Ehlers, Kolja wrote:
>
> I have a general question about bash programming since yet I am
> not too familiar with it. The isrunning_tomcat() function in the
> tomcat ocf keeps returning an error code. This is the function:
>
> if wget -O /dev/null $RESOURCE_STATUSURL 2>/dev/null; then
> return $OCF_SUCCESS
> fi
> return $OCF_ERR_GENERIC
>
> The problem is the if condition keeps returning false. I just dont
> get this part:
>
> wget -O /dev/null $RESOURCE_STATUSURL 2>/dev/null;
>
> What does especially the 2 mean? I know that wget tries to connect
> to the statusurl, but the wget responds is directed to dev/null so
> how can this be true or false?

The 2> part is redirecting file descriptor 2 (stderr) to /dev/null,
which hides the status messages as well as any error messages.
The actual file download is output to /dev/null as well (via -O).

The return code is whatever wget exit()s to the system with. You can
look at it in the shell with $?.

e.g.

$ true ; echo $?
0
$ false ; echo $?
1

So to test wget, you can work out what $RESOURCE_STATUSURL is,
and then run:

wget -O /dev/null http://whatever/the/status/url/is.jsp
echo $?

The 'echo $?' should output 0 if the service is available. Anything
else will be evaluated as "false".
_______________________________________________
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


ehlers at clinresearch

Jul 7, 2008, 6:56 AM

Post #8 of 12 (263 views)
Permalink
AW: Tomcat times out [In reply to]

Thank you Michael for the very detailed help. Its working pretty okay now
still I have one more question.

I am running Apache and one virtual ip adress in one group now and 9 tomcat
instances ungrouped. I want heartbeat to start and monitor the apache/ip
group on only one node and all tomcats on both nodes. So if apache or the ip
fails merge the ip and apache to the other node, the tomcats are already
started there.

I guess for the tomcat instances it is an active/active configuration and
for the apache/ip group an active passive. I read here
http://www.linux-ha.org/GettingStartedV2/TwoApaches that there is not much
to do for an active/active configuration but to make groups.

My resources look like this now:


Resource Group: group_1
IPaddr_192_168_11_25 (ocf::heartbeat:IPaddr): Started
www1test
apache_2 (ocf::heartbeat:apache): Started www1test
tomcat_21 (ocf::heartbeat:tomcat): Started www1test
tomcat_22 (ocf::heartbeat:tomcat): Started www1test
tomcat_22sdb (ocf::heartbeat:tomcat): Started www1test
tomcat_30 (ocf::heartbeat:tomcat): Started www1test
tomcat_34 (ocf::heartbeat:tomcat): Started www1test
tomcat_35 (ocf::heartbeat:tomcat): Started www1test
tomcat_36 (ocf::heartbeat:tomcat): Started www2test
tomcat_37 (ocf::heartbeat:tomcat): Started www2test
tomcat_38 (ocf::heartbeat:tomcat): Started www2test

So im guessing I still have not configured it correctly. I want it to look
like this:

Resource Group: group_1
IPaddr_192_168_11_25 (ocf::heartbeat:IPaddr): Started
www1test
apache_2 (ocf::heartbeat:apache): Started www1test
tomcat_21 (ocf::heartbeat:tomcat): Started www1test
tomcat_21 (ocf::heartbeat:tomcat): Started www2test
tomcat_22 (ocf::heartbeat:tomcat): Started www1test
tomcat_22 (ocf::heartbeat:tomcat): Started www2test
tomcat_22sdb (ocf::heartbeat:tomcat): Started www1test
tomcat_22sdb (ocf::heartbeat:tomcat): Started www2test
...

or is this not possible?

Thanks again


-----Ursprungliche Nachricht-----
Von: linux-ha-bounces[at]lists.linux-ha.org
[mailto:linux-ha-bounces[at]lists.linux-ha.org]Im Auftrag von Michael Alger
Gesendet: Montag, 7. Juli 2008 11:58
An: General Linux-HA mailing list
Betreff: Re: [Linux-HA] Tomcat times out


On Mon, Jul 07, 2008 at 11:40:06AM +0200, Ehlers, Kolja wrote:
>
> I have a general question about bash programming since yet I am
> not too familiar with it. The isrunning_tomcat() function in the
> tomcat ocf keeps returning an error code. This is the function:
>
> if wget -O /dev/null $RESOURCE_STATUSURL 2>/dev/null; then
> return $OCF_SUCCESS
> fi
> return $OCF_ERR_GENERIC
>
> The problem is the if condition keeps returning false. I just dont
> get this part:
>
> wget -O /dev/null $RESOURCE_STATUSURL 2>/dev/null;
>
> What does especially the 2 mean? I know that wget tries to connect
> to the statusurl, but the wget responds is directed to dev/null so
> how can this be true or false?

The 2> part is redirecting file descriptor 2 (stderr) to /dev/null,
which hides the status messages as well as any error messages.
The actual file download is output to /dev/null as well (via -O).

The return code is whatever wget exit()s to the system with. You can
look at it in the shell with $?.

e.g.

$ true ; echo $?
0
$ false ; echo $?
1

So to test wget, you can work out what $RESOURCE_STATUSURL is,
and then run:

wget -O /dev/null http://whatever/the/status/url/is.jsp
echo $?

The 'echo $?' should output 0 if the service is available. Anything
else will be evaluated as "false".
_______________________________________________
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

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


ehlers at clinresearch

Jul 7, 2008, 7:18 AM

Post #9 of 12 (264 views)
Permalink
AW: Tomcat times out [In reply to]

what I probably could do to have my 9 tomcat instances on both nodes is
create another 9 resources. Then apply to the first ones a rule to only run
on node1 and to the other to stay on node2. Is this the proper way to do
this?

For explanation: I will be using the apache_jk to balance the load to the
different tomcat workers and this will only work if all tomcats run on both
nodes.

Thanks

Kolja

-----Ursprungliche Nachricht-----
Von: linux-ha-bounces[at]lists.linux-ha.org
[mailto:linux-ha-bounces[at]lists.linux-ha.org]Im Auftrag von Ehlers, Kolja
Gesendet: Montag, 7. Juli 2008 15:57
An: linux-ha[at]lists.linux-ha.org
Betreff: AW: [Linux-HA] Tomcat times out


Thank you Michael for the very detailed help. Its working pretty okay now
still I have one more question.

I am running Apache and one virtual ip adress in one group now and 9 tomcat
instances ungrouped. I want heartbeat to start and monitor the apache/ip
group on only one node and all tomcats on both nodes. So if apache or the ip
fails merge the ip and apache to the other node, the tomcats are already
started there.

I guess for the tomcat instances it is an active/active configuration and
for the apache/ip group an active passive. I read here
http://www.linux-ha.org/GettingStartedV2/TwoApaches that there is not much
to do for an active/active configuration but to make groups.

My resources look like this now:


Resource Group: group_1
IPaddr_192_168_11_25 (ocf::heartbeat:IPaddr): Started
www1test
apache_2 (ocf::heartbeat:apache): Started www1test
tomcat_21 (ocf::heartbeat:tomcat): Started www1test
tomcat_22 (ocf::heartbeat:tomcat): Started www1test
tomcat_22sdb (ocf::heartbeat:tomcat): Started www1test
tomcat_30 (ocf::heartbeat:tomcat): Started www1test
tomcat_34 (ocf::heartbeat:tomcat): Started www1test
tomcat_35 (ocf::heartbeat:tomcat): Started www1test
tomcat_36 (ocf::heartbeat:tomcat): Started www2test
tomcat_37 (ocf::heartbeat:tomcat): Started www2test
tomcat_38 (ocf::heartbeat:tomcat): Started www2test

So im guessing I still have not configured it correctly. I want it to look
like this:

Resource Group: group_1
IPaddr_192_168_11_25 (ocf::heartbeat:IPaddr): Started
www1test
apache_2 (ocf::heartbeat:apache): Started www1test
tomcat_21 (ocf::heartbeat:tomcat): Started www1test
tomcat_21 (ocf::heartbeat:tomcat): Started www2test
tomcat_22 (ocf::heartbeat:tomcat): Started www1test
tomcat_22 (ocf::heartbeat:tomcat): Started www2test
tomcat_22sdb (ocf::heartbeat:tomcat): Started www1test
tomcat_22sdb (ocf::heartbeat:tomcat): Started www2test
...

or is this not possible?

Thanks again


-----Ursprungliche Nachricht-----
Von: linux-ha-bounces[at]lists.linux-ha.org
[mailto:linux-ha-bounces[at]lists.linux-ha.org]Im Auftrag von Michael Alger
Gesendet: Montag, 7. Juli 2008 11:58
An: General Linux-HA mailing list
Betreff: Re: [Linux-HA] Tomcat times out


On Mon, Jul 07, 2008 at 11:40:06AM +0200, Ehlers, Kolja wrote:
>
> I have a general question about bash programming since yet I am
> not too familiar with it. The isrunning_tomcat() function in the
> tomcat ocf keeps returning an error code. This is the function:
>
> if wget -O /dev/null $RESOURCE_STATUSURL 2>/dev/null; then
> return $OCF_SUCCESS
> fi
> return $OCF_ERR_GENERIC
>
> The problem is the if condition keeps returning false. I just dont
> get this part:
>
> wget -O /dev/null $RESOURCE_STATUSURL 2>/dev/null;
>
> What does especially the 2 mean? I know that wget tries to connect
> to the statusurl, but the wget responds is directed to dev/null so
> how can this be true or false?

The 2> part is redirecting file descriptor 2 (stderr) to /dev/null,
which hides the status messages as well as any error messages.
The actual file download is output to /dev/null as well (via -O).

The return code is whatever wget exit()s to the system with. You can
look at it in the shell with $?.

e.g.

$ true ; echo $?
0
$ false ; echo $?
1

So to test wget, you can work out what $RESOURCE_STATUSURL is,
and then run:

wget -O /dev/null http://whatever/the/status/url/is.jsp
echo $?

The 'echo $?' should output 0 if the service is available. Anything
else will be evaluated as "false".
_______________________________________________
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

Geschdftsf|hrung: Dr. Michael Fischer, Reinhard Eisebitt
Amtsgericht Kvln 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

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


linux-ha at mm

Jul 7, 2008, 8:14 AM

Post #10 of 12 (265 views)
Permalink
Re: Tomcat times out [In reply to]

On Mon, Jul 07, 2008 at 04:18:48PM +0200, Ehlers, Kolja wrote:
>> I am running Apache and one virtual ip adress in one group now
>> and 9 tomcat instances ungrouped. I want heartbeat to start and
>> monitor the apache/ip group on only one node and all tomcats on
>> both nodes. So if apache or the ip fails merge the ip and apache
>> to the other node, the tomcats are already started there.
>
> what I probably could do to have my 9 tomcat instances on both
> nodes is create another 9 resources. Then apply to the first ones
> a rule to only run on node1 and to the other to stay on node2. Is
> this the proper way to do this?
>
> For explanation: I will be using the apache_jk to balance the load
> to the different tomcat workers and this will only work if all
> tomcats run on both nodes.

It may work, I haven't tried an active/active setup and looking at the
example I'm not entirely sure why it lets you specify two primitives
with the same id ("apache"). I suppose it must be because they're in
different groups?

Anyway, you might want to read about clones:

http://www.linux-ha.org/v2/Concepts/Clones

I'm not sure how you provide different configuration information to
each clone. My best guess is you'd keep your existing tomcat resource
definitions, but have heartbeat run two clones of each one (limiting
each node to run a single clone of each resource).

It sounds like the tomcat OCF script is pretty functional, so this
should actually be pretty easy. Since you don't seem to want to make
use of the state of the tomcat resources in any way, this is probably
all you need to do to get exactly what you want.
_______________________________________________
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


ehlers at clinresearch

Jul 13, 2008, 11:34 PM

Post #11 of 12 (199 views)
Permalink
AW: Tomcat times out [In reply to]

Hello everybody,

sometimes in my cluster it happens that tomcat the tomcat start or monitor
does not return SUCCESS inside the timeout frame. Then I get:

Failed actions:
tomcat_22:1_start_0 (node=www2test, call=25, rc=-2): Timed Out
tomcat_22sdb:1_start_0 (node=www2test, call=23, rc=-2): Timed Out
tomcat_34:1_start_0 (node=www2test, call=30, rc=-2): Timed Out
tomcat_30:1_start_0 (node=www2test, call=28, rc=-2): Timed Out

Can I somehow learn heartbeat that this error code is not fatal and that it
can retry this resource again. It just cleans it up totally and never tries
to start again.

Thanks

-----Ursprungliche Nachricht-----
Von: linux-ha-bounces[at]lists.linux-ha.org
[mailto:linux-ha-bounces[at]lists.linux-ha.org]Im Auftrag von Michael Alger
Gesendet: Montag, 7. Juli 2008 17:15
An: General Linux-HA mailing list
Betreff: Re: [Linux-HA] Tomcat times out


On Mon, Jul 07, 2008 at 04:18:48PM +0200, Ehlers, Kolja wrote:
>> I am running Apache and one virtual ip adress in one group now
>> and 9 tomcat instances ungrouped. I want heartbeat to start and
>> monitor the apache/ip group on only one node and all tomcats on
>> both nodes. So if apache or the ip fails merge the ip and apache
>> to the other node, the tomcats are already started there.
>
> what I probably could do to have my 9 tomcat instances on both
> nodes is create another 9 resources. Then apply to the first ones
> a rule to only run on node1 and to the other to stay on node2. Is
> this the proper way to do this?
>
> For explanation: I will be using the apache_jk to balance the load
> to the different tomcat workers and this will only work if all
> tomcats run on both nodes.

It may work, I haven't tried an active/active setup and looking at the
example I'm not entirely sure why it lets you specify two primitives
with the same id ("apache"). I suppose it must be because they're in
different groups?

Anyway, you might want to read about clones:

http://www.linux-ha.org/v2/Concepts/Clones

I'm not sure how you provide different configuration information to
each clone. My best guess is you'd keep your existing tomcat resource
definitions, but have heartbeat run two clones of each one (limiting
each node to run a single clone of each resource).

It sounds like the tomcat OCF script is pretty functional, so this
should actually be pretty easy. Since you don't seem to want to make
use of the state of the tomcat resources in any way, this is probably
all you need to do to get exactly what you want.
_______________________________________________
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

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


beekhof at gmail

Jul 13, 2008, 11:38 PM

Post #12 of 12 (201 views)
Permalink
Re: Tomcat times out [In reply to]

On Mon, Jul 14, 2008 at 08:34, Ehlers, Kolja <ehlers[at]clinresearch.com> wrote:
> Hello everybody,
>
> sometimes in my cluster it happens that tomcat the tomcat start or monitor
> does not return SUCCESS inside the timeout frame. Then I get:
>
> Failed actions:
> tomcat_22:1_start_0 (node=www2test, call=25, rc=-2): Timed Out
> tomcat_22sdb:1_start_0 (node=www2test, call=23, rc=-2): Timed Out
> tomcat_34:1_start_0 (node=www2test, call=30, rc=-2): Timed Out
> tomcat_30:1_start_0 (node=www2test, call=28, rc=-2): Timed Out
>
> Can I somehow learn heartbeat that this error code is not fatal and that it
> can retry this resource again. It just cleans it up totally and never tries
> to start again.

better yet, tell heartbeat to wait long enough so that the actions
don't time out.
Look up the default-action-timeout option.

>
> Thanks
>
> -----Ursprungliche Nachricht-----
> Von: linux-ha-bounces[at]lists.linux-ha.org
> [mailto:linux-ha-bounces[at]lists.linux-ha.org]Im Auftrag von Michael Alger
> Gesendet: Montag, 7. Juli 2008 17:15
> An: General Linux-HA mailing list
> Betreff: Re: [Linux-HA] Tomcat times out
>
>
> On Mon, Jul 07, 2008 at 04:18:48PM +0200, Ehlers, Kolja wrote:
>>> I am running Apache and one virtual ip adress in one group now
>>> and 9 tomcat instances ungrouped. I want heartbeat to start and
>>> monitor the apache/ip group on only one node and all tomcats on
>>> both nodes. So if apache or the ip fails merge the ip and apache
>>> to the other node, the tomcats are already started there.
>>
>> what I probably could do to have my 9 tomcat instances on both
>> nodes is create another 9 resources. Then apply to the first ones
>> a rule to only run on node1 and to the other to stay on node2. Is
>> this the proper way to do this?
>>
>> For explanation: I will be using the apache_jk to balance the load
>> to the different tomcat workers and this will only work if all
>> tomcats run on both nodes.
>
> It may work, I haven't tried an active/active setup and looking at the
> example I'm not entirely sure why it lets you specify two primitives
> with the same id ("apache"). I suppose it must be because they're in
> different groups?
>
> Anyway, you might want to read about clones:
>
> http://www.linux-ha.org/v2/Concepts/Clones
>
> I'm not sure how you provide different configuration information to
> each clone. My best guess is you'd keep your existing tomcat resource
> definitions, but have heartbeat run two clones of each one (limiting
> each node to run a single clone of each resource).
>
> It sounds like the tomcat OCF script is pretty functional, so this
> should actually be pretty easy. Since you don't seem to want to make
> use of the state of the tomcat resources in any way, this is probably
> all you need to do to get exactly what you want.
> _______________________________________________
> 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
>
> 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
>
_______________________________________________
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

Linux-HA users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.