Elasticsearch计算总碎片的公式是什么 [英] Elasticsearch what are the formulas to calculate total shards

查看:81
本文介绍了Elasticsearch计算总碎片的公式是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am new to Elasticsearch and I found out the standard way to calculate total shards is total shards=primary * (1+replicas)

所以在这个例子中

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

答案为9.

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

我是否可以替代地使用下面的公式,因为它给出的答案与9相同?

May I know that alternatively can I use below formula too since it gives the same answer as 9?

total shards= number_of_shards + (number_of_shards * number_of_replicas)

推荐答案

这是一个数学问题,与ES无关.

This is a math question and has nothing to do with ES.

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

这篇关于Elasticsearch计算总碎片的公式是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