简体   繁体   English

在单个主机上运行多节点Elasticsearch集群是否有意义?

[英]Does it make sense to run multinode Elasticsearch cluster on a single host?

What do I get by running multiple nodes on a single host? 通过在单个主机上运行多个节点可以得到什么? I am not getting availability, because if the host is down, the whole cluster goes with it. 我无法获得可用性,因为如果主机关闭,则整个群集都将随之运行。 Does it make sense regarding performance? 关于性能有意义吗? Doesn't one instance of ES take as many resources from the host as it needs? 一个ES实例不是从主机获取了所需数量的资源吗?

It depends on your host and how you configure your nodes. 这取决于您的主机以及如何配置节点。

For example, Elastic recommends allocating up to 32GB of RAM (because of how Java compresses pointers) to elasticsearch and have another 32GB for the operating system (mostly for disk caching). 例如,Elastic建议为Elasticsearch分配最多32GB的RAM(由于Java压缩指针的方式),并为操作系统分配32GB的内存(主要用于磁盘缓存)。

Assuming you have more than 64GB of ram on your host, let's say 128, it makes sense to have two nodes running on the same machine, having both configured to 32GB ram each and leaving another 64 for the operating system. 假设主机上有超过64GB的内存,比如说128,则在同一台计算机上运行两个节点是有意义的,两个节点都配置为32GB内存,并为操作系统保留另外64个内存。

Generally no, but if you have machines with ridiculous amounts of CPU and memory, you might want that to properly utilize the available resources. 通常不行,但是如果您的计算机上的CPU和内存数量非常可观,则可能希望它们适当地利用可用资源。 Avoiding big heaps with Elasticsearch is a good thing generally since garbage collection on bigger heaps can become a problem and in any case above 32 GB you lose the benefit of pointer compression. 使用Elasticsearch避免大堆通常是一件好事,因为在大堆上进行垃圾回收可能会成为问题,并且无论如何在32 GB以上的情况下,您都会失去指针压缩的好处。 Mostly you should not need big heaps with ES. 大多数情况下,ES不需要大堆。 Most of the memory that ES uses is through memory mapped files, which relies on the OS cache. ES使用的大部分内存是通过内存映射文件来完成的,而这些文件依赖于OS缓存。 So just because you aren't assigning memory to the heap doesn't mean it is not being used: more memory available for caching means you'll be able to handle bigger shards or more shards. 因此,仅因为您没有为堆分配内存并不意味着它没有被使用:更多可用于缓存的内存意味着您将能够处理更大的碎片或更多的碎片。

So if you run more nodes, that advantage goes away and you waste memory on redundant heaps, and you'll have nodes competing for resources. 因此,如果您运行更多的节点,则该优势将消失,您将内存浪费在冗余堆上,并且节点将争夺资源。 Mostly, you should base these decisions on actual memory, cache, and cpu usage of course. 通常,您当然应该根据实际内存,缓存和cpu的使用情况来做出这些决定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在单个服务器上运行 Kubernetes 有意义吗? - Does it make sense to run Kubernetes on a single server? 在具有自己的 apache 服务器的主机上运行 apache Docker 容器是否有意义? - Does it make any sense to run an apache Docker container on a host with it's own apache server? 负载均衡在单个硬件服务器上是否有意义? - Does load balancing make sense on a single hardware server? 为什么要在单个 docker 主机上运行多个 elasticsearch 节点? - Why should I run multiple elasticsearch nodes on a single docker host? 通过docker运行Java服务器有意义吗? - Does it make sense to run a java server via docker? 在一个容器中运行多个类似的进程有意义吗? - Does it make sense to run multiple similar processes in a container? 在 docker 中运行 c# 工作服务是否有意义? - Does it make sense to run a c# worker service in docker? 在具有绑定安装的docker容器中使用ionice运行命令是否有意义 - Does it make sense to run a command with ionice in docker container with a bind mount 如果将使用像 Kubernetes 这样的编排工具进行部署,那么集群 NodeJs(为了利用多个 CPU)是否有意义? - Does it make sense to cluster NodeJs (in order to take advantage of multiple CPUs) if will be deployed with orchestration tool like Kubernetes? 在Dockerfile中重启是否有意义? - Does a restart in a Dockerfile make sense?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM