By Bryan Cheung | October 4, 2017

New Clustering Code for Liferay Portal Community

I am writing to let you know that we are introducing a new clustering solution for Liferay Portal 7.

Clustering

Background

When we removed clustering from the GA release of LP7, we were trying to solve a specific problem. However, I knew even as I made the decision that this would frustrate smaller systems integrators in places like Southern and Eastern Europe, India, and Southeast Asia that work on small projects with implementation budgets of $30,000 or less and a fraction of that for each subsequent year of maintenance. They can't afford a subscription but also don't have clustering for their LP7-based projects.

One solution was to offer free access to Enterprise for qualified community members. I hoped this would strike a good balance, but only one organization (a startup fighting rare diseases) took me up on the offer.

More importantly, I think it’ll be better for us to find different ways to address the problems we were facing than to remove a feature we had already included for a long time in our project.

Reintroducing Clustering

Clustering support is now available on GitHub and can be added to LP7 Community using the following instructions. The implementation will be different from what’s in our Enterprise Subscription, but it will be suitable for running the kinds of projects that are priced out by our subscription.

Official Documentation

We have published official documentation on the Liferay Developer Network on configuring clustering for Liferay 7.

Building Clustering for Liferay 7

These instructions assume building against master but will also work with the 7.0.x branch or GA5+ (tagged as 7.0.4-ga5 when it comes out).

Build Liferay Portal from source

Clone Liferay Portal Central Repo on Github:

git clone https://github.com/liferay/liferay-portal —branch master —single-branch --depth 1

Build master from source:

cd liferay-portal
ant all

Remove the following jars from ../bundles/osgi/portal:

rm -f ../bundles/osgi/portal/com.liferay.portal.cache.single.jar
rm -f ../bundles/osgi/portal/com.liferay.portal.cluster.single.jar
rm -f ../bundles/osgi/portal/com.liferay.portal.scheduler.single.jar

Build and Deploy Clustering Modules

Build and deploy the following modules to ../bundles/osgi/portal:

cd modules
../gradlew :apps:foundation:portal:portal-cluster-multiple:deploy
../gradlew :apps:foundation:portal-cache:portal-cache-ehcache-multiple:deploy
../gradlew :apps:foundation:portal-scheduler:portal-scheduler-multiple:deploy

Enable Clustering

Add the following to portal-ext.properties:

cluster.link.enabled=true

If all goes well the following should appear in the bundle logs when starting Liferay Portal:

-------------------------------------------------------------------
GMS: address=oz-52865, cluster=liferay-channel-control, physical address=192.168.1.10:50643
-------------------------------------------------------------------

Conclusion

When I announced our initial decision in April 2016, I told you that this was a conversation in progress with the community. I hope this is welcome news for you and would love to hear what you think. Thanks everyone for being a part of what we’re doing at Liferay. I don’t take your participation for granted.