Issue
- Communication is not working properly in the cluster even after setting all the configurations up in the portal instances. Changes have not been replicated from one node to another.
Environment
- Liferay 6.2 Clustered
- Liferay DXP 7.0-7.2 Clustered
- Liferay DXP 7.3 Clustered
Resolution
By default, Liferay uses Multicast clustering and, if the environment is not setup to handle this communication, Liferay clustering may not work properly.
For this resolution, we will consider two nodes of a clustered environment
For Liferay 6.2-7.2:
- Extract the zip file (attached in this article), in the folder [Liferay-HOME] of both node 1 and node 2
- In node 1, execute the command:
java -cp util-java.jar:portal-service.jar:commons-logging.jar com.liferay.util.transport.MulticastServerTool 239.255.0.5 23305 5000 -
In node 2, execute the command:
java -cp util-java.jar:portal-service.jar:commons-logging.jar com.liferay.util.transport.MulticastClientTool -h 239.255.0.5 -p 23305
For Liferay 7.3
-
You will need five jar files instead of three:
com.liferay.petra.lang.jar (from
CATALINA_BASE/lib/ext)
com.liferay.petra.string.jar (fromCATALINA_BASE/lib/ext)
commons-logging.jar (fromCATALINA_BASE/webapps/ROOT/WEB-INF/lib)
portal-kernel.jar (fromCATALINA_BASE/lib/ext)
util-java.jar (fromCATALINA_BASE/webapps/ROOT/WEB-INF/lib) - In node 1, execute the command:
java -cp util-java.jar:portal-kernel.jar:com.liferay.petra.string.jar:com.liferay.petra.lang.jar:commons-logging.jar com.liferay.util.transport.MulticastServerTool 239.255.0.5 23305 5000
- In node 2, execute the command:
java -cp util-java.jar:portal-kernel.jar:com.liferay.petra.string.jar:com.liferay.petra.lang.jar:commons-logging.jar com.liferay.util.transport.MulticastClientTool -h 239.255.0.5 -p 23305
If the communication is allowed, you will see something like:
NODE 1:
Phobos:23305 heartbeat 0
Phobos:23305 heartbeat 1
Phobos:23305 heartbeat 2
Phobos:23305 heartbeat 3
Phobos:23305 heartbeat 4
Node 2:
Started up and waiting...
May 19, 2019 10:15:52 AM com.liferay.util.transport.MulticastDatagramHandler process
INFO: [/192.168.109.171:23305] Phobos:23305 heartbeat 0
May 19, 2019 10:15:57 AM com.liferay.util.transport.MulticastDatagramHandler process
INFO: [/192.168.109.171:23305] Phobos:23305 heartbeat 1
May 19, 2019 10:16:02 AM com.liferay.util.transport.MulticastDatagramHandler process
INFO: [/192.168.109.171:23305] Phobos:23305 heartbeat 2
May 19, 2019 10:16:07 AM com.liferay.util.transport.MulticastDatagramHandler process
INFO: [/192.168.109.171:23305] Phobos:23305 heartbeat 3
May 19, 2019 10:16:12 AM com.liferay.util.transport.MulticastDatagramHandler process
INFO: [/192.168.109.171:23305] Phobos:23305 heartbeat 4
Additional Information
- For other troubleshooting options, please consider reading this article in our knowledge base.