ElasticSearch 学习之 bootstrap checks failed

问题

启动失败,日志:

[3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max number of threads [3795] for user [es] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

分析+解决

  • [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]

系统为elasticsearch进程分配的最大可用文件描述符4096不够用,至少分配65535个。

增加配置命令:ulimit -n 65535

  • [2]: max number of threads [3795] for user [es] is too low, increase to at least [4096]

系统为es用户分配的最大可用线程数3795太少,至少分配4096个。

增加线程数: ulimit -u 4096

  • [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

内核参数:最大虚拟内存65530太少,至少分配262144

执行命令:sysctl -w vm.max_map_count=262144

以上方式只是暂时解决,每次登录都要设置。

永久修改

  • 修改文件限制

vi /etc/security/limits.conf

追加

#当前系统最大可打开的fd 65535
* soft nofile 65535
#系统最大可打开的fd 65535
* hard nofile 65535
#当前系统最大允许进程数
* soft nproc 4096
#系统最大允许进程数
* hard nproc 4096
#当前系统最大可锁内存
* soft memlock unlimited
#系统最大可锁内存
* hard memlock unlimited
  • vi /etc/systemd/system.conf

DefaultLimitNOFILE=65536
DefaultLimitNPROC=32000
DefaultLimitMEMLOCK=infinity
  • 修改内核参数

vi  /etc/sysctl.conf
追加

vm.max_map_count=262144

重新加载 sysctl -p

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值