Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Issue
- What config changes are required to isolate clusters on the same network?
- I need to start JBoss so it doesn't join an existing cluster.
- Is there a way that the clusters can be segregated in JBoss from seeing the incorrect nodes?
- Is there configuration in Jboss that will specify the nodes that are in the cluster?
- How do we start X separate clusters within the same environment?
- How can one avoid cluster crosstalk in EAP 6?
- In order to isolate the cluster, Is it required to use different multicast addresses for the JBoss nodes?
- How to prevent a cluster node on laptop A connects to a clusternode on laptop B?
Resolution
When using the default multicast/UDP clustering configuration, specify a unique multicast address for each cluster.
-
If using TCP and TCPPING for all cluster channels, then setting the multicast address is not necessary because the TCPPING.initial_hosts configuration controls the cluster membership.
-
Multicast addresses are in the range 224.0.0.0 to 239.255.255.255.
- 224.0.0.* are reserved for specific purposes and shouldn't be used. Other ranges are reserved for particular scopes (how far on the network the messages can travel).
- If you're not sure what addresses to use, check with your network administrators if they have any particular IPs or ranges they'd like you to use.
-
The multicast IPs and ports are configured by the following socket bindings (note that messaging is only enabled by default in some profiles). These are usually configured by setting the listed system properties.
<socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/> <socket-binding name="messaging-group" port="0" multicast-address="${jboss.messaging.group.address:231.7.7.7}" multicast-port="${jboss.messaging.group.port:9876}"/>
Standalone Mode
-
Specify a unique multicast address for each cluster with "-u". This is shorthand syntax for setting the jboss.default.multicast.address system property.
./standalone.sh -u 230.1.1.1 ...
-
If using HornetQ set the following property to the same value as -u:
-Djboss.messaging.group.address=...
for nodes belonging to the same hornetQ cluster
Domain Mode
Set the system properties for the server-group or individual servers.
For the most common use case where a server-group corresponds to a single cluster:
<server-group ...
<system-properties>
<property name="jboss.default.multicast.address" value="230.0.0.4"/>
<property name="jboss.messaging.group.address" value="231.7.7.7"/>
...
</system-properties>