elasticsearchUnable to lock JVM Memory: error=12--elasticsearch

日志报:
[WARN ][o.e.b.JNANatives ] Unable to lock JVM Memory: error=12,
reason=Cannot allocate memory 不能分配内存
[WARN ][o.e.b.JNANatives ] This can result in part of the JVM being swapped out.
[WARN ][o.e.b.JNANatives ] Increase RLIMIT_MEMLOCK, soft limit: 65536, hard limit: 65536
[WARN ][o.e.b.JNANatives ] These can be adjusted by modifying /etc/security/limits.conf, for example:
# allow user ‘elasticsearch’ mlockall
elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited
[WARN ][o.e.b.JNANatives ] If you are logged in interactively, you will have to re-login for the new limits to take effect.
。。。。。。中间省略
[ERROR][o.e.b.Bootstrap ] [es-node] node validation exception
[1] bootstrap checks failed
[1]: memory locking requested for elasticsearch process but memory is not locked
[INFO ][o.e.n.Node ] [es-node] stopping …
[INFO ][o.e.n.Node ] [es-node] stopped
[INFO ][o.e.n.Node ] [es-node] closing …
[INFO ][o.e.n.Node ] [es-node] closed

/etc/security/limits.conf 文件末尾增加
elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited 不能解决。

解决办法:
/usr/lib/systemd/system/elasticsearch.service
[service]增加 LimitMEMLOCK=infinity
systemctl daemon-reload
systemctl restart elasticsearch.service

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值