ElasticSearch - 每个节点的最小碎片数 [英] ElasticSearch - Optimal number of Shards per node

查看:352
本文介绍了ElasticSearch - 每个节点的最小碎片数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人可以为每个ES节点提供最佳数量的碎片,以获得最佳性能,或者提供任何推荐的方式来获得碎片的数量,给定核心数量和记忆足迹印刷。 >

解决方案

在分片之前有三种条件你想要考虑。



情况1) 您希望使用具有故障转移和高可用性的弹性搜索。然后你去分片。
在这种情况下,您需要根据要在生产中使用的节点数[ES实例]选择数量的分片。



3个生产节点。那么您需要为每个索引选择1个主分片和2个副本。如果您选择比您需要更多的碎片。



情况2) 您当前的服务器将保存当前数据。但是由于动态数据增加,您可能会在磁盘上没有空间,或者您的服务器无法处理大量数据的方式,那么您需要配置更多的没有碎片,如2或3个分片(它符合您的要求)。但是不应该有任何副本。



情况3) 在这种情况下,情况1 &安培;那么你需要组合两个配置。考虑您的数据动态增加,还需要高可用性和故障转移。然后,您使用2个分片和1个副本配置索引。然后,您可以在节点之间共享数据并获得最佳性能!!



注意: 然后查询将在每个分片中处理并对所有分片的结果执行mapreduce,并将结果返回给我们。所以地图缩减过程是昂贵的过程。最小碎片给我们提供最佳性能



如果在生产中只使用一个节点,那么每个索引只有一个主碎片是最优的碎片。 / p>

希望它有帮助..!


I would appreciate if someone could suggest the optimal number of shards per ES node for optimal performance or provide any recommended way to arrive at the number of shards one should use, given the number of cores and memory foot print.

解决方案

There are three condition you consider before sharding..

Situation 1) You want to use elasticsearch with failover and high availability. Then you go for sharding. In this case, you need to select number of shards according to number of nodes[ES instance] you want to use in production.

Consider you wanna give 3 nodes in production. Then you need to choose 1 primary shard and 2 replicas for every index. If you choose more shards than you need.

Situation 2) Your current server will hold the current data. But due to dynamic data increase future you may end up with no space on disk or your server cannot handle much data means, then you need to configure more no of shards like 2 or 3 shards (its up to your requirements) for each index. But there shouldn't any replica.

Situation 3) In this situation you the combined situation of situation 1 & 2. then you need to combine both configuration. Consider your data increased dynamically and also you need high availability and failover. Then you configure a index with 2 shards and 1 replica. Then you can share data among nodes and get an optimal performance..!

Note: Then query will be processed in each shard and perform mapreduce on results from all shards and return the result to us. So the map reduce process is expensive process. Minimum shards gives us optimal performance

If you are using only one node in production then, only one primary shards is optimal no of shards for each index.

Hope it helps..!

这篇关于ElasticSearch - 每个节点的最小碎片数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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