I'm running a small test installation and I would like to disable replicas. I was able to set the number of replicas to 0 for all existing indexes/shards, using /_settings, but newly created indexes have the old default value of 1. How can I change this value for new indexes also?
Not unless one is created by default on installation.
Update: I checked, as far as I can tell the answer is no. There is a template that applies to the indexes being created (we're talking about logstash here), but it doesn't include a replica setting.
For your own testing environment, if you prefer to have 0 replicas for all indices then set it in the elasticsearch.yml file and restart ES. You can also set the number of shards in this file too.
For other cases, I suggest to create a template for each index so you can control both the number of shards and replicas before creating a new index. In the template, you can also set the alias so that all related time series indices can have the same prefix and are also a part of an alias. Just load the template once.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.