How to configure JBoss EAP and WildFly to use TCPPING

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

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

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.

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

 

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

Follow us on Twitter