This is my barebone configuration for tomcat4.0.4
3instances with loadbalancer. My OS is RHLinux 7.1,
and tomcat is 
connected to apache2.0.39 using mod_jk.so.

I hope this will be helpful to you and I would
appreciate it if anyone has a comment or enhancement.

### httpd.conf
Include /usr/local/tomcat/conf/mod_jk.conf

prod_jk resides in the main instance of tomcat. You do
not need to have mod_jk.conf in every instance of
tomcat.

### mod_jk.conf
This file will include all your virtual hosts
definition together with needed parameters for mod_jk.
All the defaults can go there, I am not going to put
my stuff here for you, but get the hint ;)

    JkMount /* loadbalancer
    JkMount /servlet/* loadbalancer

    JkMount /manager loadbalancer
    JkMount /manager/* loadbalancer

#### Worker.properties.

workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/local/j2sdk1.4.0
ps=/

worker.list=tc13,intra13, extra13, loadbalancer

worker.tc13.port=8039
worker.tc13.host=localhost
worker.tc13.type=ajp13
worker.tc13.lbfactor=1

worker.intra13.port=8049
worker.intra13.host=localhost
worker.intra13.type=ajp13
worker.intra13.lbfactor=1

worker.extra13.port=8059
worker.extra13.host=localhost
worker.extra13.type=ajp13
worker.extra13.lbfactor=1


worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tc13, intra13,
extra13

worker.inprocess.type=jni
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar
worker.inprocess.cmd_line=start
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)bin$(ps)classic$(ps)libjvm.so
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

############ End Worker file. ####################
You need to copy your original tomcat to X number of
instances that you want to have running on your
server.
Make sure you reflect the number of instances with the
right number of workers that you define. For example
if you 
have 3 tomcatS you must have 3 workers.

Make the following changes to your server.xml for each
copy of tomcat.
<!-- Change Server Port per tomcat instance in the
sever.xml.-->
<Server port="8015" shutdown="SHUTDOWN" debug="0">


 <!-- Change Connector port per tomcat instance in the
server.xml -->
    <Connector
className="org.apache.ajp.tomcat4.Ajp13Connector"
               port="8039" minProcessors="5"
maxProcessors="75"
               acceptCount="50" debug="0"/>


<!-- Define the top level container in our container
hierarchy -->
<!--
You MUST add jvmRoute="WorkerName" to each or the
tomcat instances. Also define your defaultHost,
although this is 
not needed for load balancing, it is good to have.
-->
    <Engine jvmRoute="tc13" name="Standalone"
defaultHost="www.domainA.com" debug="0">


Although I have 3 instances of tomcat, I decided to
have one copy of webapps. Since I am running Linux I
made a softlink to 
my /usr/local/webapps in each of my instances. This
way if you fix a bug in one of your applications you
do not have 
to repeat it all over. But that is your call where to
have your webapps.

I do not think you need anything else to get your load
balancing going. Start your tomcatS, then appache and
test. I would
look at the log files to see which one is accepting
requests, and then shutdown one at a time and see the
effects.

Enjoy.

--- Jason Koeninger <[EMAIL PROTECTED]> wrote:
> I'm not sure about documentation, but I've
> participated in a 
> few mailing list discussions quite some time ago
> about load 
> balancing.  The only reason I knew anything about it
> (don't 
> run load balancing myself) is that I've spent some
> time in 
> workers.properties.  IIRC, there are comments and
> sample 
> directives in workers.properties that show how to
> configure 
> load balancing.
> 
> Best Regards,
> 
> Jason Koeninger
> J&J Computer Consulting
> http://www.jjcc.com
> 
> On Thu, 25 Jul 2002 09:44:34 -0400, Chris Ruegger
> wrote:
> 
> >Is the load balancing configuration of mod_jk
> >documentated somewhere? Pointers to RTFM
> >appreciated!
> >
> >
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to