I need help with changing the number of shards. I got basically default settings, ELK stack 5.4.
Already had some indexes, but had 5 shards. Would like to change to two.
I deleted existing indexes (not the system indices) and would like to change the number of shards before i add new indices.
and also like that:
curl -XPUT 'localhost:9200/_all/_settings?preserve_existing=true' -d '{
"index.number_of_shards" : "2"
}'
Also no success, i think. -> ,"reason":"Can't update non dynamic settings [[index.number_of_shards]] for open indices. Does this mean that new indices will have the changed setting?
Probaby doing something trivial wrong, but currently i'm kind of stuck.
Just to avoid confusion: The index template is only used when you create a new index. This will not change the number of shards for existing indices. You will have to use the shrink API, which Luca suggested, for that (or do a reindex, but that's even worse for reducing the number of shards).
And if you have 5 shards right now, you can only shrink down to 1 shard, since shrinking is always a factor. Prime numbers don't give you many options there unfortunately.
If you have set the template up correctly and the pattern matches, creating a new index will apply the pattern. I'm a bit confused by the question. Have you tried it out?
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.