Force replication

Hi there!

I started a new fresh Elasticsearch (7.9) cluster with sample flights data.

If I look up for the "number_of_replicas" setting of this index, I get 1. And, if I try to use the cat/shards API, I see one primary replicas one of my nodes and the other replica on other node.

Now, I want to modify the number_of_replicas from 1 to 2. When I do so, everything seems fine but I was excepting, into the /cat/shards API, to see a new replica and it's not the case.

Did I misunderstood the concept of replicas? Or maybe there is some time between the change of parameter and the moment the data is actually replicated?

Best regards,

You can never have more than one copy of a shard (primary/replica) per node so it will depend on the number of data nodes you have in the cluster.

I have 4 data nodes in my cluster

Can you share the output and how you changed the setting?

Thanks for the idea!!

The problem was the command I used to change the number of replicas

Instead of :

PUT /kibana_sample_data_ecommerce/_settings
{
"index" : {
"number_of_replicas" : 2
}
}

I had to use:

PUT /kibana_sample_data_ecommerce/_settings
{
"index" : {
"number_of_replicas" : 2,
"auto_expand_replicas": false
}
}

Now it's better!

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