tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From UANCHEBALDO <uancheba...@tiscali.it>
Subject Aache+Tomcat+load balancing!!!
Date Wed, 16 Jan 2002 13:31:55 GMT
 I'm a student at the second University of Roma "Tor Vergata" and use
 Apache
 and Tomcat for my thesis's
 work. I have one PC with APACHE 1.3.12 and more PC with TOMCAT-3.3
 everyone
 with more workers, and use
 load balancing. this is my workers.properties file (for simplicity two
 host
 with Tomcat everyone with two
 workers):

 # workers.properties -
 #
 # This file provides jk derived plugins with the needed information to
 # connect to the different tomcat workers. Note that the distributed
 # version of this file requires modification before it is usable by a
 # plugin.
 #
 # As a general note, the characters $( and ) are used internally to
 define
 # macros. Do not use them in your own configuration!!!
 #
 # Whenever you see a set of lines such as:
 # x=value
 # y=$(x)\something
 #
 # the final value for y will be value\something
 #
 # Normaly all you will need to do is un-comment and modify the first
 three
 # properties, i.e. workers.tomcat_home, workers.java_home and ps.
 # Most of the configuration is derived from these.
 #
 # When you are done updating workers.tomcat_home, workers.java_home and
 ps
 # you should have 3 workers configured:
 #
 # - An ajp12 worker that connects to localhost:8007
 # - An ajp13 worker that connects to localhost:8009
 # - A jni inprocess worker.
 # - A load balancer worker
 #
 # However by default the plugins will only use the ajp12 worker. To have
 # the plugins use other workers you should modify the worker.list
 property.
 #
 #

 # OPTIONS ( very important for jni mode )

 #
 # workers.tomcat_home should point to the location where you
 # installed tomcat. This is where you have your conf, webapps and lib
 # directories.
 #
 # workers.tomcat_home=c:\tomcat

 workers.tomcat_home=/usr/local/tomcat

 #
 # workers.java_home should point to your Java installation. Normally
 # you should have a bin and lib directories beneath it.
 #
 # workers.java_home=c:\jdk1.3

 workers.java_home=/usr/java

 #
 # You should configure your environment slash... ps=\ on NT and / on UNIX
 # and maybe something different elsewhere.
 #
 # ps=\
 ps=/

 #
 #------ ADVANCED MODE ------------------------------------------------
 #---------------------------------------------------------------------
 #

 #
 #------ DEFAULT worket list ------------------------------------------
 #---------------------------------------------------------------------
 #
 #
 # The workers that your plugins should create and work with
 #
 # Add 'inprocess' if you want JNI connector
 # write the name of workers if you do not use the load balancing

 worker.list=loadbalancer

 #
 #------ DEFAULT ajp12 WORKER DEFINITION ------------------------------
 #---------------------------------------------------------------------
 #

 #
 # Defining a worker named ajp12 and of type ajp12
 # Note that the name and the type do not have to match.
 #

 worker.ajp12.port=8007

 # IP address of the host
 worker.ajp12.host=xxx.xxx.xxx.xxx
 worker.ajp12.type=ajp12

 #
 # Another work on the same machine
 #
 worker.ajpA12.port=8008
 worker.ajpA2.host=xxx.xxx.xxx.xxx
 worker.ajpA12.type=ajp12

 worker.ajpB12.port=8007
 worker.ajpB12.host=yyy.yyy.yyy.yyy
 worker.ajpB12.type=ajp12

 #
 # Specifies the load balance factor when used with
 # a load balancing worker.
 # Note:
 # ----> lbfactor must be > 0
 # ----> Low lbfactor means less work done by the worker.
 worker.ajp12.lbfactor=1
 worker.ajpA12.lbfactor=1
 worker.ajpB12.lbfactor=10
 #
 #------ DEFAULT ajp13 WORKER DEFINITION ------------------------------
 #---------------------------------------------------------------------
 #

 #
 # Defining a worker named ajp13 and of type ajp13
 # Note that the name and the type do not have to match.
 #
 worker.ajp13.port=8008
 worker.ajp13.host=yyy.yyy.yyy.yyy
 worker.ajp13.type=ajp13

 # Specifies the load balance factor when used with
 # a load balancing worker.
 # Note:
 # ----> lbfactor must be > 0
 # ----> Low lbfactor means less work done by the worker.
 worker.ajp13.lbfactor=10


 #
 # Specify the size of the open connection cache, 1 is the default.
 #worker.ajp13.cachesize

 #
 #------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
 #---------------------------------------------------------------------
 #

 #
 # The loadbalancer (type lb) workers perform wighted round-robin
 # load balancing with sticky sessions.
 # Note:
 # ----> If a worker dies, the load balancer will check its state
 # once in a while. Until then all work is redirected to peer
 # workers.
 worker.loadbalancer.type=lb
 worker.loadbalancer.balanced_workers=ajp13, ajp12, ajpA12, ajpB12

 #
 #------ DEFAULT JNI WORKER DEFINITION---------------------------------
 #---------------------------------------------------------------------
 #

 #
 # Defining a worker named inprocess and of type jni
 # Note that the name and the type do not have to match.
 #
 worker.inprocess.type=jni

 #
 #------ CLASSPATH DEFINITION -----------------------------------------
 #---------------------------------------------------------------------
 #
 .
 .
 .
 In the server.xml file, for host xxx.xxx.xxx.xxx I put:

 <!-- ==================== Connectors ==================== -->
 .
 .
 .
 <Ajp12Connector port="8007" />

 <Ajp12Connector port="8008" />


 For host yyy.yyy.yyy.yyy. :

 <!-- ==================== Connectors ==================== -->
 .
 .
 .

 <Ajp12Connector port="8007" />

 <Ajp13Connector port="8008" />

 I don't use virtual host. I hope that this is useful for someone.

Roberto D.S.



__________________________________________________________________
Abbonati a Tiscali!
Con Tiscali By Phone puoi anche ascoltare ed inviare email al telefono.
Chiama Tiscali By Phone all' 892 800        http://byphone.tiscali.it





--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message