部署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
相关推荐
斯普信专业组1 小时前
elasticsearch底层模块解析与实践系列
elasticsearch
timi先生1 小时前
在大数据环境下,使用spingboot为Android APP推送数据方案
android·大数据
viperrrrrrrrrr72 小时前
大数据学习(115)-hive与impala
大数据·hive·学习·impala
麻芝汤圆2 小时前
在 IDEA 中写 Spark 程序:从入门到实践
java·大数据·hadoop·分布式·安全·spark·intellij-idea
maomi_95262 小时前
MySQL 在 CentOS 7 环境下的安装教程
大数据·数据库·mysql
炒空心菜菜2 小时前
Spark 配置 YARN 模式
大数据·spark·yarn
凯子坚持 c4 小时前
从 0 到 1:ComfyUI AI 工作流抠图构建全实践
大数据·人工智能
weixin_5498083611 小时前
以运营为核心的智能劳动力管理系统,破解连锁零售、制造业排班难题
大数据·人工智能·零售
SunTecTec12 小时前
Flink Docker Application Mode 命令解析 - 修改命令以启用 Web UI
大数据·前端·docker·flink
喜欢猪猪13 小时前
系统架构师---基于规则的系统架构
大数据·elasticsearch·搜索引擎