13.2.13. Configure the JGroups Subsystem to Use TCP

The mod_cluster subsystem 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.
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”.
  1. Run the Management CLI.

    Launch the Management CLI, using the EAP_HOME/bin/jboss-cli.sh command in Linux or the EAP_HOME\bin\jboss-cli.bat command in Microsoft Windows Server. Type connect to connect to the domain controller on the localhost, or connect IP_ADDRESS to connect to a domain controller on a remote server.
  2. 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-ha portion 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
    cd stack=tcpping
    cd protocol=TCPPING
    cd ../..
  3. Run the script in batch mode.


    The servers runnning the profile have to be shutdown before executing the batch file.
    At the Management CLI prompt, type batch and 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-batch to run the batch. After all commands have run, the message The batch executed successfully appears.

The 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”.