Removing shards

Hello,

It is possible through the API to remove 3 shards to all existing index?
Don't care if data will be lost.

Thank you.

You can change the number of replicas per index dynamically but not the number of primary shards, which must be set on index creation.

To change the number of primary shards you can create a new index with the same mapping as the old but with 3 less primary shards and then use the Reindex API to copy the data from the old to the new index:

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html

1 Like

Ok, that's what I supposed.
I will purge all index and recreate them with less shards.

Thank you :).

If you are on Elasticsearch 5.x you can also use the shrink index API.

Perfect!
Exactly what I want :slight_smile:

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