Notes on Liferay clustering:
- Clustering for High Availability – Liferay Learn – Main page for clustering
- Here is what’s required to create an effectively functional DXP cluster: 1. Liferay DXP installed on separate application server nodes. 2. A database or database cluster that’s accessible to all nodes 3. A File Store that’s accessible to all nodes 4. A search engine (running outside of DXP) that is optionally clustered 5. Cluster Link configured to enable communication and cache replication across all nodes
- Configuring Unicast over TCP – Liferay Learn – Options for JGroups communication
- Configuring Cluster Link – Liferay Learn – Configurations for cluster
- Database Configuration for Cluster Nodes – Liferay Learn – This has option to optimize via separating the READ / WRITE operations via two synced instances of database.
- Nodes should not be run without clusterlink configuration in portal-ext.properties and proper configuration of UNICAST or MULTICAST, DB, etc. as described in Liferay Learn. There are architectural, caching, design, state management, pattern based, scheduler related and other reasons for running cluster by configuring all things properly.
- Don’t forget to refer Liferay Performance Tuning – Liferay – Refer performance tuning page to fine tune your JVM, Threads, Heap, GC, Database pooling, Elasticsearch pooling and other areas for each node or overall for the cluster via control panel or various files.
- Embedded database and embedded side-car search engine will break the cluster and you need remote / separate database and remote / separate Elasticsearch for cluster for work properly.
- Important list of files: server.xml, tcp.xml, portal-ext.properties, portal-setup-wizard.properties, web.xml, setenv.bat/sh, osgi/config, context.xml, jvm.options/.d, elasticsearch.yml
- Also, refer this blog: Clustering in Liferay CE 7.2 – Liferay
- Use Glowroot to monitor your cluster by referring this blog: Setting up Glowroot APM – Liferay – specifically check the Glowroot Central
Email me: Neil@HarwaniSystems.in
Some learnings below from various Liferay upgrades that I have been part of:
- Upgrades need us to plan various dry runs in advance on non-production environment
- Divide your upgrade between core / database and non-core upgrade
- Core includes Liferay engine, configurations and database
- Non-core includes themes, custom code, integrations and such
- Understand how to use database upgrade tool for core upgrade
- Logging of upgrade should be at much more verbose level than normal
- You can upgrade with document library or without it using portal-ext.properties configurations
- Upgrades between DXP from 7.x to 7.x are easier whereas upgrades from 6.x to 7.x need more planning
- For database upgrade tool, you have an option of 3 property files or you can use command prompt to enter required details
- Make sure you are at the latest version of whichever 7.x you are upgrading to
- Bad and corrupt data are perpetual problems which need to be analyzed properly before upgrade
- Use groovy to fix bad data not SQL
- Consider analysis and compliance from Liferay compatibility matrix, Liferay whitepapers on cloud, security, upgrade & scaling before planning your upgrade
- Create a template document for upgrade with all major areas pre-covered in analysis via the whitepapers on Liferay.com
- Understand the breaking changes with every major version release
- Learn to use the upgrade planner for code upgrade
- Docker containers are available and should be considered
- Consider headless, clustering, cloud, advanced file store, CMIS repository options right at the analysis phase of Liferay upgrade
- For your data storage requirements in future as per scaling – understand and analyze the load to confirm to the right choices of infrastructure like Cloud, SAN / NAS and so on
- Learn to use the basic Linux commands (if you are using Linux) like top, free, tail, ps, grep, liferay bin commands, sudo, vim, thread dumps and such to monitor / manage the upgrade well
- Look at top thread dump analyzers like: Smart Java thread dump analyzer – thread dump analysis in seconds (fastthread.io)
- Consider learning basics of operating system / network you are using, JVM & database tuning / optimization for threads, core allocations, monitoring and using Eclipse IDE to analyze threads, heap, etc.
- Keep reference guide for system.properties and portal-ext.properties handy during upgrade of core part
- Keep headless, GraphQL, Liferay / Java API details handy during code upgrade
- Explore 7.4 DXP features if you are upgrading to this version: Liferay DXP 7.4 New Features
- Refer help center articles and open documentation both, they have lot of good, useful content
- Reference: Upgrade Basics — Liferay Learn
Email me: Neil@HarwaniSystems.in
Ideas on Innovation around Software. We Thrive On Ideas. We are Learner Centered, Open Source & Digital Focused.