簡體   English   中英

遷移數百萬文檔時,使用 elasticcluster 的遠程重建索引 API 的最佳方法是什么?

[英]What is the best approach to use remote reindexing API of elasticcluster when migration millions of documents?

我有大約。 索引中有 1 億個文檔,我想使用 reindex API 將其遷移到新集群。我想以節流方式進行。

我嘗試使用request_per_seconds100000 ,但完成整個過程需要幾個小時。 Q.1 我可以使用request_per_seconds1000000來減少處理時間嗎? Q.2 是否有更好的方法可以用於以節流方式更好地重建索引?

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM