mod_jk: Hot Standby and Load Balance

2005-08-31 Thread Mott Leroy
Due to some differences in our applications, some of them can be truly 
load balanced, and some of them really cannot (yet). That is, some of 
our applications can be (and have been) truly load balanced, and others 
need (and only allow) simple failover support (hot standby). I noticed 
that workers now support both possibilities (using disabled and 
redirect flags to support hot standby).


What I'd like to do ultimately is have a hot standby load balancer and 
as well as a normal load balancer, but it doesn't seem like that's 
possible. From what I understand, you can really only have 1 load 
balanced worker per tomcat instance because it must match the jvmRoute 
of that instance -- having one worker that's disabled and one that's not 
doesn't seem possible.


So if I define a load balance worker as:

# traditional load balance worker
worker.lb_tala_build.type=ajp13
worker.lb_tala_build.host=tala
worker.lb_tala_build.port=8000
worker.lb_tala_build.lbfactor=1
worker.lb_tala_build.socket_keepalive=1
worker.lb_tala_build.recycle_timeout=300

I cannot really define a second load balanced worker like below (b/c no 
matching jvmRoute)


# a hot standby worker based on the worker above
worker.lb_tala_build2.type=ajp13
worker.lb_tala_build2.host=tala
worker.lb_tala_build2.port=8000
worker.lb_tala_build2.lbfactor=1
worker.lb_tala_build2.socket_keepalive=1
worker.lb_tala_build2.recycle_timeout=300
worker.lb_tala_build2.disabled=True 

