The following Pre-requisites are required before enabling session Replication:
Session Replication Overview
Session replication ensures that client sessions of distributable
applications are not disrupted by
failovers of nodes in a cluster.
Each node in the cluster shares information about ongoing
sessions and can take over sessions if a node disappears.
Session replication is the mechanism by which mod_cluster,
mod_jk, mod_proxy, ISAPI, and NSAPI clusters provide high availability.
(More information regarding JBoss Session Replication can be
found here )
We will be covering the below points:
Note: All the above points from 1 - 4 shall
be followed in both the nodes
Making Liferay DXP Distributable:
Enabling Clustering in JBoss App Server:
For Clustering/HA JBoss Documentation suggests using
We will be using standalone-full-ha.xml because it includes support
for every possible subsystem, including those required for high
availability. Also, it contains all the interfaces which are required
for clustering and session replication. JBoss uses multicast, mod
cluster, and UDP/TCP protocol for internode communications.
Adding Outbound socket to configure with Web
The following steps are basic and can be amended as per the
real-time requirements. We have used the
basic setup of JBoss with JBCS HTTPD server with
mod_cluster setup. You can use the Apache HTTPD web server, etc with
mod_cluster setup, and can configure a similar kind of setup.
Just before the closing of the above tag
i.e. </socket-binding-group> add the outbound socket,
so that the App server is able to recognize the Frontend
x.x.x.x is the Web server IP and 80 is the
port on which it is Running. (You can change to 443 or
another port as per the Web server Setup)
Now find the following
tag <proxy name="default"
listener="ajp"> in standalone-full-ha.xml and add
the following attribute to the above
tag proxies="lb1" Final tag
will look like this: <proxy
Make sure the
proxies="value" is the same as the
name attribute mentioned in the outbound socket in the
Below is a sample Virtual Host setting done in
httpd.conf which is configured on the Web server.
Listen x.x.x.x:80 <VirtualHost x.x.x.x:80>
<Location /> Order
deny,allow Require all granted
Allow from tomcat </Location>
KeepAliveTimeout 60 MaxKeepAliveRequests 0
EnableMCPMReceive On ManagerBalancerName lb1
ServerAdvertise On </VirtualHost>
Note: Above settings are basic/generic, feel free
to do changes as per the Web Server Admin's suggestions.
Session Replication Validation:
Once all the above changes are in place, we can now start both
the nodes and web server to validate the Session replication behavior.
standalone.bat -u 220.127.116.11
For Linux: ./standalone.sh -u
(Remember to make standalone.sh as executable if it is not already)
where 18.104.22.168 is the default
multicast address (refer standalone-full-ha.xml)
There may be ample ways to configure Session Replication, the
above is one of them If you are getting error like the
following: Caused by:
java.lang.IllegalArgumentException 'exmapleBean' attribute
with type 'com.demo.portlet.example.' cannot be replicated at
Make sure all session objects and their
attributes/variables are made Serializable.