Ubuntu - Elasticsearch - 错误 : Cannot allocate memory

标签 ubuntu elasticsearch out-of-memory

我正尝试按照以下指南在我的本地 Ubuntu 机器上安装 elasticsearch:

https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html

,当尝试运行“./elasticsearch”时,出现以下错误:

Java HotSpot(TM) 64-Bit Server VM warning: INFO: <br>

os::commit_memory(0x00007f0e50cc0000, 64075595776, 0) failed; <br>

error='Cannot allocate memory' (errno=12) <br>

There is insufficient memory for the Java Runtime Environment to continue.<br>

Native memory allocation (mmap) failed to map 64075595776 bytes for committing reserved memory

这是内存统计信息:

             total       used       free     shared    buffers     cached
Mem:       8113208    4104900    4008308      44244     318076    1926964
-/+ buffers/cache:    1859860    6253348
Swap:      7812092          0    7812092

日志中的错误信息:

There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 64075595776 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:2627), pid=13021, tid=139764129740544
#
# JRE version:  (8.0_66-b17) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.66-b17 mixed mode linux-amd64 )
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

已经尝试过早期版本,使用 apt 从存储库安装,没有任何效果。

有人知道可能是什么问题吗?

最佳答案

看起来您正在尝试使用默认选项启动 ElasticSearch,这会尝试将堆栈大小设置为 2Go。如果你没有那个免费的……kaboom(默默地)。

查看 /etc/elasticsearch/jvm.options 并修改以下行:

-Xms2g
-Xmx2g

适合您可用内存的内容。但请注意,ElasticSearch 是一个非常大的内存消耗者并且想要它的一切。在 2Go 限制下,您可能无法获得有用的系统。

关于Ubuntu - Elasticsearch - 错误 : Cannot allocate memory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34748464/

相关文章:

bash - 在 gnome 终端的新选项卡中运行脚本

java - 将 ES 的 UpdateByQueryRequestBuilder 与 Rest High Level Client 结合使用

elasticsearch - 在 Elasticsearch 中使用“全部匹配”过滤器会对性能产生什么影响?

crash - Ocaml "Out of memory"异常;详细模式说 "Stack overflow in structural comparison"

java - 生产服务器上的 Tomcat、PermGen 和重新部署

c - 在 Ubuntu 11.10 中使用 gcc 编译时未定义对 openssl 函数的引用

mysql - 如何使用 procmail 过滤采用 Base 64 编码的电子邮件

bash - 在大型 (30G) 单行文件上运行 sed 返回空输出

azure - 将节点 azure 添加到 Elasticsearch

c++ - CPLEX MIP 内存不足 : NodeFileInd is 2 but no files has been created