Is anyone familiar with this setup of have any ideas how it could be 
achieved? (the same problem exists for what would be the Primary 
server, as it would need a worker that redirects and one that doesn't)


Ps -

Being able to specify the jvmRoute separately would solve this problem:

worker.lb_tala_build2.jvmRoute=lb_tala_build



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



Re: mod_jk: Hot Standby and Load Balance

2005-08-31 Thread Mott Leroy

Well, I was thinking of using something like (truncated for clarity):

# load balanced
worker.lb_traditional.type=lb
worker.lb_traditional.balance_workers=lb_worker1,lb_worker2
worker.lb_traditional.sticky_session=true

# workers 1 and 2 are load balanced
worker.lb_worker1.type=ajp13
worker.lb_worker1.host=server1
worker.lb_worker1.domain=theJRMRoute

worker.lb_worker2.type=ajp13
worker.lb_worker2.host=server2
worker.lb_worker2.domain=theJRMRoute

# standby setup
worker.lb_standby.type=lb
worker.lb_standby.balance_workers=lb_worker3,lb_worker4
worker.lb_standby.sticky_session=true

# workers 4 is hot standby for worker 3
worker.lb_worker3.type=ajp13
worker.lb_worker3.host=server1
worker.lb_worker3.domain=theJRMRoute
worker.lb_worker3.redirect=worker4

worker.lb_worker4.type=ajp13
worker.lb_worker4.host=server2
worker.lb_worker4.domain=theJRMRoute
worker.lb_worker4.disabled=True

Guernsey, Byron (GE Consumer  Industrial) wrote:

I believe you can specify the jvmRoute separately by using the domain
attribute, but I'm not sure I see how this would help?

Byron
 


-Original Message-
From: Mott Leroy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 31, 2005 11:03 AM

To: Tomcat Users List
Subject: mod_jk: Hot Standby and Load Balance

Due to some differences in our applications, some of them can be truly
load balanced, and some of them really cannot (yet). That is, some of
our applications can be (and have been) truly load balanced, and others
need (and only allow) simple failover support (hot standby). I noticed
that workers now support both possibilities (using disabled and
redirect flags to support hot standby).

What I'd like to do ultimately is have a hot standby load balancer and
as well as a normal load balancer, but it doesn't seem like that's
possible. From what I understand, you can really only have 1 load
balanced worker per tomcat instance because it must match the jvmRoute
of that instance -- having one worker that's disabled and one that's not
doesn't seem possible.

So if I define a load balance worker as:

# traditional load balance worker
worker.lb_tala_build.type=ajp13
worker.lb_tala_build.host=tala
worker.lb_tala_build.port=8000
worker.lb_tala_build.lbfactor=1
worker.lb_tala_build.socket_keepalive=1
worker.lb_tala_build.recycle_timeout=300

I cannot really define a second load balanced worker like below (b/c no
matching jvmRoute)

# a hot standby worker based on the worker above
worker.lb_tala_build2.type=ajp13
worker.lb_tala_build2.host=tala
worker.lb_tala_build2.port=8000
worker.lb_tala_build2.lbfactor=1
worker.lb_tala_build2.socket_keepalive=1
worker.lb_tala_build2.recycle_timeout=300
worker.lb_tala_build2.disabled=True 

Is anyone familiar with this setup of have any ideas how it could be
achieved? (the same problem exists for what would be the Primary 
server, as it would need a worker that redirects and one that doesn't)


Ps -

Being able to specify the jvmRoute separately would solve this problem:

worker.lb_tala_build2.jvmRoute=lb_tala_build



-
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]






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



Re: mod_jk: Hot Standby and Load Balance

2005-08-31 Thread Mott Leroy

Rainer Jung wrote:

The balanced workers behind lb1, lb2 etc. are allowed to have the same
name, because each load balancer has it's own list of balanced workers
with associated attributes. I expect no problem from a clash of names of
balanced workers in different balancing workers.


I must be missing something obvious here. I am with you on the JKMount 
part, but I just don't see how the name clash isn't an issue for 
worker.properties. Simplifying again ...


# as per your suggestion ... where worker1 and worker2 are jvmRoutes
worker.lb1.balanced_workers=worker1,worker2
worker.lb2.balanced_workers=worker1,worker2

# the balanced workers ... which should they choose ... ?
worker.worker1 (failover version)
worker.worker1 (not failover version)
worker.worker2 (standby version)
worker.worker2 (non-standby version)

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



jar files

2005-08-24 Thread Mott Leroy
This probably sounds like a very newbie question, but for your own 
application classes, (not third party), is there any particular reason 
to jar them and put them into WEB-INF/lib vs compiling them as class 
files to WEB-INF/classes? The classloader won't blindly just load the 
whole jar will it? For an applet, using Jars makes some sense to avoid 
continually downloading class files, what are the advantages for web 
applications?


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



Re: jar files

2005-08-24 Thread Mott Leroy
Ultimately, after a build, it's just a war file, so that's not really 
an issue for me.


Tim Funk wrote:
Personally - I prefer jar files. Its one file to keep track of. Instead 
of 100's of .class files. When you start building up your library - you 
start to get a large directory of WEB-INF/classes. It much easier to 
manage them as jar files.


-Tim

Mott Leroy wrote:

This probably sounds like a very newbie question, but for your own 
application classes, (not third party), is there any particular reason 
to jar them and put them into WEB-INF/lib vs compiling them as 
class files to WEB-INF/classes? The classloader won't blindly just 
load the whole jar will it? For an applet, using Jars makes some sense 
to avoid continually downloading class files, what are the advantages 
for web applications?



-
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]



session problems when using mod_jk (1.2.14) load balancing

2005-08-17 Thread Mott Leroy

Hi -

I'm unable to get mod_jk load balancing working. The usual mod_jk setup 
works just fine, but using a load balancing worker however, is not. 
[Oddly, my webserver crashed during testing of this, but that could very 
well be unrelated]


The problem is with user sessions. The instances (nodes) do not seem to 
recognize an already established session with the user and are creating 
new sessions. It's possible that is a session-stickiness issue, but it 
appears like the requests are hitting the same instance, just not 
getting the previously established session. As a result, I can't even 
reliably login to my application.


I created a session listener for debugging purposes and it reports -no- 
destroyed sessions, but plenty of newly created sessions on both 
instances that make up the cluster. The session IDs, I noticed, have 
the jvmRoute name attached to them, which should be a good sign.


