Title: RE: mod_jk load balancing
Hi Margaret,
Thank for you help on this - i am able to get a bit further now and I see
the mod_jk log setting up the workers...
 
But I am getting the following error in my tomcat log when i
try to get to a servlet....
 
Parse error, empty line:
2001-01-26 12:10:26 - Ctx(  ): 404 R(  + (Win32) + null) null
Parse error, empty line: 30.200.38.2
2001-01-26 12:14:18 - Ctx(  ): 404 R(  + (Win32) + null) null
Parse error, empty line: el, applica
2001-01-26 12:15:31 - Ctx(  ): 404 R(  + (Win32) + null) null
I suspect this is due to a faulty setting in my_mod_jk.conf-auto
which is include in my httpd.conf
 
Perhaps I am not giving the JK_Mount commands properly...
 
If you have any idea - let me know..
 
Thanks - Nipun
-----Original Message-----
From: Royzen, Margaret [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 11:54 AM
To: '[EMAIL PROTECTED]'
Subject: RE: mod_jk load balancing

You should send requests from the different browsers, otherwise it will be send to the same tomcat process according to the session ID. 
 
Apache configuration file should point to: 
JkMount /*.jsp loadbalancer
 
in server.xml file of the MACHINE1, that have Internet address "A1.B1.C1.D1" you specify:
        <Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter name="inet" value="A1.B1.C1.D1" >
            <Parameter name="port" value="8080"/>
        </Connector>
 
In servlet.xml file of the MACHINE2, that have Internet address "A2.B2.C2.D2"  you specify:
        <Connector className="org.apache.tomcat.service.PoolTcpConnector">
            <Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter name="inet" value="A2.B2.C2.D2"  >
            <Parameter name="port" value="8080"/>
        </Connector>
 
I did not try it, but I think it should work.

-----Original Message-----
From: Nair, Nipun [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 11:32 AM
To: [EMAIL PROTECTED]
Subject: RE: mod_jk load balancing

Hi,
 
To get the workers running on different machines/ ports - do i need to
do anything apart from specifying the following in my workers.properties :-
----------------------------------------------------------------------
worker.list=loadbalancer
 
worker.wrker_1.port=8080
worker.wrker_1.host=MACHINE1
worker.wrker_1.type=ajp12
worker.wrker_1.lbfactor=1
 
worker.wrker_2.port=8080
worker.wrker_2.host=MACHINE2
worker.wrker_2.type=ajp12
worker.wrker_2.lbfactor=1
 
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=wrker_2, wrker_1
----------------------------------------------------------------------
 
I started tomcat in both the machines, and i dont see, MACHINE2
getting any requests... do i need to specifiy anything special in the
server.xml of the tomcat installs ?
 
If i want to start multiple workers in the same machine - do i need to
modify the server.xml and change the port numbers from 8080 there ??
 
Please help,
Nipun
-----Original Message-----
From: Royzen, Margaret [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 7:37 AM
To: '[EMAIL PROTECTED]'
Subject: RE: mod_jk load balancing

Thank you!  I added loadbalancer to the workers.list

worker.list=worker_1, worker_2, my_loadbalancer

(it was not there), and it starts balancing!

-----Original Message-----
From: Luc Vanlerberghe [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 4:49 AM
To: [EMAIL PROTECTED]
Subject: Re: mod_jk load balancing


Your workers.properties file contains the entry worker.list

Normally that lists the available workers and the JkMount directives
indicate which one to connect to

However, If you want to do loadbalancing, the workers.list should only
contain the name of your loadbalacing worker and none of the workers the
loadbalancer itself is using!

So with the configuration you gave, you should have
worker.list=loadbalancer
(The rest of the config including the JkMount directives looks correct)

If you want to switch back to no loadbalancing, change back to
worker.list=ajp12,ajp13
and connect to either one using JkMount

Luc Vanlerberghe

P.s.: I only did something similar using mod_jserv, but I don't see any
reason why this should be different for mod_jk
P.p.s.: Perhaps consider changing the names of your workers (In the
tomcat examples they are confusing as well, I know).  ajp12 and ajp13
are names of two different communication protocols between the webserver
and tomcat...
If you change the names of your workers to worker_1 and worker_2, the
configs become

worker.list=my_loadbalancer

worker.worker_1.port=10101
worker.worker_1.host=localhost
worker.worker_1.type=ajp12
worker.worker_1.lbfactor=1

worker.worker_2.port=10103
worker.worker_2.host=localhost
worker.worker_2.type=ajp12
worker.worker_2.lbfactor=1

worker.my_loadbalancer.type=lb
worker.my_loadbalancer.balanced_workers=worker_1,worker_2



"Royzen, Margaret" wrote:
>
> Hi everyone,
>
> I am trying to configure the Apache server to balance the load between
> two independent Tomcat workers using ajp12 protocol.
>
> One worker is listening on port 10101, another one on port 10102. I
> put in my workers.properties file:
>
> worker.ajp12.port=10101
> worker.ajp12.host=localhost
> worker.ajp12.type=ajp12
> worker.ajp12.lbfactor=1
>
> worker.ajp13.port=10103
> worker.ajp13.host=localhost
> worker.ajp13.type=ajp12
> worker.ajp13.lbfactor=1
>
> worker.loadbalancer.type=lb
> worker.loadbalancer.balanced_workers=ajp12, ajp13
>
> At first I put in my apache configuration file :
>
> JkMount /apps-jsp/servlet/* loadbalancer
> JkMount /apps-jsp/*.jsp loadbalancer
>
> thinking, that this way mod_jk will process requests via loadbalancer
> worker, but I got "Internal Server Error"
> After that, I changed it back to:
>
> JkMount /apps-jsp/servlet/* ajp12
> JkMount /apps-jsp/*.jsp ajp12
>
> Servlets started working, but log files are showing no load balancing,
> all requests are processes via port 10101.
>
> Does anyone know, what should I put into Apache configuration file to
> achieve load balancing?
>
> Thank you very much in advance,
> Margaret Royzen.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to