1
votes

i have 3 node elasticsearch cluster and i have index with 1 primary and 1 replica shards so i want to change the primary shard number from 1 to 2 using this method https://www.elastic.co/guide/en/elasticsearch/reference/7.9/indices-split-index.html but in the doc said that

The number of primary shards in the target index must be a multiple of the number of primary shards in the source index

but in my case 1 * 1 = 1 so how can i do resize from 1 primary shards to 2 primary shards correctly?

1

1 Answers

0
votes

The incremental resharding is not allowed in elasticsearch. So, if you want to increase the number of primary shards from 1 to 2 is impossible. However, you have two options to reach this goal:

  • Split your index to 4 using this API and then Shrink it to index with 2 primary shards using this api link
  • Create a new index with two primary shards and reindex your data to this index using this API link.

I suggest you the second option.