How do I switch clustering to TCP instead of multicast UDP in JBoss 5.x ?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 5.x
- Red Hat JBoss SOA Platform (SOA-P)
- 5.x
Issue
- We need to disable UDP transport, disable auto discovery and enable TCP to set up the clustering.
- How do I switch clustering to TCP?
- One node of a cluster is not joining the other two. They are linked to two different switches.
Resolution
-
Set the system property
jboss.default.jgroups.stackto "tcp" to switch all default cluster channels except for JBoss Messaging to TCP:run.sh -Djboss.default.jgroups.stack=tcp ... -
Switch the default TCP channels from multicast UDP discovery to a hard-coded server list
-
In the "
tcp" stack indeploy/cluster/jgroups-channelfactory.sar/META-INF/jgroups-channelfactory-stacks.xmlcomment out theMPINGprotocol and uncommentTCPPING -
For EAP 5.0 or 5.0.1, change
jgroups.tcpping.initial_hoststojboss.jgroups.tcp.tcpping.initial_hostsinTCPPING.initial_hosts -
Set the system property
jboss.jgroups.tcp.tcpping.initial_hoststo the list of cluster membersrun.sh -Djboss.jgroups.tcp.tcpping.initial_hosts="hostA[7600],hostB[7600]" ...Note the list of hosts needs to include all of the cluster members. For convenience the configuration can made simple by using the same list for all instances include this instance itself.
-
-
To switch JBoss Messaging to
TCP/TCPPING, after making the above changes, change the following attributes indeploy/messaging/*-persistence-service.xml
from:<attribute name="ControlChannelName">jbm-control</attribute> <attribute name="DataChannelName">jbm-data</attribute>to:
<attribute name="ControlChannelName">tcp</attribute> <attribute name="DataChannelName">tcp</attribute>
Notes:
- Make sure that the cluster instances are bound to the IP addresses specified in
initial_hosts. If binding instances to 0.0.0.0, make sure to specify ajgroups.bind_addr(the same as addresses specified ininitial_hosts). - Make sure
port_rangeis set to 0 (defaults to 1). In some circumstances, not specifying port_range can cause intercluster communication. - It is recommended that
num_initial_membersbe equal to the cluster size, but at least greater that 1/2 the cluster size.
Diagnostic Steps
It seems that you may have a multicast issue. Packaged within the JGroups library (distributed with JBoss) there is a multicast test that can be ran between nodes. Run the test numerous times, allowing each member of the cluster to be the sender and receiver.
How to test multicast using JGroups in JBoss EAP
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.