ElasticSearch常见问题

本文解决Elasticsearch启动时遇到的系统限制错误,并处理Java应用程序连接Elasticsearch集群时出现的NoNodeAvailableException异常。通过调整系统配置与确保版本一致性,确保Elasticsearch稳定运行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1。 启动es服务报以下错误
bin/elasticsearch

https://github.com/elastic/elasticsearch/issues/21932

max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]```
解决方案:
修改/etc/sysctl.conf 文件,添加 “vm.max_map_count”设置
vm.max_map_count=655360
并执行:sysctl -p
vi /etc/security/limits.conf

添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

```failed to send join request to master [{node_171}{NT2Ja3nbTUWTBds1YKK6IA}{9o4wdJDSQtKEax63JNDm3w}{10.2.7.171}{10.2.7.171:9300}], reason [RemoteTransportException[[node_171][10.2.7.171:9300][internal:discovery/zen/join]]; nested: IllegalArgumentException[can't add node {node_22}{4nxfktphTMy4Uj8DHhlYCg}{IDgspa04T3qlI6io8PEOUA}{10.2.30.22}{10.2.30.22:9300}, found existing node {node_24}{4nxfktphTMy4Uj8DHhlYCg}{vyz1ZWgqTBO8XLOfvmm_2w}{10.2.16.24}{10.2.16.24:9300} with the same id but is a different node instance]; ]```
解决方案:rm -rf data/nodes

2。使用java连接ES时报错
NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1 9300
原因除了网上说的端口号问题/cluster.name问题外,还有可能是java代码elasticsearch 版本号跟es服务版本号不一致!!!





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值