Liferay 7.4 Ehcache configuration

Jamie Sammons, modified 1 Year ago. New Member Posts: 4 Join Date: 9/27/23 Recent Posts

Hi there,

I'm using Liferay 7.4 with two servers, behind load balancer and  we'd like to use clustering mode. 

When we changed smth in the page, it didn't reflect to the secod server. 

Is there any missing point?


We placed these configuration in our properties file.

my portal-ext.properties file is ;

     ## Cluster Nodes Configuration
        
        cluster.link.enabled=true
        cluster.link.autodetect.address={{ POSTGRES_HOST }}:{{ POSTGRES_HOST_PORT }}

        ehcache.multi.vm.config.location=/ehcache/liferay-multi-vm.xml

I found the liferay-multi-vm.xml file from Portal Cache - Impl.lpkg then mounted in our both servers.

liferay-multi-vm.xml file;

 

<ehcache
	dynamicConfig="true"
	monitoring="off"
	name="liferay-multi-vm"
	updateCheck="false"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="http://www.ehcache.org/ehcache.xsd"
>

	<!--
	Caches in this file can be clustered and are configured to be clustered.
	-->

	<defaultCache
		eternal="false"
		maxElementsInMemory="10000"
		overflowToDisk="false"
		timeToIdleSeconds="600"
	>
	</defaultCache>



I'll appreciate very much your help here.

Thanks!


 

 

Jamie Sammons, modified 1 Year ago. New Member Posts: 4 Join Date: 9/27/23 Recent Posts

Hi all,

If I create a user from first server, it can reflect in the second server. However, when I updated a page and publish in first server, it didn't reflect to second server.

Thanks for your help.

thumbnail
Olaf Kock, modified 1 Year ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

I'm assuming that your servers don't find each other:

Display of the user list is done through Elasticsearch, while the page is fueled by the database - which relies on the cache.

You should​​​​​​​ see messages in the log that both computers find each other (but in this case you likely don't)

If I remember correctly, discovery is done through Multicast (unless you configure Unicast explicitly), and Multicast is often disabled in networks.

Jamie Sammons, modified 1 Year ago. New Member Posts: 4 Join Date: 9/27/23 Recent Posts

Thanks for your time,

While starting containers I can see these logs both servers, so means cluster.link is working. Is it right?

GMS: address=282eb4ca2e02-5973, cluster=liferay-channel-transport-0, physical address=10.0.2.100:44856


GMS: address=control-channel-logic-name-dev02-dxp01, cluster=liferay-channel-control, physical address=10.0.2.100:38194

I'm using aws instances within same subnet, however do we need to configure TCP Unicast configuration for my cluster?

 

Jamie Sammons, modified 1 Year ago. New Member Post: 1 Join Date: 10/11/23 Recent Posts

I'm also learning about the formula for this programming. You shared at the right time. It's great to have so much documentation

Jamie Sammons, modified 1 Year ago. New Member Posts: 4 Join Date: 9/27/23 Recent Posts

This's solved for our side. We configured TCP-Unicast  for our cluster on AWS.