部署elasticsearch需要调整的系统参数

在部署elasticsearch启动的过程中失败了,具体报错如下:

bash 复制代码
ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log
bash 复制代码
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
ERROR: Elasticsearch did not exit normally - check the logs at /data1/elasticsearch/logs/starces.log

解决方法:

报错的意思是ElasticSearch拥有的内存太小,至少需要262144。查看命令sysctl -a|grep vm.max_map_count可以看到到vm.max_map_count = 65530,需要增加这个值。临时生效的方法:sysctl -w vm.max_map_count=262144。如果需要永久生效,需要在/etc/sysctl.conf文件下添加一行:vm.max_map_count=262144并重启,即可解决。重启命令如下:

bash 复制代码
sysctl -p

最大线程个数太低。修改配置文件/etc/security/limits.conf

bash 复制代码
* soft nofile 65536
* hard nofile 65536
* soft nproc 4096
* hard nproc 4096

--查看当前系统配置文件ulimit的全局配置

bash 复制代码
ulimit -a

如果未进行具体设置的话,会使用默认配置,如下查看

bash 复制代码
grep '^*' /etc/security/limits.conf
相关推荐
ly768928 分钟前
倒排索引与 FST 在 Lucene 中的内存布局:segment、docValues 与词典压缩的工程取舍
elasticsearch·lucene·倒排索引·doc values·fst
奈落241 小时前
AI 编程从助手到 Agent:基于两份资料看哪些环节可以交出去,哪些必须自己攥住
大数据·人工智能
Joker可视化开发平台1 小时前
AI短剧接棒真人剧:开机量跌七成,普通人进场窗口在收窄
大数据·人工智能
数据狐(Datafox)1 小时前
淘宝图片搜索 API 落地实战:基于以图搜货搭建跨境电商选品系统
java·大数据·微服务
YangYang9YangYan1 小时前
2027 秋招|数据科学与大数据技术面试项目价值回答思路,告别纯代码描述
大数据·面试·职场和发展
2601_960356382 小时前
2027 校招质量工程师岗位拆解:数学、统计、大数据专业如何判断匹配度
大数据
Elasticsearch2 小时前
利用预计算上下文,更快速、更低成本地开展支持问题调查
elasticsearch
KeyAction66663 小时前
AI改写战争规则,也在改写商业规则:体系对抗时代已经到来
大数据·人工智能
Qyr993 小时前
2026年全球二极管模组行业市场规模全景研判:竞争格局与发展趋势全解析
大数据·人工智能
小小小米粒5 小时前
重置本地git
大数据·git·elasticsearch