Reindexing by changing the replicas to 0

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

Describe the issue: I am trying to reindex my data. I have about docs.count= 6245071, store.size=1.2TB and pri.store.size=429.3gb.

I am trying to create a new index with a different mapping(shards). I read this on the documentation to disable replicas in the destination index by setting number_of_replicas to 0 and re-enable them once the reindex process is complete.

I tried to do this in my PUT command while creating the index. But I am getting am error below:
{
“error”: {
“root_cause”: [
{
“type”: “illegal_argument_exception”,
“reason”: “Validation Failed: 1: expected total copies needs to be a multiple of total awareness attributes [3];”
}
],
“type”: “illegal_argument_exception”,
“reason”: “Validation Failed: 1: expected total copies needs to be a multiple of total awareness attributes [3];”
},
“status”: 400
}

How to make changes to avoid this error?

Configuration: Opensearch version 2.17.0

Relevant Logs or Screenshots:

Hi @Lah ,

This issue looks to be due to your configuration having zones configured. If you run a GET /_cluster/settings you should see cluster.routing.allocation.awareness.attributes and cluster.routing.allocation.awareness.force.zone.values.

You could temporarily remove the awareness attribute by setting it to null to create the new index with 0 replicas. Then you could set it back to the value from before after you’re done to re-enable the setting that is currently blocking you.

Leeroy.

1 Like