【问题标题】:Elasticsearch what are the formulas to calculate total shardsElasticsearch计算总分片的公式是什么
【发布时间】:2021-01-23 02:54:17
【问题描述】:

我是 Elasticsearch 的新手,我发现计算总分片的标准方法是 总分片=主要 * (1+副本)

所以在这个例子中

PUT /my_index/_settings
{
  "number_of_shards": 3,
  "number_of_replicas": 2
}

答案是 9。

total shards=primary * (1+replicas)
9=3 * (1+2)

我可以知道,或者我也可以使用下面的公式,因为它给出的答案与 9 相同吗?

total shards= number_of_shards + (number_of_shards * number_of_replicas)

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    这是一道数学题,与ES无关。

    primary * (1 + replica) = primary + (primary * replica)
    

    【讨论】:

    • 你的回答并没有澄清我的疑问,但还是谢谢你。
    • 是否还有其他熟悉该工具的人,请分享想法。谢谢。
    • @SahilGupta 是对的,你给出的两个方程完全一样,即a * (1 + b) ≡ (a * 1) + (a * b) ≡ a + (a * b),凭借distributivity
    • @Val 谢谢你,SahilGupta 也谢谢你,我也接受了你的回答。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-11-03
    • 1970-01-01
    • 2022-06-17
    • 1970-01-01
    • 1970-01-01
    • 2011-11-01
    • 1970-01-01
    相关资源
    最近更新 更多