ES安装问题汇总

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]

问题描述

ES启动报错。其原因是ES需要的的最小max file descriptors为65535,我们设置的是4096,需要增大max file descriptors的值。

解决方案

调大系统的max file descriptors值

/etc/security/limits.conf中新增两行配置:

复制代码
* hard nofile 65536
* soft nofile 65536

这里*代表所有用户,如果要为指定用户调整参数,则将*替换为指定的用户名。

调整完毕后可查看参数:

复制代码
$ ulimit -Hn
65536
$ ulimit -Sn
65536

memory locking requested for elasticsearch process but memory is not locked

问题描述

ES启动报错。原因是ES进程请求内存锁定,但内存未锁定。

解决方案

方案一 关闭bootstrap.memory_lock

elasticsearch.yml中配置bootstrap.memory_lock: false关闭内存锁。

此方案不推荐使用,关闭内存锁会影响性能。

方案二 开启memlock

/etc/security/limits.conf中追加配置:

复制代码
* hard memlock unlimited
* soft memlock unlimited

这里*代表所有用户,如果要为指定用户调整参数,则将*替换为指定的用户名。

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

问题描述

ES启动报错。系统虚拟内存默认最大映射数为65530,无法满足ES系统要求,需要调整为262144以上。

解决方案

调大系统虚拟内存最大映射数。

/etc/sysctl.conf中追加:

复制代码
vm.max_map_count = 262144

重新加载系统设置:

复制代码
sysctl -p

can not run elasticsearch as root

问题描述

使用root用户启动报错

复制代码
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
···

解决方案

无它,建立一个用户,专门用来启动Elasticsearch的,如esuser,相应的系统目录和数据存储目录都赋予esuser账户为归属者。然后切换到esuser用户重新启动es。

相关推荐
在未来等你6 小时前
Elasticsearch面试精讲 Day 15:索引别名与零停机更新
大数据·分布式·elasticsearch·搜索引擎·面试
在未来等你7 小时前
Elasticsearch面试精讲 Day 12:数据建模与字段类型选择
大数据·分布式·elasticsearch·搜索引擎·面试
在未来等你11 小时前
Elasticsearch面试精讲 Day 14:数据写入与刷新机制
大数据·分布式·elasticsearch·搜索引擎·面试
phac12312 小时前
git 如何直接拉去远程仓库的内容且忽略本地与远端不一致的commit
大数据·git·elasticsearch
在未来等你12 小时前
Elasticsearch面试精讲 Day 11:索引模板与动态映射
大数据·分布式·elasticsearch·搜索引擎·面试
哥哥还在IT中12 小时前
Elasticsearch优化从入门到精通
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客13 小时前
使用 cloud-native Elasticsearch 与 ECK 运行
大数据·数据库·elasticsearch·搜索引擎·kubernetes·k8s·全文检索
2301_781668611 天前
Elasticsearch 02
大数据·elasticsearch·搜索引擎
赵孝正1 天前
GitLab 分支管理与 Push 问题全解析
大数据·elasticsearch·gitlab
一刀到底2111 天前
springboot3.3.5 集成elasticsearch8.12.2 ssl 通过 SSL bundle name 来实现
网络·elasticsearch·ssl·springboot3