Elasticsearch Recovery



Elasticsearch Recovery

Opster Team

July 2020, Version: 1.7-7.9


Before you begin reading the explanation below, try running the free Elasticsearch Health Check-Up get actionable recommendations that can improve Elasticsearch performance and prevent serious incidents. Just 2 minutes to complete and you can check threadpools, memory, snapshots and many more.

Recovery in Elasticsearch

What it is

In Elasticsearch, recovery refers to the process of recovering an index/shard when something goes wrong. You can recover an index/shards in many ways such as by re-indexing the data from a  backup/failover cluster to the current one or by restoring from an Elasticsearch snapshot. Alternatively, Elasticsearch may be performing recoveries automatically in some cases, such as when a node restarts or when a node disconnects and connects again. There is an API to check the updated status of index/shard recoveries.

GET /<index>/_recoveryGET /_recovery

In summary, recovery can happen in the following situations:

  • Node startup or failure ( local store recovery )
  • Replication of Primary shards to replica shards
  • Relocation of a shard to a different node in the same cluster
  • Restoring a Snapshot
Examples:

Getting recovery information about several indices:

GET my_index1,my_index2/_recovery
Common Problems Related to Recovery Settings
  • When a node is disconnected from the cluster, all of its shards go to an unassigned state. After a certain time, the shards will be allocated somewhere else on other nodes. This setting determines the number of concurrent shards per node that will be recovered.
PUT _cluster/settings{  "transient" :  {     "cluster.routing.allocation.node_concurrent_recoveries" : 3 }}
  • You can also control when to start recovery after a node disconnects. ( This is useful if the node just restarts, for example, because you may not want to initiate any recovery for such transient events )
PUT _all/_settings{  "settings": {    "index.unassigned.node_left.delayed_timeout": "6m"  }}
  • Elasticsearch limits the speed that is allocated to recovery in order to avoid overloading the cluster. This setting can be updated to make the recovery faster or slower, depending on your requirements.
PUT _cluster/settings{  "transient" :  {     "indices.recovery.max_bytes_per_sec" : "100mb"}}

Related log errors to this ES concept


Error while listing local files; recovering as if there are none
Error while reading global checkpoint from translog;
Unexpected error while monitoring recovery
Delaying initial state recovery for .
Recovery failed
Unexpected error during recovery ; failing shard
Ignoring recovery of a corrupt translog entry
Snapshot differs from actual index for file: meta:
Remote file corruption on node ; recovering . local checksum OK
Releasing snapshot caused exception
Corrupted file detected checksum mismatch
Close engine failed

< Page: 1 of 4 >




Improve ES Configuration

Try The Tool