Difference between expected_nodes and recover_after_nodes

I do not see the difference between the two parameters of the recovery phase of the gateway module.

In the documentation:

  • The gateway.recover_after_nodes parameter (which takes a number) controls after the number (...) of restored nodes (...) starts .

  • gateway.expected_nodes allows gateway.expected_nodes to set the number of pending (<...>) matching nodes in the cluster, and after execution, (...) recovery begins

From what I understand, these two settings start the recovery phase as soon as the number of node is equal to the set value.

Why use one over the other?

And what's the point of using both of them?

For example:

 gateway: recover_after_nodes: 3 expected_nodes: 5 

In this case, what is the purpose of expected_nodes ? recovery will be called as soon as there are 3 nodes. He must have another reason.

I hope my question is clear enough.

Thanks in advance!

+8
elasticsearch
source share
2 answers

When using restore_after_nodes, recover_after_data_nodes or recovery_after_master_nodes, after all the specified conditions are fulfilled, the cluster will wait for recover_after_time before starting recovery:

The gateway.recover_after_time parameter (which takes a time value) sets the timeout until recovery occurs gateway.recover_after ... the conditions are met.

When using expected_nodes, expected_data_nodes or expect_master nodes, recovery will begin after all conditions are met - the cluster will not wait. In addition, it will also default recovery_after_time to 5 minutes.

In your test case:

 gateway: recover_after_nodes: 3 expected_nodes: 5 

As soon as you click 3 nodes, the countdown will begin and the cluster will recover either after 5 minutes (default), or if you click 5 nodes. Basically, this allows you to set a minimum threshold (recovery_after_nodes) with a timeout (recovery_after_time) to wait for the desired state (expected_nodes). You will either restore recovery_after_time after recovery__fter_nodes is called, or when expected_nodes is expected (without any additional wait) - whichever comes first.

+10
source share

from an open document there are misunderstandings in these flows.

http://www.elastic.co/guide/en/elasticsearch/reference/1.x/modules-gateway.html

 gateway: recover_after_time: 5m expected_nodes: 2 

In the expected 2-node cluster, recovery will begin 5 minutes after the first node has risen, but as soon as the cluster has 2 nodes, recovery will begin immediately (without waiting).

therefore, the timer defined by restore_after_time will start after the first node is started. do not start after finding the nodes defined in restore_after_nodes

0
source share

All Articles