gpt4 book ai didi

amazon-web-services - 如何在快照中查找 Elasticsearch 索引?

转载 作者:行者123 更新时间:2023-12-02 22:42:51 32 4
gpt4 key购买 nike

我有一个在 AWS 上运行的 Elasticsearch 集群,我有这样的快照

 {
"snapshot": "2016-07-13_165430",
"indices": [
"analytical-2016-06-15",
"analytical_2016-06-13",
"analytical_2016-07-13",
"operational-2016-06-15",
"operational_2016-06-13",
"operational_2016-07-13"
],
"state": "SUCCESS",
"start_time": "2016-10-10T23:54:33.705Z",
"start_time_in_millis": 1476143673705,
"end_time": "2016-10-10T23:54:44.893Z",
"end_time_in_millis": 1476143684893,
"duration_in_millis": 11188,
"failures": [],
"shards": {
"total": 30,
"failed": 0,
"successful": 30
}
},
{
"snapshot": "2016-07-13_165546",
"indices": [
"analytical-2016-06-15",
"analytical_2016-06-13",
"analytical_2016-07-13",
"operational-2016-06-15",
"operational_2016-06-13",
"operational_2016-07-13"
],
"state": "SUCCESS",
"start_time": "2016-10-10T23:55:48.808Z",
"start_time_in_millis": 1476143748808,
"end_time": "2016-10-10T23:55:52.420Z",
"end_time_in_millis": 1476143752420,
"duration_in_millis": 3612,
"failures": [],
"shards": {
"total": 30,
"failed": 0,
"successful": 30
}
}

现在所有这些指数都与其他一些指数在线运行,例如:“分析-2016-06-15”,
"analytical_2016-06-13",
"analytical_2016-07-13",
“操作-2016-06-15”,
"operational_2016-06-13",
"operational_2016-07-13"
"operational_2016-09-13"
....

我需要检查我的索引是否已备份,如果已经备份,它存在于哪个快照中。

最佳答案

我怀疑@air 对查找 许多 快照中的哪些包含给定索引感兴趣;粘贴的示例只是快照历史记录的一个 View 。如果您在一段时间内拍摄每日快照,并且已添加/删除索引,手动搜索将是一件苦差事。

似乎没有用于“查找包含索引 operational_2021-06-10 的所有快照”的 API 调用,但这里有一个自动化选项:

 curl -XGET "http://cluster:9200/_snapshot/myrepo/*" |
jq -c '.snapshots[] | select(.indices | index("operational_2021-06-10")) | { snapshot }'

{"snapshot":"daily-snap-2021.06.10-hjmskkjsryyq82asmxiuva"}
{"snapshot":"daily-snap-2021.06.11-eayyiiort0cx97r_jscara"}
{"snapshot":"daily-snap-2021.06.12-rmrsbmsespgf0_czu721hw"}
{"snapshot":"daily-snap-2021.06.13-meeoachori61w5r3n3qzaq"}
{"snapshot":"daily-snap-2021.06.14-espbnhuprcckqylk3xltwq"}
{"snapshot":"daily-snap-2021.06.15-sbosayasthinaudxaqw3pa"}

关于amazon-web-services - 如何在快照中查找 Elasticsearch 索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39968861/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com