cenos 安装es

本文详述了在CentOS上安装Elasticsearch时遇到的max file descriptors、max number of threads和max virtual memory areas问题,以及如何通过调整系统参数如`ulimit`和`sysctl`配置来解决这些问题。同时,介绍了如何安装Kibana并与Elasticsearch配合使用,包括修改Kibana的配置文件以适应无密码和SSL的本地测试环境。
摘要由CSDN通过智能技术生成

 下载:Download Elasticsearch | Elastic

tar -zxvf xxx

./bin/elasticsearch 启动es

 安装官方文档;Install Elasticsearch from archive on Linux or MacOS | Elasticsearch Guide [8.3] | Elastic

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

[1] 错误

从错误信息看出应该是elasticsearch程序需要的最小max file descriptors值是65536,但是我的host只配置了4096(默认值)
那我先确认一下

ulimit -Hn: 是max number of open file descriptors的hard限制
ulimit -Sn: 是max number of open file descriptors的soft限制
那接下来要把这两个值改大。

切换到root用户,然后

1

2

3

4

5

6

vim /etc/security/limits.conf

es soft nofile 65535

es hard nofile 65535

*表示运行elasticsearch的用户,hard与soft表示限制的类型,nofile表示max number of open file descriptors,65536表示设置的大小。
改完需要重新登录才能生效,或者切换用户 

ulimit -a 查看

[2] 错误

vim /etc/security/limits.conf
es  soft nproc  4096
es  hard nproc  4096

es为用户名不写可以用* 代替

注:

Linux用户使用大页的限制,无限制!

#vi /etc/security/limits.conf

* soft memlock unlimited

* hard memlock unlimited

【3】错误

先要切换到root用户;

临时
下面方法只是起到临时修改作用,重启虚拟机将失效

sudo sysctl -w vm.max_map_count=262144

查看结果

sysctl -a|grep vm.max_map_count

显示

vm.max_map_count = 262144

永久
编辑/etc/sysctl.conf文件,在最后添加一行

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值