Question

Is it possible to build balancer trees with several levels in mod_jk configuration?

for example there is following configuration

worker.list=b, b1, b2

worker.t1.port=8001
worker.t1.host=localhost
worker.t1.type=ajp13
worker.t1.lbfactor=1

worker.t2.port=8002
worker.t2.host=localhost
worker.t2.type=ajp13
worker.t2.lbfactor=1

worker.t3.port=8003
worker.t3.host=localhost
worker.t3.type=ajp13
worker.t3.lbfactor=1

worker.t4.port=8004
worker.t4.host=localhost
worker.t4.type=ajp13
worker.t4.lbfactor=1

worker.b1.type=lb
worker.b1.balance_workers=t1,t2

worker.b2.type=lb
worker.b2.balance_workers=t3, t4

worker.b.type=lb
worker.b.balance_workers=b2, b1

and there are following two multicast tomcat clusters (t1, t2) and (t3, t4). So sessions are replicated only between t1 and t2 and between t3 and t4.

If t1 fails will mod_jk forward request to t2? I mean does it respect balancer or it will send request to any of left tomcat workers? This is important as sessions are not replicated between clusters and redirecting request to another cluster when there are alive workers in the cluster where one worker died will make user session information unaccessible.

Was it helpful?

Solution

I am not sure, but it seems that balancer trees are not necessary. There is domain attribute that acts like logical domain. So balancer will try to redirect a request to a worker from the same domain.

I tested it a bit, and it seems working.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top