Hi,

Nahor wrote:
Hi,

Is there a way to specify at runtime what worker the load-balancer should use first?

For some request, we can't use cookies so we pass the session id via the URL or via the query string. We then force the worker using RewriteRule and the JK_WORKER_NAME env var. But then the request doesn't pass through the load-balancer anymore. So even if we stop that worker in the load-balancer, it will still receive the request instead of being redirected to another worker.

So is there a "JK_LB_PREFERRED_WORKER" kind of variable or equivalent that the load-balancer would use instead of the cookie?

Not directly, you could make use of the cookie and url encoding routing facilities of an lb though.

- Make sure the JSESSIONID gets deleted before and the new request doesn't contain a wrong ;jsessionid URL encoding - Either use mod_headers to set a fake JSESSIONID Cookie header to the request - Or use mod_rewrite and append a fake ;jsessionid=... URL encoding at the end of the URL (but before the query string).

The value of the Cookie resp. jsessionid would be X.MYROUTE, where MYROUTE is the name of the lb sub worker you want to gert chosen by the lb.

Session with id X will not exist on the target MYROUTE, so a new session will be created for the request.

Let us know if this works :)

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