mod_jk will only connect to the localhost

2003-12-22 Thread Peter Anning
Hi,

I have configured Apache 1.3 with mod_jk on SuSE Linux SLES8 on a zSeries.

mod_jk will only connect to tomcat on the localhost.


One Linux instance runs the Web Server and one runs Tomcat 4.1.27
In order to test the config I installed tomcat on the web server machine and 
mapped the application /examples/ to forward to the local tomcat. this works 
fine. However when changing the config to point to a remote machine (see 
config below) I always get an error in the apache error log. I have used 
tcpdump -i any 'dst port 8009' (see output below) and this always indicates 
that mod_jk is trying to connect to the localhost whatever I put in th 
workers.properties file.

To test network connectivity I have used telnet  8009 and I can 
connect to tomcat and see the connection occur in the remote tomcat log 
files. I have also included a tcpdump of this below.

Has anyone seen anything sinmilar.
Best Rgds
Peter



mod_jk configured (workers.properties) as follows:

worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=192.168.13.10
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
worker.worker1.local_worker=0


apache mount points are configured in httpd.conf

JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/mod_jk.log

JkLogLevel error

JkMount /examples/* worker1
JkMount /examples/*.jsp worker1
###


tcpdump while accessing the /examples/
www02:/etc # tcpdump -n -i any 'dst port 8009'
16:19:21.496621 127.0.0.1.33194 > 127.0.0.1.8009: S 3501290459:3501290459(0) 
win 32767  (DF)
16:19:21.497287 127.0.0.1.33195 > 127.0.0.1.8009: S 3497571144:3497571144(0) 
win 32767  (DF)
16:19:21.497733 127.0.0.1.33196 > 127.0.0.1.8009: S 3498859603:3498859603(0) 
win 32767  (DF)


telnet 192.168.13.10 8009

www02:/etc # tcpdump -n -i any 'dst port 8009'
tcpdump: WARNING: Promiscuous mode not supported on the "any" device
tcpdump: listening on any
16:19:07.631821 192.168.12.11.33193 > 192.168.13.10.8009: S 
3495439382:3495439382(0) win 5840  (DF) [tos 0x10]
16:19:07.635099 192.168.12.11.33193 > 192.168.13.10.8009: . ack 3495439509 
win 5840  (DF) [tos 0x10]

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



RE: mod_jk load balancing with multiple apache servers

2003-08-28 Thread Peter Anning
If Apache yet it's asociated tomcat is down is up then the loadbalancer will
still send requests to it.

If I have 2 Apaches and 3 Tomcats then with out loadbalancing in mod_jk a1
goes to t1 a2 to t2 and t3 gets its requests from where? I would need mod_jk
to balance across all 3 instances



-Original Message-
From: Ralph Einfeldt [mailto:[EMAIL PROTECTED]
Sent: 28 August 2003 05:29
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RE: mod_jk load balancing with multiple apache servers


As I understand it, the failover should be handled by
the external load balancer.

Why shouldn't it work with uneven number of tomcats ?

You should just have to define an odd number of workers
in each mod_jk.

> -Original Message-
> From: Peter Anning [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 28, 2003 10:02 PM
> To: Tomcat Users List
> Subject: RE: mod_jk load balancing with multiple apache servers
>
>
> Will failover work in this configuration?
> I guess it won't be able to be setup like this with uneven
> nos. of Tomcat and apache
>

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






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



RE: mod_jk load balancing with multiple apache servers

2003-08-28 Thread Peter Anning
Thanks for this, it makes sense:

Ralph Einfeldt wrote:

>mod_jk should be configured to make no balancing. It just should do
>the routing. So a1 should route all request with no session info to
>t1 and a2 to t2. (Set the lbfactor to 0 for the second worker).

Will failover work in this configuration?
I guess it won't be able to be setup like this with uneven nos. of Tomcat
and apache

-Original Message-
From: Ralph Einfeldt [mailto:[EMAIL PROTECTED]
Sent: 27 August 2003 09:03
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RE: mod_jk load balancing with multiple apache servers


See below:

> -Original Message-----
> From: Peter Anning [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 27, 2003 11:20 AM
> To: Tomcat.Users.List"
> <[EMAIL PROTECTED]>"@www.peteranning.com
> Subject: RE: mod_jk load balancing with multiple apache servers
>

> Http request 1 is sent to A1 by the ext LB this request may
> go to T1. Then  http request 2 is sent to A2 this request may also go to
T1.
> Now T1 has double the load of T2 which is currently at zero.
>
> What I am trying to work out in my is:
> 1. Does this matter or should it somehow be biased?
> 2. Will things be evened out as the no of requests increase?

If you can assume an even distribution of the session and the
session duration it should be evened out. (It's dependend on the
distribution and the quality of the loadbalancer)

> 3. How will it scale when adding non-even nos. of Tomcats to Apaches?

The number of nodes should not play a role.

> 4. How to represent this in mathematical terms?
>

To express that you have to know the algorithm that is used by the
loadbalancer and the distribution of the sessions.

BTW:

mod_jk should be configured to make no balancing. It just should do
the routing. So a1 should route all request with no session info to
t1 and a2 to t2. (Set the lbfactor to 0 for the second worker).

Note: This recommendation is based on reading rather than on really
trying it, havn't used the loadbalaning feature of mod_jk by now.




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






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



RE: mod_jk load balancing with multiple apache servers

2003-08-27 Thread Peter Anning
Here are a few points of clarification:

- External hardware Http load balancing is setup using sticky sessions
- mod_jk is setup using  sticky sessions
- there is no session state replication (a lost Tomcat/Jboss instance 
requires a user to log back on)
- the tomcat/Jboss instances are on seperate machines

This is more or less your example no 1 below.

If you take the following example:

Http request 1 is sent to A1 by the ext LB this request may go to T1. Then 
http request 2 is sent to A2 this request may also go to T1. Now T1 has 
double the load of T2 which is currently at zero.

What I am trying to work out in my is:
1. Does this matter or should it somehow be biased?
2. Will things be evened out as the no of requests increase?
3. How will it scale when adding non-even nos. of Tomcats to Apaches?
4. How to represent this in mathematical terms?



Ralph Einfeldt wrote:

> To me it's not quite clear what you are doing exacly.
> 
> I see three option to use an externl loadbalancer.
> Which one is the one you use ?
> 
> - use mod_jk with sticky sessions.
>   - Setup two apaches with a mod_jk.
>   - Setup loadbalancing for mod_jk.
>   - Setup two tomcats with a unique jvmRoute.
> 
>  LB
> /  \
>/\
>   A1A2
>   |\   /|
>   | \ / |
>   |  x  |
>   | / \ |
>   |/   \|
>   T1   T2
>   
>   Although the last mails from Bill Barker indicate that current 
>   implementation of mod_jk doesn't balance the load equally, this
>   scenario should work for you, as the external load balancer does 
>   this already. The Loadbalancer in mod_jk is just used to route 
>   the requests to the correct tomcat.
> 
> - use session replication.
>   In this scenario each instance of tomcat has a copy of the session 
>   data, so it doesn't matter which receives the request. 
>   In this case you can omit apache and mod_jk and use tomcat native.
> 
>  LB
> /  \
>/\
>   A1A2
>   | |
>   | |
>   T1---T2
> 
> - use a load balancer that supports sticky sessions
>   (url and cookie based sessions)
> 
>   In this case you can treat each tomcat as a stand alone 
>   server. 
> 
>  LB
> /  \
>/\
>   A1A2
>   | |
>   | |
>   T1T2
> 
> > -Original Message-
> > From: Peter Anning [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 26, 2003 5:14 PM
> > To: Tomcat Users List
> > Subject: Re: mod_jk load balancing with multiple apache servers
> > 
> >




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



Re: mod_jk load balancing with multiple apache servers

2003-08-26 Thread Peter Anning
>...getting knowledge 
> from implementations (other tomcats from your second Apache server)
>  will break those abstractions

You may be right about this. However as I add Apache servers to the 
Apache layer without some kind of colaboration between the servers
it would seem that the problem will escalate. Effectively the hardware
load balancing at the front maintains sticky sessions and ``knows''
about all the servers loading.



> Peter Anning wrote:
> 
> >Hi,
> >
> >I am trying to implement the following configuration:
> >
> >
> >+++
> >  Cisco Load Balancer
> >+++
> >|
> >| (http)
> >|
> >+++
> >   Apache AApache B Apache Cluster Layer
> >mod_jk  mod_jk
> >+++
> >|
> >| (ajp13)
> >|
> >+++
> >TomcatI.myhost.com   TomcatII.myhost.comJBoss Cluster Layer
> >+++
> >
> >
> >I can configure mod_jk in each of the Apache instances to
> >know about the two tomcat instances. So loadbalancing and
> >failover would work with one instance of apache.
> >
> >Is there any way to have the Apache ``cluster'' layer
> >know about other ``members'' in the layer and the 
> >current servlet connection status?
> >
> >Rgds
> >Peter
> >  
> >
> Hi peter,
> i'm in a context near from yours
> my opinion is that it isn't very logic because you introduce 
> abstraction layers (like in a OO environment) & getting knowledge 
> from implementations (other tomcats from your second Apache server)
>  will break those abstractions Moreover I think you could 
> encounter network security problems with such things isn't it ? my 2 
> pieces... Jerome
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




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



mod_jk load balancing with multiple apache servers

2003-08-26 Thread Peter Anning
Hi,

I am trying to implement the following configuration:


+++
  Cisco Load Balancer
+++
|
| (http)
|
+++
   Apache AApache B Apache Cluster Layer
mod_jk  mod_jk
+++
|
| (ajp13)
|
+++
TomcatI.myhost.com   TomcatII.myhost.comJBoss Cluster Layer
+++


I can configure mod_jk in each of the Apache instances to
know about the two tomcat instances. So loadbalancing and
failover would work with one instance of apache.

Is there any way to have the Apache ``cluster'' layer
know about other ``members'' in the layer and the 
current servlet connection status?

Rgds
Peter

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