-
1. a question about EJB3 load balance
wdfink Apr 18, 2011 11:12 AM (in response to wutongjoe)If you add @Clustered to your SLSB the JBoss ejb client is aware to the cluster and load balance your requests.
You have to check:
- the servers are building a cluster (see logfile for 'No of Members' messages during start)
- The client should use a JNDI-HA port (it's 1100 instead of 1099 by default)
- The client should use a InitialContext with '192.168.0.1:1100,192.168.0.2:1100' to be failsave during first lookup
- The client should use the same RemoteIF during the whole lifetime
1) as I wrote one/more/all separated by ',' or use autodiscover by multicast
2) no hw-lb necessary
3) You have to configure BUddy-Replication for this (but think about performance vs. failover, often it is aceptable to have seldom failures by this )
-
2. a question about EJB3 load balance
wutongjoe Apr 18, 2011 12:10 PM (in response to wdfink)thank you very much Wolf-Dieter Fink ,it is very helpful.I have something to make clear based on your answers:
1) by "multicast/auto discovery ", do you mean to write client code to catch network multicast event from cluster and build connection with ejb app in cluster? any tutorial url ?
2) "BUddy-Replication" means session bean replication among cluster nodes,right ?
3) suppose I was building a tx critical system, any production best practice experience ?
that is all, thank you very much
-
3. Re: a question about EJB3 load balance
wutongjoe Apr 18, 2011 12:38 PM (in response to wutongjoe)sorry, I got answers for Q1 and Q2 after a google walk
http://docs.jboss.org/jbossas/jboss4guide/r4/html/cluster.chapt.html for Q1 and Q2
1) by "multicast/auto discovery ", do you mean to write client code to catch network multicast event from cluster and build connection with ejb app in cluster? any tutorial url ?
2) "BUddy-Replication" means session bean replication among cluster nodes,right ?
but no luck for Q3,any idear ?
3) suppose I was building a tx critical system, any production best practice experience ?
-
4. a question about EJB3 load balance
wdfink Apr 18, 2011 12:43 PM (in response to wutongjoe)Transaction might be a problem.
If you did not use UserTransactions (you better remove the UTx service from deployment ) it will be simply,
avoid Remote invocations across the Cluster members, it will be a good idea for performance as well )
The transaction is handled by one JBoss instance, persistent data use a transactional cache (flushed after commit/rollback).
If you use UTx you are in trouble like me
We use the TransactionStickyLoadBalancer for EJB2.1
But with EJB3 there is no equivalent implementation ATM, there is a JIRA for this, coming hopefully soon.
The problem is that different server become member of a transaction and might contain the same entity in different caches that are outdated!