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.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 Elasticserach cluster node uses port
9200 and the follower uses port
Cluster Liferay DXP¶
Each Liferay DXP node requires a
Liferay Home/portal-ext.properties file with the following property:
This is a simplistic clustering configuration. See clustering for a full configuration.
Install Required Elasticsearch Plugins¶
Make sure you install the required Elasticsearch plugins:
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.
TLS/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.configfile, then configure the connections separately in
For Liferay DXP 7.2, configure the remote connection in
ElasticsearchConfiguration.configand the read-only connection in the
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¶
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.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.