弹性搜索和logstash给出内存错误

时间:2016-03-23 09:38:43

标签: java elasticsearch lucene logstash

我的系统中安装了elasticsearch 2.2.0和logstash 2.1。

当我使用以下命令执行logstash的配置测试时:

sudo service logstash configtest

它出现以下错误:

 There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 55545856 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_linux.cpp:2638), pid=7887, tid=140476386535168
#
# JRE version: OpenJDK Runtime Environment (8.0_71-b15) (build 1.8.0_71-b15)
# Java VM: OpenJDK 64-Bit Server VM (25.71-b15 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

解决这个内存错误的最佳方法是什么,因为有很多规定的解决方案?

此外,

I have bootstrap.mlockall : true in elasticsearch.yml configured.

我们可以不同地配置elasticsearch位吗?

1 个答案:

答案 0 :(得分:0)

我通过将ES_JAVA_OPTS传递给一个较小的值来解决我的问题,我认为默认情况下它会尝试将机器的整个内存分配给它(在我的情况下是2GB)并且它会失败。

看看:https://github.com/docker-library/elasticsearch/issues/131