TCPPING is used with TCP as transport, and uses a static list of cluster members's addresses.

If you are using WildFly 14 or newer, the recommended way to do that is to use the <socket-discovery-protocol /> element which points to set the socket bindings (one for each cluster note). This decouples the cluster definition from the JGroups configuration:

<stack name="tcpping">
    <transport type="TCP" socket-binding="jgroups-tcp"/>
    <socket-discovery-protocol type="TCPPING" socket-bindings="jgroups-host-a jgroups-host-b"/>
    <protocol type="MERGE3"/>
    <protocol type="FD_SOCK"/>
    <protocol type="FD_ALL"/>
    <protocol type="VERIFY_SUSPECT"/>
    <protocol type="pbcast.NAKACK2"/>
    <protocol type="UNICAST3"/>
    <protocol type="pbcast.STABLE"/>
    <protocol type="pbcast.GMS"/>
    <protocol type="MFC"/>
    <protocol type="FRAG2"/>
</stack>

Then in your socket-binding-group define the list of cluster members:

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

    <!-- other configuration here -->
    <outbound-socket-binding name="jgroups-host-a">
        <remote-destination host="localhost" port="7600"/>
    </outbound-socket-binding>
    <outbound-socket-binding name="jgroups-host-b">
        <remote-destination host="localhost" port="7750"/>
    </outbound-socket-binding>
</socket-binding-group>

You can change to the default channel's stack to use tcpping as follows:

/subsystem=jgroups/channel=ee:write-attribute(name=stack,value=tcpping)

Legacy TCPPING configuration

If you are using an older version of WildFly or JBoss EAP 6, then you need to use properties to specify your static cluster composition.In the following example we have configured as default stack tcpping for a cluster made up of two nodes listening on the IP Addresses 192.168.10.1 and 192.168.10.2 with the default tcp port 7600:

<subsystem xmlns="urn:jboss:domain:jgroups:2.0" default-stack="tcpping">
	<stack name="tcpping">
		<transport type="TCP" socket-binding="jgroups-tcp"/>
		<protocol type="TCPPING">
			<property name="initial_hosts">192.168.10.1[7600],192.168.10.2[7600]</property>
			<property name="port_range">10</property>
			<property name="timeout">3000</property>
			<property name="num_initial_members">2</property>
		</protocol>
		<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>

Initial_hosts is a comma delimited list of hosts to be contacted for initial membership.

Num_initial_members specifies the maximum number of responses to wait for unless timeout has expired. The default is 2.

TCPPING will try to contact both 192.168.10.1 and 192.168.10.2, starting at port 7600 and ending at port 7600 + the port_range, in the above example ports 7600 - 7610.

Legacy TCPPING from the CLI

Here is a script which can be used to create the TCPPING stack directly from the CLI:

connect
batch
/subsystem="jgroups"/stack="tcpping":add()
/subsystem="jgroups"/stack="tcpping":add-protocol(type="TCPPING")
/subsystem="jgroups"/stack="tcpping"/protocol="TCPPING"/property="initial_hosts":add(value="192.168.10.1[7600],192.168.10.2[7600]")
/subsystem="jgroups"/stack="tcpping"/protocol="TCPPING"/property="port_range":add(value="10")
/subsystem="jgroups"/stack="tcpping"/protocol="TCPPING"/property="timeout":add(value="3000")
/subsystem="jgroups"/stack="tcpping"/protocol="TCPPING"/property="num_initial_members":add(value="2")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="MERGE2")
/subsystem="jgroups"/stack="tcpping":add-protocol(socket-binding="jgroups-tcp-fd",type="FD_SOCK")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="FD")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="VERIFY_SUSPECT")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="BARRIER")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="pbcast.NAKACK")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="UNICAST2")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="pbcast.STABLE")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="pbcast.GMS")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="UFC")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="MFC")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="FRAG2")
/subsystem="jgroups"/stack="tcpping":add-protocol(type="RSVP")
/subsystem="jgroups"/stack="tcpping"/transport="TRANSPORT":add(socket-binding="jgroups-tcp",type="TCP")
run-batch

 

0
0
0
s2smodern

Related articles available on mastertheboss.com

JBoss Clustering a Web Application

Please Note: This article cover JBoss AS 4/5/6 releases. If you w

Clustering EJB 3 with JBoss AS

To cluster a stateless session bean in EJB 3 all you need to do i

JBoss monitoring HTTP Session replication

In this article we'll show how to monitor HTTPSession replication

How do I change multicast address of JBoss cluster ?

Since JBoss AS 4.0.3, the jboss.partition.udpGroup property can b

JBoss farming service

What is the farming service ? this article explains about it, als

JBoss HTTP Session replication

HTTP session replication is used to replicate the state associate