Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-124700

Virtual Instance (aka. company) indexes don't create replica shards, they should be created with "index.auto_expand_replicas: 0-all" ootb



      Master, 7.3 GA5, DXP 7.3 GA1: Updated in LPS-103577.

      DXP Version Elasticsearch Connector Affects Version/s Fixed in
      DXP 7.0 Liferay Connector to Elasticsearch 6 (Marketplace) v1.3.0 and prior v1.3.1+
      DXP 7.1 Liferay Connector to Elasticsearch 6 (bundled) < FP23 FP23+
      DXP 7.1 Liferay Connector to Elasticsearch 7 (Marketplace) v2.0.0 Future release
      DXP 7.2 Liferay Connector to Elasticsearch 6 (bundled) < FP11 FP11+
      DXP 7.2 Liferay Connector to Elasticsearch 7 (Marketplace) v3.2.1 and prior v3.2.2+

      Solution notes

      The fix changes the default index settings shipped with the connectors, thus it requires to perform a full reindex to take effect. Alternatively, the setting can be updated manually on the affected indexes through the REST API: example command:

      curl -X PUT " localhost:9200/liferay-20157/_settings?pretty" -H 'Content-Type: application/json' -d'
        "index" : {
          "auto_expand_replicas" : "0-all"

      In LPS-108361 and LPS-114158 we updated the default index settings of the Search Tuning and Workflow Metrics indexes to have

      index.auto_expand_replicas: 0-all


      For consistency, we should apply the same setting on the company indexes as well, in order to create replica shards in every index.

      This lack of replicas has caused several issues in the Liferay DXP Cloud deploys, when they lost the content of some Elasticsearch nodes during an intervention.

      Verification: follow the steps of LPS-114158 and look for the index names like "liferay-0" and "liferay-<companyId>" in the response and check the number of replicas.

      Reproduction Steps:

      1. Start up 3 Elasticsearch nodes (the test must be done with both 6.x and 7.x ElasticSearch versions)
        1. Edit
          cluster.name: LiferayElasticsearchCluster
          discovery.zen.minimum_master_nodes: 2
          node.max_local_storage_nodes: 3
        2. Start the same Elasticsearch from 3 terminals (./bin/elasticsearch): this will create a 3-node cluster using a single installation, suitable for testing
      2. Start up Liferay 7.1.x or 7.2.x
      3. Go to Control Panel -> Configuration -> System Settings -> Search -> Elasticsearch 6
        1. Specify all the 3 transport addresses: localhost:9300, localhost:9301, localhost:9302
        2. Configure it to be Remote
      4. Go to Control Panel -> Configuration -> Search and confirm it is not using Embedded nodes
      5. Reindex all Search Indexes
      6. Open a terminal and run
        curl -X GET "localhost:9200/_cat/indices/*?v&s=index&pretty"

        Expected Result: all the indexes have at least 1 replica
        Actual Result: company indexes ("liferay-0" and "liferay-<companyId>") have no replicas.


        Issue Links



              brooke.dalton Brooke Dalton
              tibor.lipusz Tibor Lipusz
              Kiyoshi Lee Kiyoshi Lee
              Tibor Lipusz Tibor Lipusz
              0 Vote for this issue
              4 Start watching this issue


                1 year, 40 weeks, 3 days ago
                Development End Date:
                Development Start Date:


                  Version Package
                  7.1.10 DXP FP23
                  7.2.10 DXP FP11
         DXP SP4