Configure Jgroups to use TCP in a horizontally-scaled environment

This section explains how to switch an existing horizontally-scaled environment from UDP to TCP, and how to configure a new horizontally-scaled environment to use TCP.

How to switch an existing horizontally-scaled environment from UDP to TCP

  1. Add the following command to the beginning of the sm.cfg file on the Primary Host:

    sm -GossipRouter -Gossiprouterport:<value>

    Note Make sure that you select an unused port as the value of the Gossiprouterport parameter. Additionally, you must add this command to the beginning of the sm.cfg file so that the GossipRouter starts before any other Service Manager processes.

  2. Remove the following initialization parameters from the sm.ini file for each host:

    • groupmcastaddress:<value>
    • groupport:<value>
  3. Add the following initialization parameters to the sm.ini file for each host:

    • jgroupstcp:<value>
    • GossipRouterhosts:<value>
  4. Optional: Add the following initialization parameters to the sm.ini file for each host:

    • grouptcpbindport:<value>
    • asyncrefreshlbinterval:<value>
    • grouptcpjointimeout:<value>

How to configure a new horizontally-scaled environment to use TCP

  1. Add the following commands to the sm.cfg file on the Primary Host:

    • sm –GossipRouter -Gossiprouterport:<value>

      Note Make sure that you select an unused port as the value of the Gossiprouterport parameter. Additionally, you must add this command to the beginning of the sm.cfg file so that the GossipRouter starts before any other Service Manager processes.

    • sm -loadBalancer -httpPort:<value>
    • sm -que:ir
    • sm -httpPort:<value> -httpsPort:<value>
    • sm system.start
  2. Add the following commands to the sm.cfg file on the Secondary Host:

    • sm -httpPort:<value> -httpsPort:<value>
    • sm –sync
  3. Add the following initialization parameters to the sm.ini file for each host:

    • system:<value>
    • grouplicenseip:<value>
    • groupname:<value>
    • jgroupstcp:<value>
    • GossipRouterhosts:<value>
  4. Optional: Add the following initialization parameters to the sm.ini file for each host:

    • groupbindaddress:<value>
    • grouptcpbindport:<value>
    • asyncrefreshlbinterval:<value>
    • grouptcpjointimeout:<value>

Example of a horizontally-scaled TCP implementation

Machine

sm.cfg (excerpt)

sm.ini (excerpt)

myserver1 

10.0.0.135

(Primary Host)

sm -GossipRouter Gossiprouterport:12001 sm -loadbalancer -httpPort:13080 sm -que:ir

sm -httpPort:13081 -httpsPort:13082 sm system.start

system: mygroup1 grouplicenseip:10.0.0.135 groupname:mygroup1 jgroupstcp:1 GossipRouterhosts: myserver1[12001]

myserver2 

10.0.0.136

(Secondary Host)

sm -httpPort:13081 -httpsPort:13082 sm -httpPort:13083 -httpsPort:13084 sm -sync

system: mygroup1 grouplicenseip:10.0.0.135 groupname:mygroup1 jgroupstcp:1 GossipRouterhosts: myserver1[12001]

myserver3 

10.0.0.137

(Secondary Host)

sm -httpPort:13081 -httpsPort:13082 sm -httpPort:13083 -httpsPort:13084 sm -sync

system: mygroup1 grouplicenseip:10.0.0.135 groupname:mygroup1 jgroupstcp:1 GossipRouterhosts: myserver1[12001]

Related topics

Configure Service Manager Jgroups to use TCP instead of UDP
Configure Jgroups to use TCP in a vertically-scaled environment

Related topics

Parameter: jgroupstcp
Parameter: GossipRouterhosts
Parameter: asyncrefreshlbinterval
Parameter: grouptcpjointimeout
Parameter: grouptcpbindport