我正在尝试优化Elastic Search中的内存使用,以便在macOS上使用最大4GB。我知道以下代码适用于Windows,但是当我在Mac上运行它时它不起作用:
./elasticsearch -Xmx4g -Xms4g
在Mac上运行它时会显示以下消息:
ERROR: Parameter [-Xmx4g]does not start with --
我试图在没有“ - ”的情况下运行它仍然无效。
有关如何在Mac上运行它的任何想法?
请尝试使用此命令
ES_JAVA_OPTS="-Xms4g -Xmx4g" ./bin/elasticsearch
或者使用jazm.wtions文件中提到的here
资料来源:https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html