收缩索引_拆分索引 未完


The shrink index API allows you to shrink an existing index into a new index with fewer primary shards. The requested number of primary shards in the target index must be a factor of the number of shards in the source index.

For example an index with 8 primary shards can be shrunk into 4, 2 or 1 primary shards or an index with 15 primary shards can be shrunk into 5, 3 or 1. If the number of shards in the index is a prime number it can only be shrunk into a single primary shard. Before shrinking, a (primary or replica) copy of every shard in the index must be present on the same node.

Shrinking works as follows:

  • First, it creates a new target index with the same definition as the source index, but with a smaller number of primary shards.
  • 第一,创建一个新的目标索引,其定义与源索引一致,但是分片比主分片要少。
  • Then it hard-links segments from the source index into the target index. (If the file system doesn’t support hard-linking, then all segments are copied into the new index, which is a much more time consuming process.)
  • 然后,硬链接源索引的段到目标索引
  • Finally, it recovers the target index as though it were a closed index which had just been re-opened.
  • 最后,恢复目标索引,就好像他是一个关闭的索引被重新打开

优质内容筛选与推荐>>
1、Java学习:集合的使用与数组的区别
2、美国是否“登月”
3、arm步骤
4、学会自律系列总结
5、IT人必读:献给某些浮躁的IT同仁或者和我一样的菜鸟们,请不要浮躁


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号