部署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
相关推荐
爱吃面的猫3 小时前
大数据Hadoop之——Flink1.17.0安装与使用(非常详细)
大数据·hadoop·分布式
Fireworkitte4 小时前
安装 Elasticsearch IK 分词器
大数据·elasticsearch
ywyy67985 小时前
短剧系统开发定制全流程解析:从需求分析到上线的专业指南
大数据·需求分析·短剧·推客系统·推客小程序·短剧系统开发·海外短剧系统开发
暗影八度7 小时前
Spark流水线数据质量检查组件
大数据·分布式·spark
白鲸开源8 小时前
Linux 基金会报告解读:开源 AI 重塑经济格局,有人失业,有人涨薪!
大数据
海豚调度8 小时前
Linux 基金会报告解读:开源 AI 重塑经济格局,有人失业,有人涨薪!
大数据·人工智能·ai·开源
白鲸开源8 小时前
DolphinScheduler+Sqoop 入门避坑:一文搞定数据同步常见异常
大数据
学术小八9 小时前
第二届云计算与大数据国际学术会议(ICCBD 2025)
大数据·云计算
求职小程序华东同舟求职9 小时前
龙旗科技社招校招入职测评25年北森笔试测评题库答题攻略
大数据·人工智能·科技
二二孚日10 小时前
自用华为ICT云赛道Big Data第六章知识点-分布式搜索服务ElasticSearch
大数据·华为