Setting default number of replicas for new indexes?

addidng index.number_of_replicas: 0 to /etc/elasticsearch/elasticsearch.yml doesn't work. With this option elasticsearch doesn't start.
at the log i see
fatal exception while booting Elasticsearch java.lang.IllegalArgumentException: node settings must not contain any index level settings

You need to do this through an index template.

With this ?
{"number_of_replicas":0}

I think i can use

{
"index": {
"lifecycle": {
"name": "logstash-policy",
"rollover_alias": "actions-logs"
},
"number_of_replicas": "0"
}
}

Hi,

If you want to set the number of replicas for an index, you have a few options:

  1. You can specify it when you create the index:
PUT /my-index-000001
{
  "settings": {
    "number_of_replicas": 0
  }
}
  1. You can update it for an existing index:
PUT /my-index-000001/_settings
{
  "number_of_replicas": 0
}

Regards

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.