Elasticsearch 内存问题 [英] Elasticsearch memory problems
问题描述
当我也尝试在我的 Ubuntu 中启动 elasticsearch 时,启动脚本给了我以下错误:
When I'm trying too start the elasticsearch in my Ubuntu the startup script gives me the following error:
Java HotSpot(TM) Client VM warning: INFO: os::commit_memory(0x74800000, 201326592, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 201326592 bytes for committing reserved memory.
我已经尝试通过此搜索,但找不到解决方案.如果我重新启动机器,一切正常运行一天,然后 elasticsearch 出现故障并出现此错误.
I try already to search by this and I couldn't find the solution for this. If I restart the machine everything work well for a day and then the elasticsearch goes down and appear this error.
我已经在 elasticsearch.yml 文件中设置了 bootstrap.mlockall: true 属性,以及默认 elasticsearch 文件中的属性:
I already setup the property bootstrap.mlockall: true in the elasticsearch.yml file, and also the properties in the default elasticsearch file:
ES_HEAP_SIZE=512 (I have 1GB of RAM)
MAX_LOCKED_MEMORY=unlimited
有人知道我需要做什么吗?
Someone know what I need to do?
谢谢
推荐答案
对于当前版本的 elastic (5.X) 你可以配置 jvm 启动选项 在 jvm.options
文件中,通常位于目录 <代码>/etc/elasticsearch/jvm.options:
For the current version of elastic (5.X) you can configure jvm startup options in the jvm.options
file usually located under directory /etc/elasticsearch/jvm.options
:
-Xms1g -Xmx1g
希望有帮助.
这篇关于Elasticsearch 内存问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!