elasticsearch安装参数配置注意事项

在elasticsearch安装时,有几个重要的参数配置需要我们注意:
1.文件描述

http://www.elasticsearch.org/guide/reference/setup/installation/这样描述:

Make sure to increase the number of open files descriptors on the machine (or for the user running elasticsearch). Setting it to 32k or even 64k is recommended.
 
In order to test how many open files the process can open, start it with -Des.max-open-files set to true. This will print the number of open files the process can open on startup.


关于第一句话就是我们的文件描述符配置设置为32k或者64k,具体配置为:
在linux系统:

/etc/security/limits.conf

编辑该文件,后面加上:

xq soft nofile 65536
xq hard nofile 65536

备注:xq为用户名,同时确保xq用户拥有次命令权限
用vi 编辑bin/elasticsearch文件后面加入

-Des.max-open-files=ture

这样在 运行命令

sh elasticsearch

就可以看得文件描述符的大小了

2.内存设置
elasticsearch内存设置为:

bootstrap.mlockall: true

这样可以elasticsearch确保使用物理内存,不使用linux swap 。

/etc/security/limits.conf


编辑该文件,后面加上:

xq  -memlock     unlimited


备注:xq为用户名,同时确保xq用户拥有次命令权限
或者直接编辑/etc/profile文件,在后面加上


ulimit -l unlimited

3.作为一个服务运行
请参考:elasticsearch service安装


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值