How can I get a request through mod_jk to go to a specific worker?

If I have mod_jk configured with several workers and a load balancer, is there a request parameter or something that would allow me to associate a specific HTTP request with a specific worker. For example, if I have a working worker1, there is something like this:

http://www.example.com?worker=worker1

Often we need to fix problems on a specific server in the cluster and be able to force a request to be redirected directly to that server.

+4
source share
2 answers
  • Change the value of your cookie JSESSIONID. At the end there is the name of the worker to whom you are attached (provided that you do sticky sessions).

  • Use SetHandler as described here http://tomcat.apache.org/connectors-doc/reference/apache.html instead of JKMount directives

    Something like that:

    <Location /> SetHandler jakarta-servlet SetEnvIf REQUEST_URI ^/.*\?.*worker=(\w+)&?$ JK_WORKER_NAME=$1 </Location> 
+1
source

I think the usual practice is to do this through subdomains, which, like the main domain. Just make sure you don’t allow the Google index because you will have problems with duplicate content. IP filtering and the robots.txt bounding file will do the job.

 www1.example.com www2.example.com 
+2
source

All Articles