Liferay is a prominent Content Management System that is adopted by enterprises across the world to build 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 using 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.
Check the Liferay compatibility matrix for the Elastic search version.
2) For instance we are using ElasticSearch Version 7.6.2 which can be downloaded from the link below.
3) Elasticsearch services basically require the permission of a user named elasticsearch user only you can create elasticsearch user with the below command.
sudo useradd -m elasticsearch
4) Upgrade Liferay elastic search from 6. x to 7. x by downloading Liferay Connector ElasticSearch 7 lpkg plugin from the Liferay marketplace.
5) To install pkg, copy the pkg file to Liferay’s deploy folder and let the file get started.
6) Once the pkg is started shut down 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.
blacklistBundleSymbolicNames=[ \ “com.liferay.portal.search.elasticsearch6.api”, \ “com.liferay.portal.search.elasticsearch6.impl”, \ “com.liferay.portal.search.elasticsearch6.spi”, \ “com.liferay.portal.search.elasticsearch6.xpack.security.impl”, \ “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.
additionalConfigurations=”” additionalIndexConfigurations=”” additionalTypeMappings=”” bootstrapMlockAll=”false” clientTransportIgnoreClusterName=”false” clientTransportNodesSamplerInterval=”” clientTransportPingTimeout=”” clientTransportSniff=”true” clusterName=”LiferayElasticsearchCluster” discoveryZenPingUnicastHostsPort=”9300-9400″ httpCORSAllowOrigin=”/https?://localhost(:[0-9]+)?/” httpCORSConfigurations=”” httpCORSEnabled=”true” httpEnabled=”true” indexNamePrefix=”liferay-” indexNumberOfReplicas=”” indexNumberOfShards=”” logExceptionsOnly=”true” networkBindHost=”” networkHost=”” networkPublishHost=”” operationMode=”REMOTE” overrideTypeMappings=”” retryOnConflict=”5″ transportAddresses = [ \ “localhost:9300″, \ ] transportTcpPort=””
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 email@example.com. Our expert Liferay consultants will be glad to respond to you for solving the content maze of your organization.
May 11, 2022
May 9, 2022
May 3, 2022
April 26, 2022
March 24, 2022
We are seeking dynamic professionals and unstoppable talents to craft distinct solutions for our clients to enhance their businesses. Come, join our fair & focused, optimistic & thoughtful world and deliver excellence together.