tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Ricker <bric...@wellinx.com>
Subject RE: Reloading w/ Manager on cluster?
Date Thu, 10 Oct 2002 19:57:34 GMT
The script is rather rough right now, but it is simple. I use ssh to
call the tomcat startup script like so:

ssh hostname /etc/init.d/tomcat stop

Here is the contents of the startup script. I have two Tomcat
directories, /usr/local/tomcat1 and /usr/local/tomcat2. I have them
sharing a centralized webapps directory in /usr/local/webapps. I run the
tomcat processes with an unpriveledged use, 'tomcat'.

HTH,

Ben Ricker

-----Tomcat Startup Script-------

#!/bin/sh
#
# tomcat        Starts the Tomcat server
#
# Author:       All kinds of people
#
# chkconfig: 345 50 50
#
# processname: httpd
# pidfile: /usr/local/apache/logs/httpd.pid

# Begin /etc/init.d/apache

case "$1" in
  start)
    echo -n "Starting Tomcat..."
    /bin/su tomcat -c "/usr/local/tomcat1/bin/startup.sh"
    /bin/su tomcat -c "/usr/local/tomcat2/bin/startup.sh"
    ;;

  stop)
    echo -n "Stopping Tomcat..."
    /bin/su tomcat -c "/usr/local/tomcat1/bin/shutdown.sh"
    /bin/su tomcat -c "/usr/local/tomcat2/bin/shutdown.sh"
    ;;

  restart)
    echo -n "Restarting Tomcat..."
    /bin/su tomcat -c "/usr/local/tomcat1/bin/shutdown.sh"
    /bin/su tomcat -c "/usr/local/tomcat2/bin/shutdown.sh"
    sleep 5
    /bin/su tomcat -c "/usr/local/tomcat1/bin/startup.sh"
    /bin/su tomcat -c "/usr/local/tomcat2/bin/startup.sh"
;;

  *)
    echo "Usage: $0 {start|stop|restart}"
    ;;

esac

# End /etc/init.d/tomcat


On Thu, 2002-10-10 at 13:52, Michael Schulz wrote:
> I am facing a similar issue in terms of updating our tomcat servers in the
> cluster.
> 
> I was thinking about doing a similar thing...using the http connector (which
> is behind a firewall and not accessible to the outside world) on each tomcat
> server to communicate with the tomcat manager app
> (http://tomcat1:8080/manager/reload?path=/mywebapp).  I would think it would
> be easy enough to write a script that uses Lynx to invoke this same URL on
> all four servers.  I don't think it is a problem to be restarting tomcat
> frequently, at least I have not seen a problem and we've done this quite a
> bit in our QA environment.
> 
> Ben, may I see the script that you are currently using to restart tomcat on
> the multiple servers?  Also, have you done any load testing? If so, what
> sort of load is your system able to support?
> 
> -Mike Schulz
> 
> 
> -----Original Message-----
> From: Ben Ricker [mailto:bricker@wellinx.com]
> Sent: Thursday, October 10, 2002 1:32 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Reloading w/ Manager on cluster?
> 
> 
> I have a setup with 2 APache servers (1.3.27 on Redhat 7.3) talking to 4
> tomcats clustered across two SOlaris 8 boxes running Tomcat 4.0.5. We
> have a load balancer across the web servers and, of course, mod_jk 1.2.0
> doing the load balancing across the Tomcats.
> 
> We have a QA environment where I want the abilty to reload the apps
> through the manager application. We cannot do it through the Apache load
> balancer because you cannot quarantee what Tomcat you are going to talk
> to at any given request.
> 
> I thought of having Tomcat use its embedded web server on 8080 and 8081
> on each Tomcat server and have the developers call those for reloading,
> but they would have to do that 4 times for every reload. Plus, if we
> scale to a bigger cluster, the problem becomes worse.
> 
> I do have a script that stops and restarts all of the tomcats from a
> central location, but is there any danger to be restarting Tomcat
> frequently? Has anyone worked around a cluster for the management app?
> 
> Thanks,
> 
> Ben
> 
> --
> Ben Ricker <bricker@wellinx.com>
> Wellinx.com
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
-- 
Ben Ricker <bricker@wellinx.com>
Wellinx.com


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message