With JK 1.2.x, new load-balancing and fault-tolerant support has been added via
2 new properties, redirect and activation.
Let's take an example environment:
A cluster with two nodes (worker1+worker2), running a webserver + tomcat tandem on each node and
a loadbalancer in front of the nodes.
# The advanced router LB worker
worker.list=router
# Define a worker using ajp13
worker.worker1.port=8009
worker.worker1.host=node1.domain.org
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
# Define prefered failover node for worker1
worker.worker1.redirect=worker2
# Define another worker using ajp13
worker.worker2.port=8009
worker.worker2.host=node2.domain.org
worker.worker2.type=ajp13
worker.worker2.lbfactor=1
# Disable worker2 for all requests except failover
worker.worker2.activation=disabled
# Define the LB worker
worker.router.type=lb
worker.router.balance_workers=worker1,worker2
The redirect flag on worker1 tells the lb_worker to redirect the requests
to worker2 only if worker1 is in error state. In other cases worker2 will not receive
any requests, thus acting like a hot standby.