tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kc.baltz" <kc.ba...@inforonics.com>
Subject RE: load balancing
Date Thu, 25 May 2000 15:41:47 GMT
I can see one problem with your setup.  Here is what you have in each of
your servlet.xml files:

     <ContextManager debug="0" workDir="work" >

There is an implied port="8080" parameter for the ContextManager that you
need to change for one of your servlet.xml files.  I think that is the port
that the shutdown command interacts with.  

K.C.

> -----Original Message-----
> From: ken Mc Laren [mailto:ken_mclaren@altavista.com]
> Sent: Thursday, May 25, 2000 11:35 AM
> To: tomcat-user@jakarta.apache.org
> Subject: load balancing
> 
> 
> Hi,
> i'm using Tomcat 3.1+ Apache 1.3.12 on linux redhat 6.2. I'd 
> like to make load balancing with one apache and two process 
> of tomact  (JVM) on the same host.
> 
> first JVM http://localhost:8007
> second JVM http://localhost:8001
> 
> when I start my 2 process of tomcat (2 JVM), my servlet work fine
> http://localhost/examples/servlet/myservlet
> but when I stoped my first JVM (working on port 8007)
> I can load my servlet.
> 
> here my configuration:
> httpd.conf
> .........
> .........
> LoadModule jserv_module libexec/mod_jserv.so
> ApJServManual on
> ApJServDefaultProtocol ajpv12
> ApJServSecretKey DISABLED
> ApJServMountCopy on
> ApJServLogLevel notice
> ApJServDefaultHost  142.133.66.48
> #ApJServDefaultPort 8001
> 
> #load balancing
> 
> ApjServBalance set1 PC1
> ApjServBalance set1 PC2
> 
> ApJServHost PC1 ajpv12://142.133.66.48:8001
> ApJServHost PC2 ajpv12://142.133.66.47:8007
> 
> ApJServRoute JS1 PC1
> ApJServRoute JS2 PC2
> ApJServShmFile logs/jserv_shm
> ApJServMount default /root
> 
> AddType test/jsp .jsp
> AddHandler jserv-servlet .jsp
> Alias /examples /tools/jakarta-tomcat/webapps/examples
> <Directory "/tools/jakarta-tomcat/webapps/examples">
>     Options Indexes FollowSymLinks
> </Directory>
> ApJServMount /examples/servlet /examples 
> <Location /examples/WEB-INF/ >
>     AllowOverride None
>     deny from all
> </Location>
> 
> ApJServMount /servlet /ROOT
> 
> My first server.xml
> server.xml
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <Server>
>     <!-- Debug low-level events in XmlMapper startup -->
>     <xmlmapper:debug level="0" />
> 
>     <!-- This is quite flexible; we can either have a log file per
>          module in Tomcat (example: ContextManager) or we can have
>          one for Servlets and one for Jasper, or we can just have
> 	 one tomcat.log for both Servlet and Jasper.
> 
> 	 If you omit "path" there, then stderr should be used.
> 
> 	 verbosityLevel values can be: 
> 	    FATAL
> 	    ERROR
> 	    WARNING 
>             INFORMATION
>             DEBUG
>          -->
> 
>     <Logger name="tc_log" 
>             path="logs/tomcat.log"
>             customOutput="yes" />
> 
>     <Logger name="servlet_log" 
>             path="logs/servlet.log"
>             customOutput="yes" />
> 
>     <Logger name="JASPER_LOG" 
> 	    path="logs/jasper.log"
>             verbosityLevel = "INFORMATION" />
> 
>     <!-- Add "home" attribute if you want tomcat to be based 
> on a different directory
>          "home" is used to create work and to read webapps, 
> but not for libs or CLASSPATH.
>          Note that TOMCAT_HOME is where tomcat is installed, 
> while ContextManager home is the
>          base directory for contexts, webapps/ and work/
>       -->
>     <ContextManager debug="0" workDir="work" >
>         <!-- ContextInterceptor 
> className="org.apache.tomcat.context.LogEvents" / -->
>         <ContextInterceptor 
> className="org.apache.tomcat.context.AutoSetup" />
>         <ContextInterceptor 
> className="org.apache.tomcat.context.DefaultCMSetter" />
>         <ContextInterceptor 
> className="org.apache.tomcat.context.WorkDirInterceptor" />
>         <ContextInterceptor 
> className="org.apache.tomcat.context.WebXmlReader" />
>         <ContextInterceptor 
> className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
>         <!-- Request processing -->
>         <RequestInterceptor 
> className="org.apache.tomcat.request.SimpleMapper" debug="0" />
>         <RequestInterceptor 
> className="org.apache.tomcat.request.SessionInterceptor" />
>         <RequestInterceptor 
> className="org.apache.tomcat.request.SecurityCheck" />
>         <RequestInterceptor 
> className="org.apache.tomcat.request.FixHeaders" />
> 
>         <Connector 
> className="org.apache.tomcat.service.SimpleTcpConnector">
>             <Parameter name="handler" 
> value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
>             <Parameter name="port" value="8080"/>
>         </Connector>
> 
>         <Connector 
> className="org.apache.tomcat.service.SimpleTcpConnector">
>             <Parameter name="handler" 
> value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
>             <Parameter name="port" value="8007"/>
>         </Connector>
> 
>         <!-- example - how to override AutoSetup actions -->
>         <Context path="/examples" docBase="webapps/examples" 
> debug="0" reloadable="true" > 
>         </Context>
>         <!-- example - how to override AutoSetup actions -->
>         <Context path="" docBase="webapps/ROOT" debug="0" 
> reloadable="true" > 
>         </Context>
> 
>         <Context path="/test" docBase="webapps/test" 
> debug="0" reloadable="true" > 
>         </Context>
> 
>     </ContextManager>
> </Server>
> 
> 
> My second server.xml
> server1.xml
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <Server>
>     <!-- Debug low-level events in XmlMapper startup -->
>     <xmlmapper:debug level="0" />
> 
>     <!-- This is quite flexible; we can either have a log file per
>          module in Tomcat (example: ContextManager) or we can have
>          one for Servlets and one for Jasper, or we can just have
> 	 one tomcat.log for both Servlet and Jasper.
> 
> 	 If you omit "path" there, then stderr should be used.
> 
> 	 verbosityLevel values can be: 
> 	    FATAL
> 	    ERROR
> 	    WARNING 
>             INFORMATION
>             DEBUG
>          -->
> 
>     <Logger name="tc_log" 
>             path="logs/tomcat.log"
>             customOutput="yes" />
> 
>     <Logger name="servlet_log" 
>             path="logs/servlet.log"
>             customOutput="yes" />
> 
>     <Logger name="JASPER_LOG" 
> 	    path="logs/jasper.log"
>             verbosityLevel = "INFORMATION" />
> 
>     <!-- Add "home" attribute if you want tomcat to be based 
> on a different directory
>          "home" is used to create work and to read webapps, 
> but not for libs or CLASSPATH.
>          Note that TOMCAT_HOME is where tomcat is installed, 
> while ContextManager home is the
>          base directory for contexts, webapps/ and work/
>       -->
>     <ContextManager debug="0" workDir="work" >
>         <!-- ContextInterceptor 
> className="org.apache.tomcat.context.LogEvents" / -->
>         <ContextInterceptor 
> className="org.apache.tomcat.context.AutoSetup" />
>         <ContextInterceptor 
> className="org.apache.tomcat.context.DefaultCMSetter" />
>         <ContextInterceptor 
> className="org.apache.tomcat.context.WorkDirInterceptor" />
>         <ContextInterceptor 
> className="org.apache.tomcat.context.WebXmlReader" />
>         <ContextInterceptor 
> className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
>         <!-- Request processing -->
>         <RequestInterceptor 
> className="org.apache.tomcat.request.SimpleMapper" debug="0" />
>         <RequestInterceptor 
> className="org.apache.tomcat.request.SessionInterceptor" />
>         <RequestInterceptor 
> className="org.apache.tomcat.request.SecurityCheck" />
>         <RequestInterceptor 
> className="org.apache.tomcat.request.FixHeaders" />
> 
>         <Connector 
> className="org.apache.tomcat.service.SimpleTcpConnector">
>             <Parameter name="handler" 
> value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
>             <Parameter name="port" value="8080"/>
>         </Connector>
> 
>         <Connector 
> className="org.apache.tomcat.service.SimpleTcpConnector">
>             <Parameter name="handler" 
> value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
>             <Parameter name="port" value="8001"/>
>         </Connector>
> 
>         <!-- example - how to override AutoSetup actions -->
>         <Context path="/examples" docBase="webapps/examples" 
> debug="0" reloadable="true" > 
>         </Context>
>         <!-- example - how to override AutoSetup actions -->
>         <Context path="" docBase="webapps/ROOT" debug="0" 
> reloadable="true" > 
>         </Context>
> 
>         <Context path="/test" docBase="webapps/test" 
> debug="0" reloadable="true" > 
>         </Context>
> 
>     </ContextManager>
> </Server>
> 
> starting 2 tomcat process:
> tomcat.sh run -f conf/server.xml    (first JVM on port 8007)
> tomcat.sh run -f conf/server1.xml  (second JVM on port 8001).
> 
> 
> Ken
> 
> 
> ______________________________________________________________
> _________
> 
> Why pay when you don't have to? Get AltaVista Free Internet 
> Access now! 
> http://jump.altavista.com/freeaccess4.go
> 
> ______________________________________________________________
> _________
> 
> 
> --------------------------------------------------------------
> ------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
> 

Mime
View raw message