Liferay Tomcat Cluster Session Replication

I-IP-ONLY" uniqueId=“{1,3,5,7,8,0,0,2,0,0,1,0,0,0,0,9}” />






-------
-------

S5: Update web.xml(under tomcat/conf and tomcat/webapps/ROOT/WEB-INF directory) and add distributable tag before web-app tag end.

----------
----------

S6: Update portal-ext.properties(under liferay home directory) and add below additional props
cluster.link.enabled=true
cluster.link.channel.properties.control=${catalina.base}/conf/tcp.xml
cluster.link.channel.properties.transport.0=${catalina.base}/conf/tcp.xml
cluster.link.autodetect.address=${DB-HOST-URL}:${DB-PORT}
portlet.session.replicate.enabled=true
web.server.display.node=true

Note: please change db-host-url and port as per application DB

S7: Update setenv.sh/setenv.bat (under tomcat/bin directory) and modify as below
CATALINA_OPTS=“$CATALINA_OPTS -Dfile.encoding=UTF-8 -Djgroups.bind_addr=NODE-II-IP-ONLY -Djgroups.tcpping.initial_hosts=NODE-II-IP-ONLY[4110],NODE-I-IP-ONLY[4110] -Djava.locale.providers=JRE,COMPAT,CLDR -Djava.net.preferIPv4Stack=true -Duser.timezone=GMT -server -Xms4096m -Xmx4096m -XX:MaxNewSize=1536m -XX:MaxMetaspaceSize=768m -XX:MetaspaceSize=768m -XX:NewSize=1536m -XX:SurvivorRatio=7”

S8: Now you can start tomcat second node server

-----------------------------------NODE-II CONFIGURATION END-----------------------------------

Hi @vchandrol,

These look like steps for configuring session replication with Tomcat in a Liferay cluster. If you need additional details, we have documentation available here:

Welcome @vchandrol

I’m not sure what you’re asking here, is there a specific question?

If it’s about session replication, we normally don’t recommend that. It consumes resources across your cluster for things the other nodes may never need. Liferay stores very little in session, so not a lot there is useful.

We do recommend using sticky sessions though, so requests from the same origin are served by the same node. The cache would have been warmed by the first visit, so returning hits on that node will rely on the cached data and avoid unnecessary database fetches.

If it’s a cluster link question, I’m not sure what it might be, but it is different than session replication certainly.