部署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
相关推荐
ACP广源盛139246256732 小时前
GSV6155@ACP# 搭配 AI 服务器、AI PC 完整适配方案
大数据·服务器·人工智能·分布式·单片机·嵌入式硬件
stonewl25993 小时前
2026化工行业 GHS/CLP 国产标签打印软件合规打印方案
大数据·人工智能·物联网
Wzx1980123 小时前
Redis&ES——Retriever的抽象实现
数据库·人工智能·redis·elasticsearch
xywww1684 小时前
AWS 账号权限怎么分:根用户和 IAM 用户区别及日常使用建议
大数据·开发语言·人工智能·python·gpt·云计算·aws
牛奶咖啡134 小时前
大数据Hadoop运维应用实践——双NameNode高可用Hadoop集群架构(下)
大数据·hadoop·hadoop集群配置文件解析·hadoop高可用集群安装部署·配置指定多台服务器相互免密·配置hadoop服务开机自启·ansible部署hadoop
在水一缸4 小时前
深度解析 GPT-5.6:大模型架构演进与复杂任务实战指南
大数据·人工智能·gpt·架构·大模型·架构演进·gpt-5.6
无忧智库5 小时前
智慧电厂:引领发电行业新革命(PPT)
大数据·人工智能
小果因子实验室5 小时前
量化研究--编写第一个回测算法策略研究
大数据·区块链
chenyulin45456 小时前
企业微信API二次开发:万级并发回调下的极致幂等性设计与防重放架构实战
大数据·人工智能·安全·架构·企业微信
Elasticsearch6 小时前
让向量听懂孤独:我是如何用 Elastic Agent Builder 构建一个情绪疗愈 agent 的
elasticsearch