elasticsearch文件服务器,Elasticsearch 服务器系统配置

在ES服务安装完成后需要对服务器进行一些参数设置。

官方文档地址:Important System Configuration

1. 关闭swap

# 临时关闭

swapoff -a

# 永久禁用

编辑/etc/fstab文件,注释swap行

2. 文件描述符

Elasticsearch使用大量文件描述符或文件句柄。用完文件描述符可能是灾难性的,最有可能导致数据丢失。确保将运行Elasticsearch的用户的打开文件描述符数量限制增加到65,536或更高。

For the .zip and .tar.gz packages, set ulimit -n 65536 as root before starting Elasticsearch, or set nofile to 65536 in /etc/security/limits.conf.

curl -X GET "localhost:9200/_nodes/stats/process?filter_path=**.max_file_descriptors&pretty"

3. 确保有足够的虚拟内存

sysctl -w vm.max_map_count=262144

To set this value permanently, update the vm.max_map_count setting in /etc/sysctl.conf. To verify after rebooting, run sysctl vm.max_map_count.

The RPM and Debian packages will configure this setting automatically. No further configuration is required.

4. 确保足够的线程

Elasticsearch对不同类型的操作使用许多线程池。 能够在需要时创建新线程很重要。 确保Elasticsearch用户可以创建的线程数至少为4096。

这可以通过在启动Elasticsearch之前执行 ulimit -u 4096

或在/etc/security/limits.conf中将nproc设置为4096来完成。

软件包分发在systemd下作为服务运行时,将自动为Elasticsearch进程配置线程数。 无需其他配置。

5. JVM DNS cache settings

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值