部署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
相关推荐
workflower18 分钟前
机器人应用-楼宇室内巡逻
大数据·人工智能·算法·microsoft·机器人·动态规划·享元模式
电子科技圈22 分钟前
从进迭时空K3看RISC-V CPU与Imagination GPU协同:如何构建高性能SoC能力
大数据·图像处理·人工智能·嵌入式硬件·边缘计算·智能硬件·risc-v
阿里云大数据AI技术26 分钟前
EMR Serverless Spark 推出 Spark 4.0,加速湖仓架构下的数据处理升级
大数据·人工智能·spark
2601_949194261 小时前
springboot之集成Elasticsearch
spring boot·后端·elasticsearch
永霖光电_UVLED2 小时前
1.6T 光模块的能效革命
大数据·人工智能·汽车·娱乐
talen_hx2962 小时前
《零基础入门Spark》学习笔记 Day 17
大数据·笔记·学习·spark
Caspian Wren2 小时前
通过Logstash将MySQL数据同步到ES
数据库·mysql·elasticsearch·logstash
hf2000122 小时前
深入分析:Iceberg v3「删除向量(Deletion Vectors, DV)」如何缓解 CDC 场景写放大
大数据·spark·数据湖·湖仓一体·lakehouse
Elastic 中国社区官方博客3 小时前
使用 Remote Write 将 Prometheus 指标发送到 Elasticsearch
大数据·运维·elasticsearch·搜索引擎·全文检索·prometheus
小t说说3 小时前
2026年PPT生成工具评测及使用体验
大数据·前端·人工智能