CentOS7.0上安装运行“systemctl start elasticsearch”命令,启动失败,报“Java HotSpot(TM) 64-Bit Server VM warning...”

  安装配置elasticsearch运行启动命令后 Activedfailed,看报错信息“There is insufficient memory for the Java Runtime Environment to continue”翻译过来就是“内存不足,Java运行时环境无法继续。”所以在启动服务之前,我们应该对elasticsearch的配置文件参数进行修改,除非你的虚拟机的分配内存很大!

[root@localhost ~]# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-11-04 21:58:09 CST; 16s ago
     Docs: http://www.elastic.co
  Process: 1593 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR} (code=exited, status=1/FAILURE)
  Process: 1590 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 1593 (code=exited, status=1/FAILURE)

Nov 04 21:58:08 localhost.localdomain systemd[1]: Started Elasticsearch.
Nov 04 21:58:09 localhost.localdomain elasticsearch[1593]: Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000094cc0000, 1798569...rrno=12)
Nov 04 21:58:09 localhost.localdomain elasticsearch[1593]: #
Nov 04 21:58:09 localhost.localdomain elasticsearch[1593]: # There is insufficient memory for the Java Runtime Environment to continue.
Nov 04 21:58:09 localhost.localdomain elasticsearch[1593]: # Native memory allocation (mmap) failed to map 1798569984 bytes for committing reserved memory.
Nov 04 21:58:09 localhost.localdomain elasticsearch[1593]: # An error report file with more information is saved as:
Nov 04 21:58:09 localhost.localdomain elasticsearch[1593]: # /tmp/hs_err_pid1593.log
Nov 04 21:58:09 localhost.localdomain systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Nov 04 21:58:09 localhost.localdomain systemd[1]: Unit elasticsearch.service entered failed state.
Nov 04 21:58:09 localhost.localdomain systemd[1]: elasticsearch.service failed.

我找到了原因,之前我在装VM12分配运行内存是2G!而elasticsearch的初始内存就是2G…

在这里插入图片描述

  我对CentOS目录下/etc/elasticsearchjvm.options进行参数修改,初始堆和最大堆都改成了512m的内存大小!!

vim /etc/elasticsearch/jvm.options

在这里插入图片描述

再次启动elasticsearch服务,启动成功!

在这里插入图片描述


 ☝上述分享来源个人总结,如果分享对您有帮忙,希望您积极转载;如果您有不同的见解,希望您积极留言,让我们一起探讨,您的鼓励将是我前进道路上一份助力,非常感谢!我会不定时更新相关技术动态,同时我也会不断完善自己,提升技术,希望与君同成长同进步!

☞本人博客:https://coding0110lin.blog.csdn.net/  欢迎转载,一起技术交流吧!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值