Liferay Clustering with  RMI

In this tutorial, we will do cache replication with  RMI technique.

  • RMI is default EHCache replication implementation method and uses over  TCP protocol.  RMICacheManagerPeerListenerFactory distribution mechanism is configured by default in  hibernate-cluster.xml and liferay-multi-vm.xml files.
    • <cacheManagerPeerListenerFactory
       class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"  />
  • Cluster node opens point to point connection to each individual server
  • In RMI, each cached object must be serialized object
  • Let’s say, we have 5 node cluster; Node1 will open four TCP connections against to other four nodes, with this  huge number of connections, it will create lot of internal traffic may lead to performance issues.
  • It’s always recommended to use RMI  in two node cluster only
  • Instead of RMI, use JGroups cluster with UDP or Cluster Link  as explained in this tutorials

 Liferay Clustering with RMI

  • Create folder myehcache in  ROOT\WEB-INF\classes and copy ehcache/hibernateclustered.Xml and liferay-multi-vmclustered. Xml files into that folder. This is step is necessary if you are not using ehcache plugin.
  • Download ehcache folder that contains hibernate-clustered.xml and liferay-multi-vm files. Click here to download
    add below in :

    • net.sf.ehcache.configurationResourceName=/myehcache/hibernateclustered.xml
      net.sf.ehcache.configurationResourceName.peerProviderProperties=peerDiscovery=automatic,multicastGroupAddress= ,multicastGroupPort=25525,timeToLive=1
      ## This property is to display node information on Liferay Page ###
  • Please note this multi cast group IP  is not used by any other server
  • Now delete tables prefixed with “Quartz” and start the all servers; with this, we completed Liferay cache cluster  setup with RMI.

Note: We are overriding default hibernate & multi vm xml files with myehcache folder to fine tune such as increasing disk memory for some entities like that. Its always best practice to keep these custom files and also it is not mandatory to provide peer provider properties in, rather we can add them in propertySeparator attribute in both xml files.

liferay-mutti-vm-cluter.xml :






Liferay Cluster with cluster link

In this tutorial  we will look into Liferay Cluster setup  on Liferay 6.2 EE version with cluster link.READ MORE

Liferay Cache Replication With JGroups

Liferay Cache Replication with JGroups tutorial will give you details on “How to setup cache replication with JGroups” READ MORE