I have a webserver running Apache (1.3.33), mod_jk (1.2.14), and an 
application server running the cluster -- 2 instances tomcat (5.0.28) 
on different ports.


I added a unique jvmRoute to both instances in the server.xml:
Engine name=Catalina defaultHost=localhost jvmRoute=dev_alexis
Engine name=Catalina defaultHost=localhost jvmRoute=noah_alexis

My worker.properties loadbalancer settings:

worker.list=load_balancer_test

worker.load_balancer_test.type=lb
worker.load_balancer_test.balance_workers=bl_worker_dev,bl_worker_noah
worker.load_balancer_test.sticky_session=true
worker.load_balancer_test.sticky_session_force=false

worker.bl_worker_dev.type=ajp13
worker.bl_worker_dev.host=alexis
worker.bl_worker_dev.port=9003
worker.bl_worker_dev.lbfactor=1
worker.bl_worker_dev.socket_keepalive=1
worker.bl_worker_dev.recycle_timeout=300

worker.bl_worker_noah.type=ajp13
worker.bl_worker_noah.host=alexis
worker.bl_worker_noah.port=8063
worker.bl_worker_noah.lbfactor=3
worker.bl_worker_noah.socket_keepalive=1
worker.bl_worker_noah.recycle_timeout=300

Any ideas, things I could try would be much appreciated.

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



Re: session problems when using mod_jk (1.2.14) load balancing

2005-08-17 Thread Mott Leroy
Beautiful - worked like a charm. That might take the cake as far as 
longest question to quickest, shortest answer goes. ha. Thanks a bunch.


I might have to gripe about doucmentation in a second (nother thread)..

Noah


Edgar Alves wrote:

Try adding these two lines to worker.properties:
worker.bl_worker_dev.domain=dev_alexis
worker.bl_worker_noah.domain=noah_alexis

-- Edgar Alves

Mott Leroy wrote:



Hi -

I'm unable to get mod_jk load balancing working. The usual mod_jk
setup works just fine, but using a load balancing worker however, is
not. [Oddly, my webserver crashed during testing of this, but that
could very well be unrelated]

The problem is with user sessions. The instances (nodes) do not seem
to recognize an already established session with the user and are
creating new sessions. It's possible that is a session-stickiness
issue, but it appears like the requests are hitting the same instance,
just not getting the previously established session. As a result, I
can't even reliably login to my application.

I created a session listener for debugging purposes and it reports
-no- destroyed sessions, but plenty of newly created sessions on both
instances that make up the cluster. The session IDs, I noticed, have
the jvmRoute name attached to them, which should be a good sign.

I have a webserver running Apache (1.3.33), mod_jk (1.2.14), and an
application server running the cluster -- 2 instances tomcat
(5.0.28) on different ports.

I added a unique jvmRoute to both instances in the server.xml:
Engine name=Catalina defaultHost=localhost jvmRoute=dev_alexis
Engine name=Catalina defaultHost=localhost jvmRoute=noah_alexis

My worker.properties loadbalancer settings:

worker.list=load_balancer_test

worker.load_balancer_test.type=lb
worker.load_balancer_test.balance_workers=bl_worker_dev,bl_worker_noah
worker.load_balancer_test.sticky_session=true
worker.load_balancer_test.sticky_session_force=false

worker.bl_worker_dev.type=ajp13
worker.bl_worker_dev.host=alexis
worker.bl_worker_dev.port=9003
worker.bl_worker_dev.lbfactor=1
worker.bl_worker_dev.socket_keepalive=1
worker.bl_worker_dev.recycle_timeout=300

worker.bl_worker_noah.type=ajp13
worker.bl_worker_noah.host=alexis
worker.bl_worker_noah.port=8063
worker.bl_worker_noah.lbfactor=3
worker.bl_worker_noah.socket_keepalive=1
worker.bl_worker_noah.recycle_timeout=300

Any ideas, things I could try would be much appreciated.

-
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]






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



mod_jk documentation

2005-08-17 Thread Mott Leroy
Before I go gripe too, too much, let me just say that the mod_jk 
documentation has improved immensely since I start looking into it. Some 
of it might be simplied by the fact that I no longer consider jk2 in the 
picture which seemed to be adding some confusion.


I don't know who is responsible for updating the documentation, so 
thought I'd post here.


The documentation that I'm referring to is at:

http://jakarta.apache.org/tomcat/connectors-doc/index.html

load balancing page:
Well, the load balancing page is empty, which is ok, but a link to the 
majority of load balancing explanation on the worker.properties page 
would be nice.


domain property for a worker.
I had to use the domain property on a worker to get load balancing 
working, which corresponds to the jvmRoute. I didn't see any mention of 
jvmRoute or domain anywhere however in either the load balancing 
section or the general worker properties.


finally, and this may have annoyed me more than anything else -
all throughout the load balancing documentation there are red, bolded 
lines like These workers should not appear in the worker.list 
property! in reference to balance_workers. But then in the example, 
they do exactly what they said should NOT be done:

(bottom of this page)
http://jakarta.apache.org/tomcat/connectors-doc/howto/workers.html

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



Re: session problems when using mod_jk (1.2.14) load balancing

2005-08-17 Thread Mott Leroy

Ok - noted. I changed it. It works without the domain as you noted. Thanks.

Rainer Jung wrote:

That should not work!

The correct way to configure session stickyness is to use jvmRoute (which
you already did) and then giving the workers the same names as the
jvmRoute. That is instead of bl_worker_dev use dev_alexis and instead
of bl_worker_noah use noah_alexis as the worker names.

You should check, that the URLs produced by your application include the
;jsessionid=32Characters.jvmRoute or - in case you use cookies - the
same info is in your session cookie.

mod_jk then automatically strips the jvmRoute part from the session
identifier and lloks for a worker of the same name.

You will only need to use the domain attribute in case you have a lot of
tomcat instances and some of them have the sessions replicated, others
not. Then you can give all members of a replication domain the same domain
name and mod_jk will know, that in case the correct worker is down, which
alternatives are good.



Beautiful - worked like a charm. That might take the cake as far as
longest question to quickest, shortest answer goes. ha. Thanks a bunch.

I might have to gripe about doucmentation in a second (nother thread)..

Noah


Edgar Alves wrote:


Try adding these two lines to worker.properties:
worker.bl_worker_dev.domain=dev_alexis
worker.bl_worker_noah.domain=noah_alexis

-- Edgar Alves

Mott Leroy wrote:




Hi -

I'm unable to get mod_jk load balancing working. The usual mod_jk
setup works just fine, but using a load balancing worker however, is
not. [Oddly, my webserver crashed during testing of this, but that
could very well be unrelated]

The problem is with user sessions. The instances (nodes) do not seem
to recognize an already established session with the user and are
creating new sessions. It's possible that is a session-stickiness
issue, but it appears like the requests are hitting the same instance,
just not getting the previously established session. As a result, I
can't even reliably login to my application.

I created a session listener for debugging purposes and it reports
-no- destroyed sessions, but plenty of newly created sessions on both
instances that make up the cluster. The session IDs, I noticed, have
the jvmRoute name attached to them, which should be a good sign.

I have a webserver running Apache (1.3.33), mod_jk (1.2.14), and an
application server running the cluster -- 2 instances tomcat
(5.0.28) on different ports.

I added a unique jvmRoute to both instances in the server.xml:
Engine name=Catalina defaultHost=localhost jvmRoute=dev_alexis
Engine name=Catalina defaultHost=localhost jvmRoute=noah_alexis

My worker.properties loadbalancer settings:

worker.list=load_balancer_test

worker.load_balancer_test.type=lb
worker.load_balancer_test.balance_workers=bl_worker_dev,bl_worker_noah
worker.load_balancer_test.sticky_session=true
worker.load_balancer_test.sticky_session_force=false

