13.2.13. Configure the JGroups Subsystem to Use TCP
mod_clustersubsystem relies upon the JGroups subsystem to manage and track nodes leaving, joining, and failing over in the cluster. By default, the JGroups subsystem communicates using multicast UDP. Use the following procedure to configure the JGroups subsystem to use unicast TCP instead.
mod_clustersubsystem to use TCP as well, refer to Section 13.2.14, “Configure the
mod_clusterSubsystem to Use TCP”.
Run the Management CLI.Launch the Management CLI, using the
EAP_HOME/bin/jboss-cli.shcommand in Linux or the
EAP_HOME\bin\jboss-cli.batcommand in Microsoft Windows Server. Type
connectto connect to the domain controller on the localhost, or
connect IP_ADDRESSto connect to a domain controller on a remote server.
Modify the following script to suit your environment.Copy the following script into a text editor. If you use a different profile on a managed domain, change the profile name. If you use a standalone server, remove the
/profile=full-haportion of the commands. Modify the properties listed at the bottom of the command as follows. Each of these properties is optional.
- A comma-separated list of the hosts which are considered well-known, and will be available to look up the initial membership.
- If desired, you can assign a port range. If you assign a port range of 2, and the initial port is 7600, then TCPPING will attempt to contact each host on ports 7600-7601. This property is optional.
- An optional timeout value, in milliseconds, for cluster members.
- The number of nodes before the cluster is considered to be complete. This property is optional.
cd /profile=full-ha/subsystem=jgroups ./stack=tcpping:add cd stack=tcpping ./transport=TRANSPORT:add(type=TCP,socket-binding=jgroups-tcp) :add-protocol(type=TCPPING) :add-protocol(type=MERGE2) :add-protocol(type=FD_SOCK,socket-binding=jgroups-tcp-fd) :add-protocol(type=FD) :add-protocol(type=VERIFY_SUSPECT) :add-protocol(type=BARRIER) :add-protocol(type=pbcast.NAKACK) :add-protocol(type=UNICAST2) :add-protocol(type=pbcast.STABLE) :add-protocol(type=pbcast.GMS) :add-protocol(type=UFC) :add-protocol(type=MFC) :add-protocol(type=FRAG2) :add-protocol(type=RSVP) cd protocol=TCPPING ./property=initial_hosts/:add(value="HostA,HostB") ./property=port_range/:add(value=0) ./property=timeout/:add(value=3000) ./property=num_initial_members/:add(value=3) cd ../.. :write-attribute(name=default-stack,value=tcpping)
Run the script in batch mode.
WarningThe servers runnning the profile have to be shutdown before executing the batch file.At the Management CLI prompt, type
batchand press the Enter key. The prompt changes to include a hash (
#) symbol to indicate that you are in batch mode. This allows you to enter a series of commands. If any one of them fails, the entire operation will be rolled back.Paste the modified script from the previous step, adding an extra newline at the end. Type
run-batchto run the batch. After all commands have run, the message
The batch executed successfullyappears.
TCPPING stack is now available to the JGroups subsystem. If it is used, the JGroups subsystem uses TCP for all network communication. To configure the
mod_cluster subsystem to use TCP as well, refer to Section 13.2.14, “Configure the
mod_cluster Subsystem to Use TCP”.