简体   繁体   English

Elasticsearch 从快照恢复单个索引

[英]Elasticsearch restore single index from snapshot

Before I go an do something stupid, can I double check something with other Elastic users:在我去做一些愚蠢的事情之前,我可以与其他 Elastic 用户仔细检查一下吗:

My cluster has 2000+ indexes.我的集群有 2000 多个索引。 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.如果我选择要恢复的那个索引,我只是想确保我最终不会得到一个只有那个索引而我的另一个 1999+ 丢失的集群。

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.我想会发生相反的情况,1999+ 将保持原样,只会恢复那个,但我需要在我开始之前确定。

I'm using Elastic Cloud if it has any bearing on things.如果 Elastic Cloud 对事物有任何影响,我将使用它。

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可以通过在恢复请求正文中使用索引和 include_global_state 选项来选择应该恢复的索引以及允许恢复全局集群状态

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.当您从 elasticsearch 快照恢复单个索引时,只会恢复单个索引,其余索引将保持不变。

You can restore single index from elasticsearch snapshot using below command:您可以使用以下命令从 elasticsearch 快照恢复单个索引:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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