You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Cardon <mi...@bendcable.com> on 2003/06/12 20:41:26 UTC

Load Balancing Question?

I would like to setup a 'session' type of load balancing using apache2 and
two or three instances of tomcat41.

This setup routes each request to a different tomcat instance.  In mywebapp,
once a person has logged in, I need each additional request in that users
session to stay with the same tomcat instance.  When another person's
request comes in then it would then route to the second instance of tomcat
and they would remain with that instance as long as their session is valid.
Does this make sense to anyone???

I'm not quit sure if I need to setup, or how to setup, any virtual servers
in apache2.

Just for a little background, this is what I'm working with:

RH Linux 8.0
apache2-2.0.45-1.7.2.i386.rpm
apache2-devel-2.0.45-1.7.2.i386.rpm
apache2-manual-2.0.45-1.7.2.i386.rpm
mod_jk2-ap20-2.0.1-1jpp.i386.rpm
j2sdk-1_4_1_03-linux-i586-rpm.bin
tomcat-4.1.24-LE-jdk14.tar.gz


I have installed two instances of tomcat on the same machine with apache2.
The third tomcat instace with be on a different machine. (I'm just dealing
with the first two right now)

/usr/local/sites/tom1/tomcat --> using CoyoteConnector on port 8009
/usr/local/sites/tom2/tomcat --> using CoyoteConnector on port 8019


In the workers2.properties file I have set the following:

[logger]
level=DEBUG

[config:]
file=/etc/httpd2/conf/workers2.properties
debug=0
debugEnv=0

[uriMap:]
info=Maps the requests. Options: debug
debug=0

# Alternate file logger
[logger.file:0]
level=DEBUG
file=/var/log/httpd2/jk2.log

[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess
servers
file=/var/run/jk2.shm
size=1000000
debug=0
disabled=0

[workerEnv:]
info=Global server options
timing=1
debug=0
# Default Native Logger (apache2 or win32 )
# can be overriden to a file logger, useful
# when tracing win32 related issues
#logger=logger.file:0

[lb:lb]
info=Default load balancer.
debug=0

[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009
lb_factor=1
group=lb
disabled=0

[channel.socket:localhost:8019]
info=A second tomcat instance.
debug=0
tomcatId=localhost:8019
lb_factor=1
group=lb
disabled=0

[status:]
info=Status worker, displays runtime informations

[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:

[uri:/mywebapp]
info=Example webapp in the default context.
context=/legacy
debug=0

[uri:/mywebapp/servlet/*]
info=Prefix mapping

[uri:/mywebapp/*.jsp]
info=Extension mapping

[uri:/mywebapp/*]
info=Map the whole webapp




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


RE: Load Balancing Question?

Posted by Michael Cardon <mi...@bendcable.com>.
Solved: I added the following to each of my tomcat server.xml files in the
<Engine> tag:

<Engine jvmRoute="localhost:8009" ......... to tomcat1

<Engine jvmRoute="localhost:8019" ......... to tomcat 2


-----Original Message-----
From: Michael Cardon [mailto:mic@bendcable.com]
Sent: Thursday, June 12, 2003 11:41 AM
To: tomcat-user@jakarta.apache.org
Subject: Load Balancing Question?


I would like to setup a 'session' type of load balancing using apache2 and
two or three instances of tomcat41.

This setup routes each request to a different tomcat instance.  In mywebapp,
once a person has logged in, I need each additional request in that users
session to stay with the same tomcat instance.  When another person's
request comes in then it would then route to the second instance of tomcat
and they would remain with that instance as long as their session is valid.
Does this make sense to anyone???

I'm not quit sure if I need to setup, or how to setup, any virtual servers
in apache2.

Just for a little background, this is what I'm working with:

RH Linux 8.0
apache2-2.0.45-1.7.2.i386.rpm
apache2-devel-2.0.45-1.7.2.i386.rpm
apache2-manual-2.0.45-1.7.2.i386.rpm
mod_jk2-ap20-2.0.1-1jpp.i386.rpm
j2sdk-1_4_1_03-linux-i586-rpm.bin
tomcat-4.1.24-LE-jdk14.tar.gz


I have installed two instances of tomcat on the same machine with apache2.
The third tomcat instace with be on a different machine. (I'm just dealing
with the first two right now)

/usr/local/sites/tom1/tomcat --> using CoyoteConnector on port 8009
/usr/local/sites/tom2/tomcat --> using CoyoteConnector on port 8019


In the workers2.properties file I have set the following:

[logger]
level=DEBUG

[config:]
file=/etc/httpd2/conf/workers2.properties
debug=0
debugEnv=0

[uriMap:]
info=Maps the requests. Options: debug
debug=0

# Alternate file logger
[logger.file:0]
level=DEBUG
file=/var/log/httpd2/jk2.log

[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess
servers
file=/var/run/jk2.shm
size=1000000
debug=0
disabled=0

[workerEnv:]
info=Global server options
timing=1
debug=0
# Default Native Logger (apache2 or win32 )
# can be overriden to a file logger, useful
# when tracing win32 related issues
#logger=logger.file:0

[lb:lb]
info=Default load balancer.
debug=0

[channel.socket:localhost:8009]
info=Ajp13 forwarding over socket
debug=0
tomcatId=localhost:8009
lb_factor=1
group=lb
disabled=0

[channel.socket:localhost:8019]
info=A second tomcat instance.
debug=0
tomcatId=localhost:8019
lb_factor=1
group=lb
disabled=0

[status:]
info=Status worker, displays runtime informations

[uri:/jkstatus/*]
info=Display status information and checks the config file for changes.
group=status:

[uri:/mywebapp]
info=Example webapp in the default context.
context=/legacy
debug=0

[uri:/mywebapp/servlet/*]
info=Prefix mapping

[uri:/mywebapp/*.jsp]
info=Extension mapping

[uri:/mywebapp/*]
info=Map the whole webapp




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


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