How to increase or decrease replica in Elasticsearch

You can change number of replicas in live Elasticsearch Cluster using Indices APIs update indices settings.

Update number of replicas for all indices:

curl -XPUT 'localhost:9200/_settings' -d '
    {
        "index" : {
            "number_of_replicas" : 2
        }
    }'

Update number of replicas for a single index or multiple indices:
Specify the comma separated index name to change replica for particular indices

curl -XPUT 'localhost:9200/index_name/_settings' -d '
    {
        "index" : {
            "number_of_replicas" : 2
        }
    }'
(Visited 2,127 times, 55 visits today)