[jboss-user] [Clustering/JBoss] - Re: Load Balancing?

bstansberry@jboss.com do-not-reply at jboss.com
Mon Oct 29 12:41:07 EDT 2007


I can edit my posts; I don't know if that comes with admin powers or something?

Anyway, AIUI, you're talking about some sort of front-end load balancer that balances calls to a series of Apache/mod_jk boxes, each of which manages a subset of AS instances, balancing to those. Any session replication only occurs within that subset. Correct?

Question here, is do the mod_jk instances know about all the AS instances, or just a subset? I.e., say you have 100 AS instances and 10 mod_jk; does each mod_jk only know about 10 AS instances, or 100?

If each mod_jk only knows about 10, you have a problem.  If for whatever reason a session becomes unstuck on the front-end load balancer (say mod_jk #1 fails, or there's a flaw in the sticky session handling on the front end), then a request could go to any of the mod_jk instances.  If that mod_jk doesn't know how to reach the subset of AS' that have the sessions, the session is lost.

So, each mod_jk has to know about all AS instances.

Next issue is how to ensure that if there is a failover at the AS level that the AS instance mod_jk picks is in the same subset as the original AS.  Has to be in the same subset or the failover AS won't have a copy of the session.

To do that, you can use mod_jk's 'domain clustering' feature. (Only do the following with mod_jk 1.2.19 or later; before that the session stickiness didn't work right.)

Say you have 4 workers in workers.properties, named node1 ... node4.  You want to group them into 2 groups, group1 and group2.  On the AS nodes, the sessions are only replicated within those groups.

In workers.properties, add:

worker.node1.domain=group1
worker.node2.domain=group2
worker.node3.domain=group3
worker.node4.domain=group4

In the server.xml file on both node1 and node2, set the jvmRoute="group1" instead of "node1" and "node2". On node3 and node4 use "group2".

If you use this, mod_jk will ensure your session stays within the set of "groupX" nodes if a failover occurs.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099918#4099918

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099918



More information about the jboss-user mailing list