Re: load balancing not working...

2001-03-28 Thread David Crooke

Do you have the jserv_shm file configured? This is a block of shared memory that
the apache httpd processes use to communicate about the state of the Java VM's.

When the request comes in from the browser, it will have the cookie / URL
rewriting session id which will tell it which VM to send the request to; if that
VM is down, it should just route it to another VM which will create a new
session.

When an apache process finds a VM down, it updates the jserv_shm file to inform
its peers. It periodically polls to see if the VM has been restarted, and will
mark it good and start using it again if it has. You can also open this file
from an external program and explicity mark a VM down to tell Apache to stop
using it.

You don't say what OS you're on - I do recall from the docs that the jserv_shm
system doesn't work on all systems, notably IIRC WinNT. In these cases, I believ
the docs say the load balancing will work but not session failover.

We use mod_jserv in test and production on Linux and FreeBSD, and I can verify
that the VM failover works on both. We have developers who work on NT and have
set up load balancing on their boxes, but we don't use in anger.

For testing, note that even after a session has expired on the server, if you
have kept the browser open, then you will still connect to the same appserver
that it last had a session on since you will still have the session cookie.

I recommend turning on cookie watch in the browser(s) you use for testing; you
can see which appserver your session is being bound to. In Netscape, Edit ->
Preferences -> Advanced -> Warn me before accepting cookies. In IE it's
somewhere in Internet Options and is called Temporary Cookies: Prompt.

You can force it to connect your browser to a particular appserver by hand
editing a fake session ID rewritten URL, e.g.

http://myserver.mycompany.com/app/servlet/com.mycompany.mycode.Hello?JServSessionIdapp=foobar.ins2

where "JServSessionId" is literal, "app" is the JServ zone name, "ins2" is the
ApJServRoute, and "foobar" is any string. This URL setting takes precedence over
any existing cookie in the browser.

Another handy testing tip - the Gecko based browsers (Mozilla and Netscape 6.x)
have menus where you can throw a cookie away; in most other browsers you have to
exit and restart the browser to get rid of temporary cookies once you accept
them. I think Opera may also have some facility, and it's rumoured that IE6 will
have some cookie management too.

Enjoy
Dave

Guntupalli Shanti wrote:

> Hi,
>
> I am using Apache 1.3.12 with mod_jserv module (build into apache) talking
> to tomcat 3.2.1.
> I am trying to load balance between 2 servers and my configuration is like
> this:
>
> ApJServBalance loadbalancer ins1
> ApJServBalance loadbalancer ins2
>
> ApJServHost ins1 ajpv12://server1:9100
> ApJServHost ins2 ajpv12://server2:9100
>
> ApJServRoute ins1 ins1
> ApJServRoute ins2 ins2
>
> ApJServMount /app/servlet balance://loadbalancer/app
>
> Doesn't work. As long as the ins1 is up the request goes to ins1. But when
> I shutdown app on ins1
> it doesn't go to ins2 it gives me the Internal Server error.
>
> I have installed Apache 1.3.14 (with DSO support) with mod_jserv.so on my
> workstation and I am able
> to load balance between ins1 and ins2 having the same lines in my httpd.conf.
> Is it the Apache problem/mod_jserv problem or tomcat problem. Did anyone
> succeed with a similar configuration
>
> Any help is greatly aprreciated
>
> Thanks..Shanti




load balancing not working...

2001-03-27 Thread Guntupalli Shanti

Hi,

I am using Apache 1.3.12 with mod_jserv module (build into apache) talking 
to tomcat 3.2.1.
I am trying to load balance between 2 servers and my configuration is like 
this:

ApJServBalance loadbalancer ins1
ApJServBalance loadbalancer ins2

ApJServHost ins1 ajpv12://server1:9100
ApJServHost ins2 ajpv12://server2:9100

ApJServRoute ins1 ins1
ApJServRoute ins2 ins2

ApJServMount /app/servlet balance://loadbalancer/app

Doesn't work. As long as the ins1 is up the request goes to ins1. But when 
I shutdown app on ins1
it doesn't go to ins2 it gives me the Internal Server error.

I have installed Apache 1.3.14 (with DSO support) with mod_jserv.so on my 
workstation and I am able
to load balance between ins1 and ins2 having the same lines in my httpd.conf.
Is it the Apache problem/mod_jserv problem or tomcat problem. Did anyone 
succeed with a similar configuration

Any help is greatly aprreciated

Thanks..Shanti