How do I switch clustering to TCP instead of multicast UDP in EAP 6?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Issue
- How do I switch clustering to TCP in EAP 6.x?
- What is the procedure to switch to tcp/ip communication instead of multicast mode for clustering?
- Nodes within a cluster are unable to send multicast message among them. How to switch to TCP from UDP?
- I would like to find out how to run jboss eap cluster in AWS,multicast (UDP) is not support in AWS. And would like to find out how to turn-on multicast for TCP, do we need to add tcpping? I'm running JBoss Web Server 2.1.
-
We would like to use TCP for the JGroups Subsystem. In the JBoss EAP 6.2 Admin and Config Guide, it gives a script for doing this. The script creates a new stack called TCPPING. We already have a stack called TCP. Could we use the TCP stack that comes with the standalone-full-ha profile, and just add the TCPPING protocol to that, or should we create a new stack called TCPPING. What is the difference?
-
Hornetq TCP for domain mode not starting up
Resolution
- To switch clustering to TCP, you can do one of the following:(standalone-ha.xml or domain.xml)
- Locate the HA profile that you are using for example "ha" profile.
- Replace default-stack=”udp” to default-stack=”tcp” in the subsystem element
Change :
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="udp">
To:
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="tcp">
- And add the following “TCPPING” protocol element with its sub-elements, which would be having the IP address of both the boxes. Make sure you comment or replace "MPING" with "TCPPING"
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="tcp">
<stack name="udp">
.. ..
</stack>
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="TCPPING">
<property name="initial_hosts">10.10.10.10[7600],20.20.20.20[7600]</property>
<property name="num_initial_members">2</property>
<property name="port_range">0</property>
<property name="timeout">2000</property>
</protocol>
<!--<protocol type="MPING" socket-binding="jgroups-mping"/>-->
<protocol type="MERGE2"/>
<protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
<protocol type="FD"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="BARRIER"/>
<protocol type="pbcast.NAKACK"/>
<protocol type="UNICAST2"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="UFC"/>
<protocol type="MFC"/>
<protocol type="FRAG2"/>
<protocol type="RSVP"/>
</stack>
</subsystem>
- If the domain-mode is used and the same profile should be used for different clusters it is possible to set the initial_hosts for the server-group
<protocol type="TCPPING">
<property name="initial_hosts">${jboss.cluster.tcp.initial_hosts}</property>
...
<server-groups>
<server-group name="a-server-group" profile="ha">
<socket-binding-group ref="ha-sockets"/>
<system-properties>
<property name="jboss.cluster.tcp.initial_hosts" value="10.10.10.10[7600],20.20.20.20[7600]" />
</system-properties>
Notes:
- It is recommended to use all servers within the initial_hosts and set it for all hosts nevertheless whether standalone or domain is used. This prevent from clustering issues.
- 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 a jgroups.bind_addr (the same as addresses specified in initial_hosts).
- Make sure
port_rangeis set to 0 (defaults to 1). In some circumstances, not specifyingport_rangecan cause intercluster communication. - It may be necessary to set
port_rangeof the TCP protocol to 0.
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp">
<property name="port_range">0</property>
</transport>
<protocol type="TCPPING">
...
- It is recommended that
num_initial_membersbe equal to the cluster size, but at least greater that 1/2 the cluster size. - If specifying a port offset, make sure the sum of the offset value and the jgroups-tcp port equals the port value specified in the initial_hosts listing.
- Cluster between nodes will be formed only after a clustered web application (application with distributable tag) will be deployed on those nodes(servers).
Also see Switch from UDP to TCP for HornetQ clustering in JBoss EAP 6
If you are looking for Command Line Interface (CLI) for doing the same, you can follow the link :
Configuring Cluster to run with TCP in Domain Mode of EAP6 using CLI
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.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
