日志报:
[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