Changing number of replicas

Hi, I am trying to reindex huge index using reindex api. It fails everytime. Now, I am thinking if I can initially make the number of replica to 0 and later to 1. Is it possible with my case? How do I do it?
Do I set the replica to 0 at the time of setting mapping for new index? And when and how to make it back to 1 later?

1 Like

HI @zatom

You can change the replica of an index dynamically by firing the query from Kibana.
Since you are reindexing huge data it is advisable you set replica to 0. Once you create the index, use the

PUT indexname/_settings {"number_of_replica":0}

to set replica as 0 for the index. Once you are done with indexing, replace 0 with 1.
Also, it is advisable that you disable refresh during the bulk indexing so that you get maximum throughput. Once done, you can set refresh interval to whatever time is acceptable to you.
Keep an eye on Heap usage as well as Bulk Thread Pool for data nodes.

3 Likes

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