Infinispan cluster setup on JBOSS Servers

Infinispan cluster setup between the Servers:


Infinispan Concept:


Infinispan Server is a standalone server which exposes any number of caches to clients over a variety of protocols, including HotRod, Memcached and REST. The server itself is built on top of the robust foundation provided by WildFly, therefore delegating services such as management, configuration, data sources, transactions, logging, security to the respective subsystems.

Objective: We are going to implement infinispan cluster setup between all 4 servers.


RHEL 6.x or 7 version must be installed.

Infinispan Server 9.1 must be set up for all the servers.

The database must be installed on the server (in this case we have used Cassandra DB and the DBS. are in the cluster which shares the same IP)

Modifications that needs to be done:


1.  Setup Infinispan server cluster between the nodes

  • Following changes needs to be done in the file "clustered.xml" file of infinispan server for all the servers.
xx.xx.xx.xx, xx.xx.xx.xx, xx.xx.xx.xx and xx.xx.xx.xx
  • Add the initial host tag under the protocol type TCP:
<stack name="tcp">

<transport type="TCP" socket-binding="jgroups-tcp"/>

<protocol type="TCPPING">

<property name="initial_hosts">



<property name="num_initial_members">



<property name="port_range">



<property name="timeout">




Note: 7600 port is used to communicate tcp sync between the nodes. By default, port is 7600

Let’s discuss some points which are defined in the above tags:

The TCPPING protocol takes a set of known members and ping them for discovery.

Timeout: specifies the maximum number of milliseconds to wait for any responses. The default is 3000.

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

initial_hosts are a comma-separated list of addresses for pinging.

  •  change the value of default-stack from udp to tcp under the section <subsystem xmlns>
<subsystem xmlns="urn:infinispan:server:jgroups:7.0" default-stack="${jboss.default.jgroups.stack:tcp}">
  • Changed the replicated-cache mode from ASYNC to SYNC as below under the section <replicated-cache name>
<replicated-cache name="uecmsConfigCache" mode="SYNC" start="EAGER" batching="true">
  • Change the interface name i.e. management IP and public IP with the node ip as below

Changes on all the servers:

<interface name="management">

<inet-address value="${”node_ip”}"/>


<interface name="public">

<inet-address value="${jboss.bind.address:”node_ip”}"/>


Note: Don’t use loopback IP’s for any of the servers. i.e.

Clustered.xml file is below for the reference:

xml formatter

2. Add the 4 IPs (xx.xx.xx.xx, xx.xx.xx.xx, xx.xx.xx.xx, xx.xx.xx.xx) with hotrod port “11222” as below in the file.






Follow the same steps as mentioned above to setup infinispan cluster for the rest of the nodes


To implement JBoss service with cache and without cache for all the 4 servers

With cache modified value will get populated and without cache modified value will not be populated

To further implement this done the following changes:

  1. On Code level: if uecms.cache.load is true then the value will get populated otherwise not.
  2. On Script level which calls jboss_cache.service: Defined the parameter as “-Duecms.cache.load=true”
ExecStart=/opt/uecms/jboss/bin/ -Duecms.cache.load=true

Note: There are two scripts which calls the jboss, jboss_cache.service (which has the parameter -Duecms.cache.load=true) and jboss.service(without the parameter)

Path: /etc/system/system/jboss_cache.service

 / etc/system/system/jboss.service


If any modification in DB/config is done for any of the 4 servers, then the modified value should be reflecting on the other nodes.


One infinispan is stopped on any of the 4 servers and running on the other nodes then changes will reflect on all the 4 servers with the start of JBoss.


The value should be populated without restarting any of the application i.e. JBoss or infinispan

  1. Change in the db and reload the cache with the API of reloadDb
  2. Change in the config file and reload the cache with the API of reloadFiles

Attached is the test cases which we have gone through to get the above-mentioned requirements. You can refer to your servers.




Best Books available

q? encoding=UTF8&MarketPlace=IN&ASIN=184951822X&ServiceVersion=20070822&ID=AsinImage&WS=1&Format= SL250 &tag=7033b 21 - March 5, 2024 Automationlaboratoriesir?t=7033b 21&l=am2&o=31&a=184951822X - March 5, 2024 Automationlaboratories

q? encoding=UTF8&MarketPlace=IN&ASIN=B00YJ64GDS&ServiceVersion=20070822&ID=AsinImage&WS=1&Format= SL250 &tag=7033b 21 - March 5, 2024 Automationlaboratoriesir?t=7033b 21&l=am2&o=31&a=B00YJ64GDS - March 5, 2024 Automationlaboratories

Divya Gupta - Automation Laboratories

Linux System Admin | shell scripting | Ansible developer

Leave a Reply

Your email address will not be published. Required fields are marked *