Use jk_status to manage nodes at runtime
One of the features of jk is support for reconfiguration at runtime, without a restart. The main use is to Disable/Stop/stand-by workers. This allows smooth updates, without server restarts, where each worker is upgraded while the other workers serve the content. This is achieved by using jk_status web interface.
To enable jk_status you need to have bellow shown entry in mod-jk.conf
# Add jkstatus for managing runtime data <Location /jkstatus></Location> JkMount status Order deny,allow Deny from all Allow from 127.0.0.1 </Location>
Your workers.properties file should have an entry like
# Define list of workers that will be used # for mapping requests worker.list=loadbalancer,status # Define Node1 # modify the host as your host IP or DNS name. worker.node1.port=8009 ...... ...... # Define Node2 # modify the host as your host IP or DNS name. worker.node2.port=8009 ...... ...... # Load-balancing behaviour worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=node1,node2 ...... ...... # Status worker for managing load balancer worker.status.type=status
Once the set-up is done and servers are started point your browser to http://localhost/jkstatus/ This page should show you all the nodes that are configured in workers.properties. Click on any node that you want to manage.
You can change the status of node to 'Disabled'. No further sessions will be accepted on this node. This means that the member will still receive the requests with already established sessions until they time-out. It can take some time until all the sessions time-out (depending on the session timeout setting, like 30 minutes or so), but it will allow you to gracefully shutdown the node for maintenance.
You can change the status to 'Stopped'. The member will be removed from the loadbalancer. The users will need to log-in again.
'Route Redirect' is used for so called hot-standby. This means that you can have a node initially disabled that will serve requests if all other nodes fails. However Route Redirect only works when you have HttpSession replication working. For above workers.properties I can have one more entry as node3 however it shouldn't be listed in worker.loadbalancer.balance_workers. Now for each of the nodes 1 and 2 I can have node 3 as hot-standby
For 'Route Redirect' and 'Load Factor' look at The Apache Jakarta Tomcat Connector - workers.properties configuration