Configuring an Example CCR Installation: Replicating Between Data Centers
Liferay Enterprise Search (LES) Subscribers
This example configures Liferay DXP’s Cross-Cluster Replication module and Elasticsearch to set up two connections: a read-write connection from one Elasticsearch cluster to one Liferay DXP cluster node and a read connection from another Elasticsearch cluster to a second Liferay DXP cluster node.
Differences in the configurations and procedure between Liferay DXP 7.1, 7.2 and 7.3 are noted inline throughout these instructions.
You’ll use two single-node Elasticsearch clusters on localhost
, each with a copy of the same indexes. This is the simplest scenario you can configure to reap the data locality and disaster recovery benefits of Cross-Cluster Replication.
A vanilla Liferay DXP installation contains the indexes presented in Cross Cluster Replication. All Elasticsearch clusters used by Liferay DXP (two clusters in this example) need these indexes.
Elasticsearch API calls provided here can be copied and pasted into Kibana’s Dev Tools console, accessible via a separate Kibana installation or through the LES Monitoring widget.
To use Kibana, remember that you have multiple Elasticsearch clusters (two single-node clusters in this example) running. The elasticsearch.hosts: [ "http://localhost:<port>" ]
setting in Kibana’s kibana.yml
file must point to the correct port when managing the indexes and other configurations described below to avoid mixing the leader and the follower clusters. Here, it’s assumed that your leader Elasticsearch cluster node uses port 9200
and the follower uses port 9202
.
Cluster Liferay DXP
Each Liferay DXP node requires a Liferay Home/portal-ext.properties
file with the following property:
cluster.link.enabled=true
This is a simplistic clustering configuration. See clustering for a full configuration.
Install Required Elasticsearch Plugins
Make sure you install the required Elasticsearch plugins:
analysis-icu
analysis-stempel
analysis-kuromoji
analysis-smartcn
Prerequisite for Security: Configure Authentication and Encryption
To encrypt communication (TLS/SSL) and enable user authentication between the Liferay DXP and the Elasticsearch nodes, you must configure security:
-
Configure X-Pack Security in your Elasticsearch clusters. Make sure the node certificates are signed by the same CA and the security settings of the Leader and the Follower clusters match.
noteTLS/SSL must be enabled for the HTTP and Transport layers on the follower Elasticsearch cluster nodes. Liferay DXP connects to the follower cluster over HTTP to re-follow the company indexes after a full reindex is performed.
-
Configure the DXP nodes.
For Liferay DXP 7.3, configure the production mode settings for Elasticsearch in the
ElasticsearchConfiguration.config
file, then configure the connections separately inElasticsearchConnectionConfiguration-[ccr/remote].config
files.For Liferay DXP 7.1 and 7.2, configure the remote connection in
ElasticsearchConfiguration.config
and the read-only connection in theElasticsearchConnectionConfiguration-ccr.config
file.Include the security settings on each connection. See Securing Elasticsearch for details. Configuring CCR in a Local Follower Data Center covers configuring security for the read-only CCR connection from the local DXP nodes.
The example configurations are provided in full here.
Install the Cross-Cluster Replication Module
Starting with Liferay DXP 7.4, the Liferay Enterprise Search (LES) applications are included with all Liferay DXP bundles and Docker containers. Therefore, installing the LPKG is unnecessary on Liferay DXP 7.4+. See Activating LES for more information.
-
Download the Liferay DXP Cross-Cluster Replication for Elasticsearch LPKG from the LES downloads page.
-
Install the LPKG into all DXP nodes.
Because you only use multiple Elasticsearch connections on Liferay DXP 7.1 and 7.2 with Cross-Cluster Replication, the Connections UI is only visible in the Search administration panel (Control Panel > Configuration > Search—under the Connections tab) if the Cross-Cluster Replication LPKG is deployed. On Liferay DXP 7.3, the Connections UI is always present.
If all your prerequisite tasks are completed and the Cross-Cluster Replication module is installed, continue by configuring the servers in your remote data center.