0

I've got apache/tomcat8 setup with mod_jk with load balancing. Let's say I want to update one of the tomcat8 instances, maybe update tomcat itself, then how do I tell mod_jk to stop sending any new requests to that tomcat instance while at the same time letting the existing users finish up whatever they are doing (sticky sessions).

user18969
  • 113
  • 1
  • 8

1 Answers1

1

You can control the worker status/behaviour with the "activation" attribute.

https://tomcat.apache.org/connectors-doc/common_howto/loadbalancers.html#Advanced_Load_Balancer_Worker_Properties

For maintenance purposes you can tell the load balancer to not allow any new sessions on some members, or even not use them at all. This is controlled by the member attribute activation. The value Active allows normal use of a member, disabled will not create new sessions on it, but still allow sticky requests, and stopped will no longer send any requests to the member. Switching the activation from "active" to "disabled" some time before maintenance will drain the sessions on the worker and minimize disruption. Depending on the usage pattern of the application, draining will take from minutes to hours. Switching the worker to stopped immediately before maintenance will reduce logging of false errors by mod_jk.

Freddy
  • 2,039
  • 7
  • 13
  • I hadn't seen that in the status screen because I guess I only had one tomcat instance setup at the time. Thanks for the info. – user18969 Feb 10 '19 at 19:17