安装了Elasticsearch 5.5并无法启动服务

时间:2019-03-05 14:32:47

标签: java elasticsearch centos

在centos中安装了elasticsearch v5.5,并运行以下命令来启动服务。

sudo service elasticsearch start

运行上述命令时出现以下错误。

Starting elasticsearch: OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 2060255232 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/hs_err_pid15359.log

建议我如何解决此问题。

1 个答案:

答案 0 :(得分:2)

Elasticsearch在5.X版本中默认使用2 GB RAM。

假设您使用的是虚拟机,则您的VM的可用内存似乎少于2GB。尝试给虚拟机更多的内存,或在/etc/elasticsearch/jvm.options中更改您的Elasticsearch JVM设置(例如,设置-Xms512m -Xmx512m)。