如何在Windows中为ElasticSearch设置内存限制? [英] How to set memory limit to ElasticSearch in Windows?
问题描述
是否有可能限制Windows Server 2008 R2上的ElasticSearch工作集内存?
Is there any possible to limit ElasticSearch working set memory on a windows server 2008 R2?
我尝试了所有在线操作,但似乎无济于事。
I tried everything online, but nothing seem to work.
尝试设置(环境变量):
ES_MIN_MEM
ES_MAX_MEM
ES_HEAP_SIZE
Tried to set (environment vars): ES_MIN_MEM ES_MAX_MEM ES_HEAP_SIZE
在Java服务:
-Xms15g
-Xmx15g
-Xss256k
In the java service: -Xms15g -Xmx15g -Xss256k
在YML文件中:
bootstrap.mlockall:是
In the YML file: bootstrap.mlockall: true
任何想法我在做什么错,或者是否有可能完全限制Windows服务中的RAM?
Any idea what am I doing wrong, or if its possible at all to limit RAM in a Windows service?
谢谢!
推荐答案
您可以通过以下命令在Windows Server上设置Elastic Search的内存限制:
You can set the memory limit for Elastic Search on Windows Server by following command:
[Elasticsearch Path]\bin>elasticsearch-service.bat manager
注意:以管理员身份运行命令提示符
Note: Run command prompt as administrator
它将打开管理器,如下所示:图片:ElasticSearch服务属性ies
It will open manager as shown here: Image: ElasticSearch service properties
现在转到 Java标签并根据您的要求更改设置。
Now go to the 'Java' tab and change settings based on your requirement.
注意:确保已在 JavaOptions文本框以及单独的参数下进行了更改。例如,要设置1GB的初始内存池和最大内存池,您可以同时设置 1024 MB。
Note: Make sure, you changed it under 'JavaOptions' textbox and also for separate parameters. For example, to set 1GB initial memory pool and maximum memory pool, you can set '1024' MB for both.
安装服务后,才能使用此管理器。有关更多详细信息,请参阅此链接中的使用Manager GUI部分: https://www.elastic.co/guide/zh-CN/elasticsearch/reference/5.1/windows.html#windows
You can only use this manager after you install service. For more detail, refer to the 'Using the Manager GUI' section at this link: https://www.elastic.co/guide/en/elasticsearch/reference/5.1/windows.html#windows
之后您所做的更改,您需要重新启动服务。并且,您还可以在 elasticsearch-service-x64节点下的注册表中看到更改:
After your change, you need to restart the service. And, you can also see the change reflected in the registry as well under 'elasticsearch-service-x64' node:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apache Software Foundation\Procrun 2.0\elasticsearch-service-x64\Parameters\Java
注意:在
管理器属性窗口中进行任何更改后,必须重新启动服务。
Note: It is mandatory to restart the service after any changes made in manager properties window.
这篇关于如何在Windows中为ElasticSearch设置内存限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!