Mladen Turk schrieb:
Eddie Yee wrote:
Hi,
We use a combination of Tomcat 5.5.25, mod_jk (v1.25) and sun one web server (v6.1). The Sun Java web server points to 5 instances of tomcat as specified in our obj.conf and worker.properties. I know that currently if the application is not in a started state and Tomcat is up and running, mod_jk will still send traffic to that instance. Is there any way to prevent sending traffic to an application in a stopped state, or is this behavior by design, or just bad configuration?

Mod_jk doesn't have per-application configuration.
However you can create multiple load balancers each pointing
to the same set of nodes and then mount each balancer
to each particular application.
When the application is down, you disable the entire
load balancer.
Of course this is feasible only for a small set of applications.

Regards

Adding to Mladen's answer: if you have only one app per Tomcat, you can use the activation attribute of an LB member (active, disabled, stopped) to tell the LB, if it should send requests to the member. Look at "activation" in

http://tomcat.apache.org/connectors-doc/reference/workers.html

Another possibility is to use the attribute fail_on_status with a value of 503, because an existing but stopped Tomcat context will answer requests with http 503. You could check, whether 503 or -503 suites you better. See the same docs page.

Starting from 1.2.27 there will also be a possibility to express an activation state in the mapping table uriworkermap.properties, which would allow to disable or stop a forwarding per URL and per node.

Unfortunately the nsapi plugin doesn't actually support the forwarding via uriworkermap.properties. It only allows setting the uri to worker map via NameTrans in obj.conf. Something we could improve, but at the moment there seems to be no huge interest in the nsapi plugin.

Regards,

Rainer

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to