Johann Uhrmann wrote:
Hi,

I am trying to set up JK 1.2 with Apache 1.3 and Tomcat 4.1.12.
All seems to work fine, but I am a bit confused about the "local worker"
configuration option:

According to the documentation at
http://www/tomcat-docs/jk2/jk/workershowto.html (section "Advanced lb
Worker properties") an incomming request is routed to the first local
worker.

Well, as the documentation is not quite clear to me, I have some
questions:

- Is the "local worker" just a switch to tell the load balancer
  "use this node"?
Only if there is no session with a jvmRoute extension on it.

- If this is true and I want to shut down a node, can I just set the
  "local worker" flag of that node to 0, reload the Apache
  configuration, wait until the last session
  on that node has expired and shut it down?
That could be possible, but it is not the intended use of this flag. This is dangerous, because if you have no local worker and local_worker_only=1, then every request to this node without a sessionid with jvmRoute will get an error response. Because with local_worker_only set to 1 you tell mod_jk to sent a request without a session only to local workers. But if there are no workers with local_worker=1 then mod_jk doesn't know where to send it to.

The local_worker flag is used to savely switch of another node. We have a cluster with one load-balancer in front of our nodes. On each node we have an apache+mod_jk+tomcat. To switch off a node we tell the load balancer not to route a request to this node. If a request contains a sessionid the load balancer will send it to the apache of another node and this node will send it to the node with the session, because of the jvmRoute in the id. But without a jvmRoute the request would be balanced by mod_jk between all known nodes. And mod_jk doesn't know that one node is switched off. With the local_worker flag mod_jk will route a request without a jvmRoute only to one of his local workers. When you configure only the connection to tomcat on the same node as local_worker, this tomcat gets only requests with a session he owns or when a request without a session arrives at the apache of this node. When you switch off the node by the load balancer, this node will only get requests with a session he owns. Because the load balancer will not send any request directly to a switched off node and the other nodes would only route a request to the switched off node, when the sessionid with jvmRoute tells them to do this.

- If there is no node marked as "local worker" (which seems to be the
  default), there is no session information stored. The log of JK 1.2
  says that every request gets its own session cookie set which means
  there are no sessions stored.
  Is that the behaviour that it should be?
These are two different things. The sessions are stored in tomcat and tomcat creates the sessionids with the jvmRoute extension. You have to configure the workers with their names not only in the mod_jk configuration, you must also set the jvmRoute in tomcats server.xml to the names of your workers. Then the right jvmRoute would be added to the sessionid in tomcat and then mod_jk could route the next request to the right worker/tomcat-instance.

The local workers and local_worker_only flag is an additional feature. The default is local_worker=0 and local_workers_only=0.

Hope this helps,

Bernd
--
Dipl.-Inform. Bernd Koecke
UNIX-Entwicklung
Schlund+Partner AG
Fon: +49-721-91374-0
E-Mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>

Reply via email to