Help Center/ Cloud Search Service/ FAQs/ Using CSS Cluster Search Engines/ How Do I Change the Number of Replicas for Elasticsearch Indexes in CSS?
Updated on 2025-09-04 GMT+08:00

How Do I Change the Number of Replicas for Elasticsearch Indexes in CSS?

When creating an index for an Elasticsearch cluster, you can specify the number of shards, that is, the number of primary shards. Once an index is created, the number of primary shards cannot be changed, but the number of replicas can be changed. Number of replica shards = Number of primary shards x Number of replicas.

  1. Log in to Kibana and go to the command execution page. Elasticsearch clusters support multiple access methods. This topic uses Kibana as an example to describe the operation procedures.
    1. Log in to the CSS management console.
    2. In the navigation pane on the left, choose Clusters > Elasticsearch.
    3. In the cluster list, find the target cluster, and click Kibana in the Operation column to log in to the Kibana console.
    4. In the left navigation pane, choose Dev Tools.
  2. On the Kibana console, run the following command to check the number of replicas for each Elasticsearch index:
    GET _cat/indices?v
    Figure 1 Checking the number of replicas
  3. Run the following command to configure the number of index replicas:
    PUT /indexname/_settings
    {
      "number_of_replicas" :1       //Number of replicas
    }

    indexname indicates the name of the index to be modified, and number_of_replicas indicates the number of replicas to be set.