0

In elasticsearch v1.x I could set index.number_of_replicas statically (in the elasticsearch.yml file):

# Set the number of replicas (additional copies) of an index (1 by default):
index.number_of_replicas: 0

However, I am now putting together the config files for v2.3 and this setting no longer has any effect.

For example, if I add the above code to the elasticsearch.yml file and fire up ES v2.3, the Marvel indices are still automatically created with number_of_replicas: 1. It also isn't listed with the static settings in the docs.

Has it changed since v1.x, or am I doing something wrong? Can this only be done via the dynamic settings now?

Owen
  • 47
  • 1
  • 7

1 Answers1

1

That static setting still works in 2.3. You can try by simply creating a new index without specifying any settings:

PUT /test/test/1

In the logs, you'll see something like:

[2016-05-30 05:49:45,836][INFO ][cluster.metadata         ] [dev-node-1] [test] creating index, cause [auto(index api)], templates [], shards [2]/[0], mappings [test]

[2]/[0] means that by default I've set two primary shards and 0 replicas shards to be created.

If you see replica shards in your Marvel indices, it's because there must be a .marvel-es template which specifies different index settings.

Val
  • 207,596
  • 13
  • 358
  • 360