Tuesday, October 9, 2012

Liferay Clustering - Having multiple environments in one network

In today's world, many of the Liferay portal implementations are done in clustered environment. Liferay works well on the clustered environment, too. 

However, there can be a situation when we have different environments like QA & Prod in the same physical network. Since Liferay is using Multicasting to transmit indexes and other details over the network, one can fear that the message may to to a wrong node e.g. message from QA may accidentally reach to one of the nodes of Prod. And this can be a very weird issue.

Liferay provides a facility to set the multicast group address for different features. For each environment, we can choose different multicast group. We need to add those details into portal-ext.properties of each cluster with different values. For example, if we have two clusters - QA & Prod - in the same network, we can add following properties in QA & Prod nodes' portal-ext.properties files:

For QA:

multicast.group.address["cluster-link-control"]=239.255.0.1
multicast.group.port["cluster-link-control"]=23311

multicast.group.address["cluster-link-udp"]=239.255.0.2
multicast.group.port["cluster-link-udp"]=23312

multicast.group.address["cluster-link-mping"]=239.255.0.3
multicast.group.port["cluster-link-mping"]=23313

multicast.group.address["hibernate"]=239.255.0.4
multicast.group.port["hibernate"]=23314

multicast.group.address["multi-vm"]=239.255.0.5
multicast.group.port["multi-vm"]=23315

For Prod:

multicast.group.address["cluster-link-control"]=241.255.0.1
multicast.group.port["cluster-link-control"]=23311

multicast.group.address["cluster-link-udp"]=241.255.0.2
multicast.group.port["cluster-link-udp"]=23312

multicast.group.address["cluster-link-mping"]=241.255.0.3
multicast.group.port["cluster-link-mping"]=23313

multicast.group.address["hibernate"]=241.255.0.4
multicast.group.port["hibernate"]=23314

multicast.group.address["multi-vm"]=241.255.0.5
multicast.group.port["multi-vm"]=23315

I have tried this in one of my recent deployment which worked without any issues.

2 comments:

  1. Hi Gaurav,
    Thanks for this post. We have the same issue at my place of work. Do you just make up the addresses and port numbers or do those addresses and port numbers relate to actual addresses and port numbers in your QA and Prod environments>
    Thanks in advance.
    Steve

    ReplyDelete
    Replies
    1. Did you get answer for your question? whether it should be actual addresses?

      Delete