简体   繁体   中英

Elasticsearch restore single index from snapshot

Before I go an do something stupid, can I double check something with other Elastic users:

My cluster has 2000+ indexes. I've messed up just one of them and need to restore it from a snapshot. If I select that one index to restore, I just want to be sure I'm not going to end up with a cluster with just that index and my other 1999+ missing.

I would imagine the opposite will happen, the 1999+ will remain untouched and just that one will be restored, but I need to be sure before I hit go.

I'm using Elastic Cloud if it has any bearing on things.

According to documentation

By default, all indices in the snapshot are restored, and the cluster state is not restored. It's possible to select indices that should be restored as well as to allow the global cluster state from being restored by using indices and include_global_state options in the restore request body

So with the good restore query it will run smoothly and only restore the missing index.

When you restore single index from elasticsearch snapshot, then only the single index will be restored and rest of the indices will remain untouched.

You can restore single index from elasticsearch snapshot using below command:

curl -X POST "<es_endpoint>/_snapshot/<repository_name>/<snapshot_name>/_restore?pretty" -H 'Content-Type: application/json' -d'
{
  "indices": "<index_to_restore>",
}
'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM