Configuring TCP protocol

QMF uses JGroups to communicate among the nodes.

By default, JGroup is configured to use UDP as a communication protocol. If UDP is not supported in your environment or if you are facing problems using UDP configuration, you can use TCP configuration.

To use TCP, when you start a new node or restart an existing node ensure to provide the JGROUPS_TCP_INITIAL_HOSTS as a Java Virtual Machine system property or as an environment variable. The value of this property should be the host and port of a node that is already running in the cluster. To use the TCP configuration, follow the steps:
  1. Shut down all the nodes.
  2. Replace the contents in the XML file JGROUPS.CONFIG.FILE with the following:
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="urn:org:jgroups"
            xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/jgroups.xsd"
            version="4.2.4.Final">
        <TCP 
    		bind_port="7800"
             recv_buf_size="${tcp.recv_buf_size:130k}"
             send_buf_size="${tcp.send_buf_size:130k}"
             max_bundle_size="64K"
             sock_conn_timeout="300"
    		 port_range="30"
             thread_pool.min_threads="0"
             thread_pool.max_threads="20"
             thread_pool.keep_alive_time="30000"/>
    
        <TCPPING async_discovery="false"
                 initial_hosts="${JGROUPS_TCP_INITIAL_HOSTS:localhost[7800],localhost[7801]}"
                 port_range="30"/>
        <MERGE3  min_interval="10000"
                 max_interval="30000"/>
        <FD_SOCK/>
        <FD_ALL timeout="18000" interval="3000" />
        <VERIFY_SUSPECT timeout="1500"  />
        <BARRIER />
    	<!-- <SYM_ENCRYPT sym_algorithm="AES/CBC/PKCS5Padding"
                 sym_iv_length="16"
                 keystore_name="/home/<user>/defaultStore.keystore"
                 store_password="changeit"
                 alias="myKey"/> -->
        <pbcast.NAKACK2 use_mcast_xmit="false"
                       discard_delivered_msgs="true"/>
        <UNICAST3 />
        <pbcast.STABLE desired_avg_gossip="50000"
                       max_bytes="4M"/>
        <pbcast.GMS print_local_addr="true" join_timeout="10000"/>
        <UFC max_credits="2M"
             min_threshold="0.4"/>
        <MFC max_credits="2M"
             min_threshold="0.4"/>
        <FRAG2 frag_size="60K"  />
        <!--RSVP resend_interval="2000" timeout="10000"/-->
        <pbcast.STATE_TRANSFER/>
    	<CENTRAL_LOCK />
    	<COUNTER />
    </config>
    
  3. Bring up any one node in the cluster.
  4. For all the remaining nodes, repeat the following steps:
    1. Open the console output file (mostly this file is available as a.out file) of the node which is already running.
    2. In the file, identify the following lines or lines similar to the following lines:
      GMS: address=<host>, cluster=<app-data-directory>, physical address=<IP>:<Port>

      The <IP> here is the IP address and <Port> specifies the value of the port of the node that is already running in the cluster.

    3. Set the value of the JGROUPS_TCP_INITIAL_HOSTS property with the value of the IP address and port of the node that is already running in the cluster (see, step 4.b). This value should be in the format: IP[Port].
    4. Start the configured node.