Setting number_of_replicas value to 0 makes the cluster unavailable

I've installed elasticsearch 5.4 and kibana 5.4 on a single node cluster. after creating index, my shard status went to yellow. So, I thought to edit the number_of_replicas value in elasticsearch.yml to "0". Then I am getting following error:

    [2018-11-01T17:01:10,966][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [es-node01] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [number_of_replicas] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

You need to do that via the API, it is no longer a setting in the config file.

Can you please provide me with the required API call?

curl -H "Content-Type: application/json" -XPUT localhost:9200/*/_settings -d '{ "index" : { "number_of_replicas" : 0 } }'

You can also update your templates to use no replicas.

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