Liferay is a prominent Content Management System which is adopted by enterprises across the world to build the portals and corporate sites.
Search is a very important and widely used feature of Liferay development. Elasticsearch goes well with Liferay. Liferay architectures either use embedded Elasticsearch or use the Remote Elasticsearch. The experts of the Liferay development services recommend to use the Remote Elasticsearch option as it enhances the search performance of the system. Embedded is not recommended for production environments as it might slow down the performance.
In this blog, we have provided the steps to be performed to integrate remote Elasticsearch with Liferay DXP 7.2.
1) Check Liferay compatibility matrix for Elastic search version from.
2) For instance we are using ElasticSearch Version 7.6.2 which can be downloaded from the link below.
3) Elasticsearch services basically requires permission of user named elasticsearch user only you can create elasticsearch user with below command.
sudo useradd -m elasticsearch
4) Upgrade Liferay elasticsearch from 6.x to 7.x by downloading Liferay Connector ElasticSearch 7 lpkg plugin from liferay marketplace.
5) To install lpkg, copy the lpkg file to Liferay’s deploy folder and let the file get started.
6) Once the lpkg is started shutdown the server.
7) Blacklist the 6.x elastic search by creating com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration.config file in server osgi config.
8) In com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration.config file put the following content.
“Liferay Connector to X-Pack Security [Elastic Stack 6.x] – Impl” \
9) Now clear servers temp, work, osgi/state folders and restart the server (A best practise step,not documented anywhere).
10) Start the server and reindex all searches.
11) create a directory named elasticsearch in /var/lib/ & /var/log/ folder and assign elasticsearch user permission to those directories.
12) Go to /home/elasticsearch/elasticsearch7.6.2/config/elasticsearch.yml file and enter following details.
13) Go to /home/elasticsearch/elasticsearch7.6.2/bin and install following plugins using command sudo ./elasticsearch-plugin install <<pluginname>>.
14) Kill all java processes, if running.
15) Start elasticsearch by going to /home/elasticsearch/elasticsearch7.6.2/bin and using command ./elasticsearch -d
16) Go to Liferay server osgi/config folder create a file named com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config
Enter the following details in this file.
transportAddresses = [ \
17) Restart the server and go to search and do reindex all, reindex spell.
That will ensure that the Liferay DXP is running with remote Elasticsearch.
ContCentric is a prominent Liferay development company. We provide customized, robust, and cost-effective content management solutions using the Liferay DXP version to our enterprise clients. Apart from Liferay DXP portal development services and upgrades, we also offer consultancy, support, and maintenance services.
If you want to get a customized portal solution to streamline the content management at your business, then you can drop us a line at firstname.lastname@example.org. Our expert Liferay consultants will be glad to respond to you for solving the content maze of your organization.