You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joe Harmon <JH...@novell.com> on 2003/09/10 20:01:28 UTC

Load Balancing with MOD_JK and MOD_JK2 on windows.

Please, please, please, can someone help.

I have spend many many days trying to get either mod_jk or mod_jk2 to
properly perform load balancing.

MOD_JK issue:  If I am using mod_jk.dll I can't even get the load
balancing to function. I can get each instance of tomcat to come up, but
I can only use them one at a time through the file, meaning that I can
only have one worker at a time in the file.  If I have one worker, I can
switch the ports and it will go to the other tomcat session.  If I try
and define multiple workers. I am unable to even use them. Here is the
configuration:

workers.tomcat_home=c:\tomcat\406
workers.java_home=c:\Program Files\Java\j2re1.4.1_01

ps=\

worker.list=ajp13, ajp14, tomcat2, tomcat3, loadbalancer

worker.ajp13.port=9009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.ajp13.tomcatId=ajp13

worker.tomcat2.port.9019
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1
worker.ajp13.tomcatId=tomcat2

worker.tomcat3.port=9029
worker.tomcat3.host=localhost
worker.tomcat3.type=ajp13
worker.tomcat3.lbfactor=1
worker.ajp13.tomcatId=tomcat3

worker.ajp14.port=9010
worker.ajp14.host=localhost
worker.ajp14.type=ajp14
worker.ajp14.secretkey=secret
worker.ajp14.credentials=myveryrandomentropy
worker.ajp14.lbfactor=1

worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13, tomcat2, tomcat3

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)jvm.dll
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout
worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

MOd_JK2 issue:  If I am using mod_jk2.dll (tried several builds) I get
the round robin to function, but not the stick sessions.  All three
instances of Tomcat are running on the same box using the same files
with different ports. Here is the configuration.



## This is for the first Tomcat instance ##  uses SERVER.XML
[channel.socket:lab49.provo.novell.com:9009] 
port=9009
host=127.0.0.1 

## This is for the second Tomcat instance ##  uses SERVER2.XML
[channel.socket:lab49.provo.novell.com:9019] 
port=9019
host=127.0.0.1 

## This is for the third Tomcat instance ## uses SERVER3.XML
[channel.socket:lab49.provo.novell.com:9029] 
port=9029
host=127.0.0.1 

## This is defining the worker over the AJP13 protocol. This will need
to be done for each instance. ##
[ajp13:lab49.provo.novell.com:9009]
[ajp13:lab49.provo.novell.com:9019]
[ajp13:lab49.provo.novell.com:9029]

[lb:lb]
worker=ajp13:lab49.provo.novell.com:9009
worker=ajp13:lab49.provo.novell.com:9019
worker=ajp13:lab49.provo.novell.com:9029
#tickySession=1

[shm:]
info=Scoreboard. Required for reconfiguration and status with
multiprocess servers
file=c:/apache/Apache2/conf/xx/jk2.shm
size=1000000
debug=0
disabled=0

[uri:/examples/*]
worker=lb:lb
worker=ajp13:localhost9009

[status:status]

[uri:/jkstatus/*]
worker=status:status

[uri:/admin/*]
worker=ajp13:lab49.provo.novell.com:9009

[uri:/nps/*] 
group=lb
stickySession=1
###End of workers2.properties###### 

Joe Harmon
Web Services Support 
Novell Inc.  -  The leading provider of Information Solutions.
(801) 861-9163
jharmon@novell.com

Re: Load Balancing with MOD_JK and MOD_JK2 on windows.

Posted by Vladyslav Kosulin <ko...@yahoo.com>.
Vladyslav Kosulin wrote:

> Joe Harmon wrote:
> 
>> Please, please, please, can someone help.
>>
>> MOd_JK2 issue:  If I am using mod_jk2.dll (tried several builds) I get
>> the round robin to function, but not the stick sessions.  All three
>> instances of Tomcat are running on the same box using the same files
>> with different ports. Here is the configuration.
>>
>>
>>
>> ## This is for the first Tomcat instance ##  uses SERVER.XML
>> [channel.socket:lab49.provo.novell.com:9009] port=9009
>> host=127.0.0.1 
> 
> 
> Change the names to remove dots everywhere, i.e. use:
> [channel.socket:lab49:9009]
> port=9009
> host=127.0.0.1
> 
> mod_jk2 daes not support dots in names. it is a known bug for a long time.

I meant, mod_jk2 support for sticky sessions is broken for names with dots. it 
can not correctly identify the target host if the JSESSIONID is in form of 
xxx.hostname.domainname. It can handle only xxx.hostname

Vlad


Re: Load Balancing with MOD_JK and MOD_JK2 on windows.

Posted by Vladyslav Kosulin <ko...@yahoo.com>.
Joe Harmon wrote:

> Please, please, please, can someone help.
> 
> MOd_JK2 issue:  If I am using mod_jk2.dll (tried several builds) I get
> the round robin to function, but not the stick sessions.  All three
> instances of Tomcat are running on the same box using the same files
> with different ports. Here is the configuration.
> 
> 
> 
> ## This is for the first Tomcat instance ##  uses SERVER.XML
> [channel.socket:lab49.provo.novell.com:9009] 
> port=9009
> host=127.0.0.1 

Change the names to remove dots everywhere, i.e. use:
[channel.socket:lab49:9009]
port=9009
host=127.0.0.1

mod_jk2 daes not support dots in names. it is a known bug for a long time.

> 
> ## This is for the second Tomcat instance ##  uses SERVER2.XML
> [channel.socket:lab49.provo.novell.com:9019] 
> port=9019
> host=127.0.0.1 
> 
> ## This is for the third Tomcat instance ## uses SERVER3.XML
> [channel.socket:lab49.provo.novell.com:9029] 
> port=9029
> host=127.0.0.1 
> 
> ## This is defining the worker over the AJP13 protocol. This will need
> to be done for each instance. ##
> [ajp13:lab49.provo.novell.com:9009]
> [ajp13:lab49.provo.novell.com:9019]
> [ajp13:lab49.provo.novell.com:9029]
> 
> [lb:lb]
> worker=ajp13:lab49.provo.novell.com:9009
> worker=ajp13:lab49.provo.novell.com:9019
> worker=ajp13:lab49.provo.novell.com:9029
> #tickySession=1
> 
> [shm:]
> info=Scoreboard. Required for reconfiguration and status with
> multiprocess servers
> file=c:/apache/Apache2/conf/xx/jk2.shm
> size=1000000
> debug=0
> disabled=0
> 
> [uri:/examples/*]
> worker=lb:lb
> worker=ajp13:localhost9009
> 
> [status:status]
> 
> [uri:/jkstatus/*]
> worker=status:status
> 
> [uri:/admin/*]
> worker=ajp13:lab49.provo.novell.com:9009
> 
> [uri:/nps/*] 
> group=lb
> stickySession=1
> ###End of workers2.properties###### 
> 
> Joe Harmon
> Web Services Support 
> Novell Inc.  -  The leading provider of Information Solutions.
> (801) 861-9163
> jharmon@novell.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>