Hi
all,
Sacha Labourey and I
would like to announce the availability of new JBoss clustering features in
RabbitHole-3.0 (the mainline). There is still a lot of testing to be done
so this is really BETA code. If you have any questions, pop either one of
us an email on the jboss-dev list. I'll be in Las Vegas next week so
hopefully Sacha can answer all questions for now. The below HOWTO will be
merged into documentation eventually when one of us has
time.
Regards,
Bill
Features
- You must have JDK 1.3.x Will not work with JDK earlier than this. Sorry....
- Built on top of JavaGroups. http://www.javagroups.com
- Automatic group discovery. Cluster nodes can automatically find eachother(BUT THEY DON"T SHARE CONFIGURATIONS!)
- A general framework wrapped around JavaGroups that provides group communications thru RPCs, a state transfer protocol, and membership change notification
- Cluster-wide JNDI (a.k.a HA-JNDI)
- Failover for HA-JNDI, Stateless Session Beans, Entity Beans, and also any RMI object you want to replicate
- method calls are collocated if possible even if the proxy is serialized to another node.
- SLSB, HA-JNDI, and Home calls are load-balanced Round Robin. Entity Bean calls are NOT load-balanced.
Quick
Start
- Get latest and build from CVS mainline (RH 3.0) (Don't ask me how to do this!)
- Copy .../jboss-all/cluster/etc/cluster-service.xml to JBoss's deploy/ directory
- Edit any SLSB or EntityBean's "jboss.xml" to put in <clustered> flag (see .../jboss-all/cluster/etc/jboss.xml for example
i.e.<jboss>
<secure>false</secure><enterprise-beans>
<session>
<ejb-name>nextgen.StatelessSession</ejb-name>
<jndi-name>nextgen.StatelessSession</jndi-name>
<clustered>True</clustered>
</session>
<entity>
<ejb-name>nextgen.EnterpriseEntity</ejb-name>
<jndi-name>nextgen.EnterpriseEntity</jndi-name>
<clustered>True</clustered>
</entity>
</enterprise-beans></jboss>
-
To use HA-JNDI you must have a list of cluster nodes in the provider URL list separated by commas, HA-JNDI runs off of port 1100 by default:
java.naming.provider.url=server1:1100,server2:1100,server3:1100
-
HA-JNDI is NOT a required service. You can connect to any cluster node's local JNDI.
Problems you
may encounter
- Only JDK 1.3.x is supported. It will not work with an earlier JDK.
- Do NOT use <commit-option> 'A' with Entity Beans!!!
- If you want to synchronize Entity Beans across the cluster use <select-for-update> Unfortunately this feature may only work with Oracle :-(. We will be expanding this feature later on.
- Clustered beans do NOT support Transaction Propagation unless the method call is collocated.
- We think we've fixed this problem, but if you bring 2 clustered nodes up at the same time and have problems, start them completely one at a time.
- MERGEing doesn't work well yet. What is Merging? Let's say a part of the cluster becomes separated from the group because of a bad network switch or something. These orphaned nodes don't die, but are just cut off from the network. When these orphaned nodes are hooked up to the network again, JBoss Clustering(through JavaGroups) will merge the orphaned nodes into the group. This does not work well all the time.
Advanced
Setup
How clustering is configured will expand over time, but
here's what can be configured right now.
Advanced
Cluster Configuration
One JBoss instance
can belong to multiple different clusters.(Beans can only belong to one cluster
though!) You can do this by plopping another mbean into jboss and give a
name for the specific cluster.
Cluster
configuration variables(these can be defined as mbean properties in
cluster-service.xml for example):
PartitionName: Name the cluster
partition. The default is "DefaultPartition"
PartitionProperties: Defines JavaGroups
properties. see http://www.javagroups.com for more
information
i.e.
<server>
<classpath
archives="jbossha.jar"/>
<depends>JBOSS-SYSTEM:service=Naming</depends>
<!--
====================================================================
-->
<!-- Cluster Partition: defines cluster -->
<!-- ==================================================================== -->
<!-- Cluster Partition: defines cluster -->
<!-- ==================================================================== -->
<mbean
code="org.jboss.ha.framework.server.ClusterPartition"
name="JBOSS-SYSTEM:service=DefaultPartition">
<attribute
name="PartitionName">MySpecialPartition</attribute>
<attribute
name="PartitionProperties">UDP:PING:FD:VERIFY_SUSPECT:MERGE:NAKACK(trace=true):UNICAST:FRAG:FLUSH:GMS:STATE_TRANSFER:QUEUE</attribute>
</mbean>
</server>
Advanced
HA-JNDI Confugration
You can only define the JNDI listen port at this time in
the mbean. The default is 1100
i.e.
<server>
<classpath
archives="jbossha.jar"/>
<depends>JBOSS-SYSTEM:service=Naming</depends>
<!--
====================================================================
-->
<!-- Cluster Partition: defines cluster -->
<!-- ==================================================================== -->
<!-- Cluster Partition: defines cluster -->
<!-- ==================================================================== -->
<mbean
code="org.jboss.ha.framework.server.ClusterPartition"
name="JBOSS-SYSTEM:service=DefaultPartition">
</mbean>
</mbean>
<!--
====================================================================
-->
<!-- HA JNDI -->
<!-- ==================================================================== -->
<!-- HA JNDI -->
<!-- ==================================================================== -->
<mbean
code="org.jboss.ha.jndi.HANamingService"
name="JBOSS-SYSTEM:service=HAJNDI">
<attribute
name="Port">54321</attribute>
</mbean>
</mbean>
</server>
Advanced
Bean Configuration
Advanced Bean
configuration is minimal at this time. You can only define the Cluster
Partition that the bean is attached to.
<jboss>
<secure>false</secure>
<secure>false</secure>
<enterprise-beans>
<session>
<ejb-name>nextgen.StatelessSession</ejb-name>
<jndi-name>nextgen.StatelessSession</jndi-name>
<clustered>True</clustered>
<session>
<ejb-name>nextgen.StatelessSession</ejb-name>
<jndi-name>nextgen.StatelessSession</jndi-name>
<clustered>True</clustered>
<cluster-config>
<partition-name>MySpecialPartition</partition-name>
</cluster-config>
</session>
</enterprise-beans>
</session>
</enterprise-beans>
