Affects Version/s: 7.0.0 DXP GA1, 7.0.X, 7.1.10 DXP GA1, 7.2.0 GA1
Component/s: Web Search > Search Admin
Branch Version/s:7.2.x, 7.1.x
Backported to Branch:Committed
Sprint:Search | S02 Sprint 17, Search | S02 Sprint 18, Search | S02 Sprint 19
Git Pull Request:
Background: As of Elasticsearch 5.x, it is not possible to define the values of shards / replicas in "elasticsearch.yml".
- Download & unpack Elasticsearch 6.5.x/6.1.x
- Start a 3-node ES cluster
- Create & put it under LIFERAY_HOME/osgi/configs
- Start Liferay
- Go to System Settings - Elasticsearch 6
- Set "1" for "Number of Index Replicas"
The number of replicas for each Liferay index. If unset, no replicas are used. Changes to this value take effect after a full reindex.
Default is zero ("0")
- Go to Control Panel - Configuration - Search: "Reindex all search indexes."
- Check Elasticsearch Cluster status through curl -X GET "localhost:9200/_shard_stores?status=green&human&pretty" or using elasticsearch-head
Expected Result: index with name "liferay-0" appears under 2 nodes (replicated)
Actual Result: index with name "liferay-0" appears under only 1 node (not replicated)
Notes for 7.0.x
- Does not affect the default Elasticsearch 2 connector because there is no such option for the connector, but this can be configured at elasticsearch.yml level
- To test with ES6, you need to the deploy the "Liferay Connector to Elasticsearch 6" app (portal-search-elasticsearch6 modules) and disable the default portal-search-elasticsearch module.
- Reindex is in the Server Admin
Test solution with
- index.on.startup=true and
- Solr 7/5
- Stop Liferay
- Stop ES cluster
- Delete "company-0" from the node it holds
- Create com.liferay.portal.search.elasticsearch6.configuration.ElasticsearchConfiguration.config with the required "replica/sharding" settings (or set it through the UI before shutting down Liferay)
- Start ES cluster
- Start Liferay
- Update the "Index Settings" for the SYSTEM company "liferay-0" using the REST API: https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-update-settings.html
- Update com.liferay.portal.search.elasticsearch6.configuration.ElasticsearchConfiguration.config with the required "replica/sharding" settings or set it through the UI before shutting down Liferay so it'll still take effect in the future in case they'd wipe out the indexes for whatever reasons