【问题标题】:How to check progress of ElasticSearch's Reindex API如何检查 ElasticSearch 的 Reindex API 的进度
【发布时间】:2021-03-10 04:32:16
【问题描述】:

我正在尝试通过 Reindex API 从远程 ES 2.4 集群执行重新索引操作。哪个工作是将超过 1 亿个索引文档传输到最新版本的 elasticsearch。

对于测试用例,我正在小数据集上尝试,但我面临以下问题。

问题:

  1. 我看不到有多少文档的脚本进度 转移了,还有多少。

  2. 如果失败,我该如何恢复脚本而不是 从 0 重新开始。

【问题讨论】:

    标签: elasticsearch logstash elastic-stack reindex


    【解决方案1】:

    您可以使用Task management API 了解reindex 的状态,正如official doc of reindex API 中所建议的那样。来自同一个文档

    如果请求包含wait_for_completion=false,Elasticsearch 执行一些预检检查,启动请求,然后返回一个 您可以用来取消或获取任务状态的任务。 Elasticsearch 在以下位置创建此任务的记录作为文档 .tasks/_doc/${taskId}。当你完成一项任务时,你应该 删除任务文档,以便 Elasticsearch 可以回收空间。

    【讨论】:

    • 感谢您的快速回复。但它也处理第二种情况吗?如果在任何时候发生故障,剩余的文档可以恢复或需要再次从 0 执行?
    • @WaqasAfzal 并非您可以处理的所有错误,请参阅 reindex API 的 error 部分了解更多信息,(array) Array of failures if there were any unrecoverable errors during the process. If this is non-empty then the request aborted because of those failures. Reindex is implemented using batches and any failure causes the entire process to abort but all failures in the current batch are collected into the array. You can use the conflicts option to prevent reindex from aborting on version conflicts.
    • @WaqasAfzal 你也可以看看 Kiabana 升级助手 API elastic.co/guide/en/kibana/current/start-resume-reindex.html 但这处于实验阶段,但它是基本许可证的一部分
    • 我不认为 kibana reindex api 允许从远程 ES 2.4 集群重新索引。
    • @WaqasAfzal 是的,版本太旧了 :),如果有用,请不要忘记投票并接受答案,提前致谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-09
    • 2020-12-14
    • 2020-01-05
    相关资源
    最近更新 更多