I have the next environment:
- Liferay 7.1 DXP with a clustered license (bundle with wildfly 16.0)
- This bundles running in the same machine (2 nodes) on the localhost but different ports
- Each node have the same database (postgresql)
- Separate running elasticsearch on the machine
- Shared folder for documents and media
- In the portal-setup-wizard.properties i added "cluster.link.enabled=true" and "ehcache.replicator.properties.com.liferay.portal.kernel.webserver.WebServerServletToken=replicatePuts=true" in order to replicate cache 7.Deployed sample portlet in order to test cache replication
I tried the next steps to test cache replication:
- Run the first node.
- After that run the second node.
- Go to localhost for the fist node
- Go to localhost for the second node
- See next message in the logs:
[Incoming-2,liferay-channel-control,WS-5459-64327][JGroupsReceiver:91] Accepted view MergeView::[WS-5459-18884|3] (2) [WS-5459-18884, WS-5459-64327], 2 subgroups: [WS-5459-64327|1] (2) [WS-5459-64327, WS-5459-18884], [WS-5459-18884|2] (1) [WS-5459-18884]
- In the test portlet on the first node, through debug mode, I added cache through MultiVMPoolUtil:
MultiVMPoolUtil.getPortalCache("com.liferay.portal.kernel.webserver.WebServerServletToken").put("1","1")
- And in the second node I tried to get value from this cache:
MultiVMPoolUtil.getPortalCache("com.liferay.portal.kernel.webserver.WebServerServletToken").getKeys()
But there is no key "1" on this cache on the second node, but if I tried to remove using the same API, .remove("1"), on the first node this value will be removed.
The question is how to configure cache replication for put operation?