在迁移数百万文档时,使用elasticcluster的远程重新索引API的最佳方法是什么?

问题描述 投票:0回答:2

我有大约。索引中有 1 亿个文档,我想使用 reindex API 将其迁移到新集群。我想以节流的方式来做。

我尝试使用request_per_seconds100000,但完成整个过程需要几个小时。 Q.1 我可以使用 request_per_seconds1000000 来减少处理时间吗? Q.2 有没有更好的方法可以用来以节流方式更好地重新索引?

amazon-web-services elasticsearch system-design reindex
2个回答
0
投票

Reindex 支持切片滚动以并行化重新索引过程。这种并行化可以提高效率并提供一种便捷的方法将请求分解为更小的部分。

POST _reindex?slices=5&refresh
{
  "source": {
    "index": "my-index-000001"
  },
  "dest": {
    "index": "my-new-index-000001"
  }
}

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-automatic-slice

您还可以阅读有关优化速度的建议,例如:

  • 在那段时间禁用刷新
  • 将副本数减少到0 等等..

链接:

https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-indexing-speed.html


0
投票

我没有足够的声誉来发表评论,因此将其添加为答案。

@llermaly,根据我根据 reindex 文档 收集的信息,“从远程集群重新索引不支持手动或自动切片。”

那么,这个问题有答案了吗?就连我也有类似的要求。

© www.soinside.com 2019 - 2024. All rights reserved.