JBoss Clustering
From Shrubbery
- Notes on JBoss Clustering
Contents |
[edit] JBoss Clustering Configuration
System properties used for clustering:
| Property | Default | File | Description |
|---|---|---|---|
| jboss.partition.udpGroup |
|
| Same for all nodes in a given cluster. This is the multicast IP address that all cluster configurations will use. When running multiple clusters on the same LAN it is a good idea to use a different multicast IP address for each cluster. This avoids strange 'split brain' issues and warning messages from JGroups about messages from non-members. |
| jboss.partition.udpPort | 45566 | jmx-console.war/WEB-INF/web.xml | |
| jboss.hapartition.mcast_port | 45566 | cluster-service.xml | |
| jboss.ejb3entitypartition.mcast_port | 43333 | ejb3-entity-cache-service.xml | |
| jboss.ejb3sfsbpartition.mcast_port | 45551 | ejb3-clustered-sfsbcache-service.xml | |
| jboss.messaging.datachanneludpport | 45567 | jboss-messaging.sar/xxx-persistence-service.xml | |
| jboss.messaging.controlchanneludpport | 45568 | jboss-messaging.sar/xxx-persistence-service.xml | |
| jboss.webpartition.mcast_port | 45577 | jboss-web-cluster.sar/META-INF/jboss-service.xml |
[edit] HA JNDI and local JNDI
Here are some usage scenarios that demonstrate the flexibility of having the clustered JNDI tree separate from the local JNDI tree:
| Client | Server Resource | Description | Servlet | EJB Local Interface | Servlets invoking EJBs will probably use local EJB interfaces most of the time. In this case, using the typical new InitialContext() approach to get the local JNDI tree is the best. | Remote JVM or Servlet acting like a remote JVM | EJB Remote Interface | If the EJB is clustered, then it will be available in the HA JNDI tree and the remote client should use that (port 1100 on each different by default). However, if the EJB is not clustered it's remote interface will be available just as it always was (port 1099 by default). | Servlet, MDB, or Remote JVM | JMS destination |
|
|---|
[edit] Networking Setup
JBoss uses JGroups extensively for clustering, and JGroups is typically configured to use multicast IP.
- Use IPv4 on Linux - Make sure you specify -Djava.net.preferIPv4Stack=true, otherwise JGroups might not start up.
- Explicitly specify the network interface - On Linux servers with multiple NICs, make sure you select a specific NIC. Otherwise, JGroups may not be able to select a unique 'address' for each node in the cluster.
- Check firewalls - Make sure the firewalls and switches allow multi-cast IP on the server LAN.
- Check for proper broadcast address - Make sure the BROADCAST address is set properly on the NICs.
- Broadcast addresses are generally: x.y.z.255 where x.y.z is the subnet address.
- All NICs used for the JBoss cluster should have the same broadcast address.
Example static IP address /etc/sysconfig/network-scripts/ifcfg-eth0:
#Primary ethernet interface DEVICE=eth0 TYPE=Ethernet IPADDR=192.168.0.101 BROADCAST=192.168.0.255 NETMASK=255.255.255.0 ONBOOT=yes USERCTL=no BOOTPROTO=static
$ sudo /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:30:48:7D:8B:78
inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::230:48ff:fe7d:8b78/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25410626 errors:0 dropped:0 overruns:0 frame:0
TX packets:21474977 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:829760159 (791.3 MiB) TX bytes:1099905746 (1.0 GiB)
Interrupt:17 Base address:0xe000
[edit] Links
- JBoss Cache
- JBoss Cache / JGroups / JBoss AS compatibility - http://www.jboss.org/jbosscache/compatibility/index.html
- http://docs.jboss.org/jbossas/jboss4guide/r4/html/cluster.chapt.html
- Connecting to a JBoss cluster means connecting to HAJNDI (*not* the regular JNDI) http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossHAJNDIUseCluster
- http://wiki.jboss.org/wiki/Wiki.jsp?page=HTTPLoadbalancer

