当我也尝试在Ubuntu中启动elasticsearch时,启动脚本给我以下错误:
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下降并出现此错误。
我已经在elasticsearch.yml文件中设置了bootstrap.mlockall:true属性,并在默认的elasticsearch文件中设置了属性:
ES_HEAP_SIZE=512 (I have 1GB of RAM) MAX_LOCKED_MEMORY=unlimited
有人知道我需要做什么吗?
谢谢
您已配置了具有1 GB RAM的虚拟机,但是Elastic试图从2 GB RAM开始(Elasticsearch版本5.X的默认设置)
为VM提供更多内存,或更改Elasticsearch JVM设置 /etc/elasticsearch/jvm.options并降低以下参数的值:-Xms512m -Xmx512m
/etc/elasticsearch/jvm.options
-Xms512m -Xmx512m