elasticsearch异常问题 discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
#
错误:文件权限不足 [1]: max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]#
再次启动,又出错了:
1 | [ 1 ]: max file descriptors [ 4096 ] for elasticsearch process likely too low, increase to at least [ 65536 ] |
我们用的是新创建的用户,而不是root,所以文件权限不足。
首先用root用户登录。
然后修改配置文件:
vim /etc/security/limits.conf
添加下面的内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 4096
* hard nproc 4096
错误:线程数不够 [1]: max number of threads [1024] for user [leyou] is too low, increase to at least [4096]#
刚才报错中,还有一行:
[1]: max number of threads [1024] for user [leyou] is too low, increase to at least [4096]
这是线程数不够。
继续修改配置:
vim /etc/security/limits.d/20-nproc.conf
修改下面的内容:
1 | * soft nproc 1024 |
改为:
* soft nproc 4096
错误:进程虚拟内存 [3]: max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]#
vm.max_map_count:限制一个进程可以拥有的VMA(虚拟内存区域)的数量,继续修改配置文件, :
vim /etc/sysctl.conf
添加下面内容:
vm.max_map_count=655360
然后执行命令:
sysctl -p
错误 bootstrap checks faile [1]: 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#
1 2 3 4 5 6 7 | ERROR: [ 1 ] bootstrap checks failed [ 1 ]: 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 /home/leyou/elasticsearch/logs/elasticsearch.log [ 2020 - 04 -05T17: 27 : 09 , 233 ][INFO ][o.e.n.Node ] [localhost.localdomain] stopping ... [ 2020 - 04 -05T17: 27 : 09 , 313 ][INFO ][o.e.n.Node ] [localhost.localdomain] stopped [ 2020 - 04 -05T17: 27 : 09 , 313 ][INFO ][o.e.n.Node ] [localhost.localdomain] closing ... [ 2020 - 04 -05T17: 27 : 09 , 345 ][INFO ][o.e.n.Node ] [localhost.localdomain] close |
修改conf-->elasticsearch.yml
elasticsearch.yml文件
node.name: node-1 前面的#打开
#network.host: 192.168.0.1
network.host: 192.168.136.110
#network.host: 0.0.0.0
#network.host: localhost
#network.host: 127.0.0.1 这里把network.host 设置为自己的ip地址 也可以设置成0.0.0.0(代表所有ip可以访问)
cluster.initial_master_nodes: ["node-1"] 这里一定要这样设置,我就是这里没有这样设置出问题的,弄了好久
这里的 node-1 是上面node.name:后面的对应值
在最后加上这两句,要不然,外面浏览器就访问不了哈
http.cors.enabled: true
http.cors.allow-origin: "*"
作者:BaldHead
出处:https://www.cnblogs.com/strict/p/12638320.html
版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。
推荐:文中如有错误欢迎指出,评论或者[ 邮箱 ]告诉我,感谢阅读!。
本文来自博客园,作者:BaldHead,转载请注明原文链接:https://www.cnblogs.com/strict/p/12638320.html
Buy me a cup of coffee ☕.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)