简体   繁体   English

如何在ElasticSearch上使用最大4GB的内存?

[英]How to use a max of 4GB of memory on ElasticSearch?

I am trying to optimize the use of memory in Elastic Search to use max 4GB on a macOS. 我正在尝试优化Elastic Search中的内存使用以在macOS上使用最大4GB内存。 I know the following code works on Windows, but when I run it on Mac it doesn't work: 我知道以下代码可在Windows上运行,但是在Mac上运行时不起作用:

./elasticsearch -Xmx4g -Xms4g

When running it on Mac it says the following message: 在Mac上运行时,它会显示以下消息:

ERROR: Parameter [-Xmx4g]does not start with --

I have tried to run it without "-" and still does not work. 我试图在不带“-”的情况下运行它,但仍然无法正常工作。

Any ideas on how to run it on Mac? 关于如何在Mac上运行它的任何想法?

Try using this command instead 尝试改用此命令

ES_JAVA_OPTS="-Xms4g -Xmx4g" ./bin/elasticsearch

or use the jvm.options file mentioned here 或使用此处提到的jvm.options文件

Source: https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html 资料来源: https : //www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM