安装ElasticSearch报错-Not enough space

安装ElasticSearch报错-Not enough space

安装ElasticSearch报错-Not enough space_第1张图片

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c5330000, 986513408, 0) failed; error='Not enough space' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /usr/local/elasticSearch/elasticsearch-5.5.1/hs_err_pid22369.log

看一下报错信息,就是说虚拟机内存不足,那看过《深入理解JVM》这本书的都知道,修改虚拟机分配内存大小的参数是,-Xmx和-Xms 。

所以就是要改这个参数,那在elasticsearch中这个在哪里改?

在配置文件中改就可以了。

路径如下图:
安装ElasticSearch报错-Not enough space_第2张图片
打开这个文件进行修改,默认是2G,可以用如下命令查看自己服务器内存大小:
在这里插入图片描述
我这个是阿里云学生可以买的那个服务器,看以看出大小不足2G,所以,把这个改小点就可以了,我改成108M:
安装ElasticSearch报错-Not enough space_第3张图片

然后就OK啦~

你可能感兴趣的:(java,elasticsearch)