worker.bl_worker_dev.type=ajp13
worker.bl_worker_dev.host=alexis
worker.bl_worker_dev.port=9003
worker.bl_worker_dev.lbfactor=1
worker.bl_worker_dev.socket_keepalive=1
worker.bl_worker_dev.recycle_timeout=300

worker.bl_worker_noah.type=ajp13
worker.bl_worker_noah.host=alexis
worker.bl_worker_noah.port=8063
worker.bl_worker_noah.lbfactor=3
worker.bl_worker_noah.socket_keepalive=1
worker.bl_worker_noah.recycle_timeout=300

Any ideas, things I could try would be much appreciated.

-
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]






-
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]






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



Re: Newbie question

2005-05-05 Thread Mott Leroy
See -
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html#Configuring%20Manager%20Application%20Access
From what I remember, admin access follows that same rules as manager 
app access, so the instructions on that page are the same except the 
role should be admin not manager.

Mário Gamito wrote:
Hi,
Sorry for this newbie question :(
I've just installed Tomcat 5.5 for Linux and so far so good, except...
that i've installed also Tomcat Administration module (not the Manager
one) and it asks me for a login and a password and i can't find how to
define it.
I see a file named admin.xml in $CATALINA_HOME/conf/Catalina/localhost
saying to uncoment the valve and another two files, but i don't know how
to set the login and the password.
Any help would be apreciated.
Warm Regards,
Mário Gamito
-
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: Help - Alias or Symlink to external(to the context) images directory?

2005-05-03 Thread Mott Leroy
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html -
see the allowLinking property.
As far as how to create the symlink when the app is deployed, not sure 
beyond running some sort of script when the application loads (using a 
context listener perhaps).

Matt Galvin wrote:
Hi All,
Does anyone know of a way to set an alias to an external directory
that contains images to be displayed on a web page?
Maybe explaining what I need to do would help:
I have a directory, for example: /tmp/images
I have a webapp in: /opt/tomcat/webapps/myapp
I need to be able to store uploaded images in /tmp/images (which I
have working fine) and I need to be able to display those images via
the jsp's in myapp. Is it possible to have an alias called
myapp/images that points to /tmp/images or can I maybe use a
symlink(can tomcat follow the symlink?) or is there some other way I
can do this, other than using a servlet to retrieve/return the images?
I need to be able to do this so that when the webapp is
updated/redeployed, the images will not get deleted.
I am running tomcat 5.0.28 on SUN's Java 1.4.2_08 on a variety or
Linux/UNIX systems.
Thanks in advance,
Matt
-
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]


Avoiding deploying an application twice

2005-05-02 Thread Mott Leroy
I wasn't able to find this particular error when I did a search, so I 
thought I'd post here in case someone has a similar problem.

I was having an error when remotely deploying an application (tomcat 
5.0.28) using the tomcat manager (via Ant tasks). I did not explicitly 
define a context.xml file for the application and used a more or less 
out of the box standard host configuration.

The tomcat error would say during deployment:
May 2, 2005 11:13:51 AM org.apache.catalina.startup.HostConfig deployWARs
WARNING: Exception while expanding web application archive appname.war
May 2, 2005 11:14:01 AM org.apache.catalina.startup.HostConfig deployWARs
WARNING: Exception while expanding web application archive appname.war
[And repeat ...]
That was all the information it would give.
I believe this error resulted from tomcat attempting to deploy/unpack 
the application twice.

When I set autoDeploy=false on the host (as opposed to the default 
behavior, which is true), the errors disappeared.

The relevant section of the documentation is below:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html#Automatic%20Application%20Deployment
When using automatic deployment, the |docBase| defined by an XML 
Context 
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html 
file should be outside of the |appBase| directory. If this is not the 
case difficulties may be experienced deploying the web application or 
the application may be deployed twice.

Finally, note that if you are defining contexts explicitly, you should 
probably turn off automatic application deployment. Otherwise, your 
context will be deployed twice each, and that may cause problems for 
your app.

I did not define an explicit context, but I guess the implicit context 
(or generated context) defaults to a docbase inside the appbase 
directory, which results in the behavior described above.


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