设置bootstrap.memory_lock为true报错

为了提高elasticsearch的效率,我设置了禁用交换区(swapping),开始是只是修改了elasticsearch.yml文件的bootstrap.memmory_lock,但是设置后启动报错:


[1]: memory locking requested for elasticsearch process but memory is not locked

我的安装方式使用tar,启动方式为bin/elasticsearch,这里还需要修改/etc/security/limits.conf,不同的安装方式需要配置的文件不同,详情见https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html

添加以下两行到/etc/security/limits.conf文件中,

user soft memlock unlimited
user hard memlock unlimited

其中,user为运行elasticsearch的用户
对于远程连接用户(使用putty等工具登陆服务器)来说设置好后退出当前对话(session),非远程连接用户重启机器。
然后使用,命令ulimit -a检查是否设置成功

设置bootstrap.memory_lock为true报错_第1张图片
image.png

reference

https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html

https://www.elastic.co/guide/en/elasticsearch/reference/current/setting-system-settings.html

你可能感兴趣的:(设置bootstrap.memory_lock为true报错)