部署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
相关推荐
wtblszn1 小时前
水源井安全监测在线管理系统方案
大数据·安全
岳涛_daemon3 小时前
考古|ES 2.0 禁的元字段只有 10 个,_source 和 _version 不在里面
elasticsearch
岳涛_daemon5 小时前
考古|ES 2.0 先整体解码再切分路径,文档 id 里的 %2F 被切开,个别 id 查不到
elasticsearch
奇墨 ITQM5 小时前
AI网关MAIGateway怎么判断质量?多活切换实测
大数据·网络·人工智能·高可用·ai网关·故障切换
向科→向总工→空间动态计系统7 小时前
动态零轴融合三铁律
大数据·开发语言·人工智能·python·机器人
DataY轻量数据平台7 小时前
时序、流式、向量一库搞定:DataY 正式支持 YMatrix
大数据·数据库
逐米时代8 小时前
「制造新解法」AI转型路线图:分阶段目标与资源节奏设计
大数据·人工智能
Aloudata9 小时前
人工逐级追查 SQL vs 数据血缘追溯:监管报表异常排查
大数据·数据库·sql
注塑机数据采集联网9 小时前
中科晟达注塑机 MES 系统:通过自建网关采集数据并对接 AI 系统
大数据·人工智能·物联网·数据采集·注塑机网关·注塑机mes
程序猿追10 小时前
HarmonyOS 7 本机书签里,两篇同名文章怎样在重启后各自打开
大数据·数据分析·harmonyos