es java rest high level client sniff嗅探器问题,运行一段时间后可能会无法连接
Elasticsearch | 作者 woon | 发布于2020年10月29日 | 阅读数:5224
spring boot项目中使用了sniffer,但是运行一段时间后会有部分k8s节点无法连接es集群。报了如下错误:
es_rest_client_sniffer[T#1] MS org.elasticsearch.client.sniff.Sniffer$Task run error while sniffing nodes
java.lang.IllegalArgumentException: Illegal Capacity: -1
at java.util.ArrayList.<init>(ArrayList.java:157) ~[?:1.8.0_172-ea]
at org.elasticsearch.client.RestClient.selectNodes(RestClient.java:644) ~[elasticsearch-rest-client-6.7.1.jar:6.7.1]
at org.elasticsearch.client.RestClient.nextNode(RestClient.java:631) ~[elasticsearch-rest-client-6.7.1.jar:6.7.1]
at org.elasticsearch.client.RestClient.performRequestAsyncNoCatch(RestClient.java:520) ~[elasticsearch-rest-client-6.7.1.jar:6.7.1]
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:232) ~[elasticsearch-rest-client-6.7.1.jar:6.7.1]
at org.elasticsearch.client.sniff.ElasticsearchNodesSniffer.sniff(ElasticsearchNodesSniffer.java:104) ~[elasticsearch-rest-client-sniffer-6.7.1.jar:6.7.1]
at org.elasticsearch.client.sniff.Sniffer.sniff(Sniffer.java:209) ~[elasticsearch-rest-client-sniffer-6.7.1.jar:6.7.1]
at org.elasticsearch.client.sniff.Sniffer$Task.run(Sniffer.java:139) [elasticsearch-rest-client-sniffer-6.7.1.jar:6.7.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_172-ea]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_172-ea]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_172-ea]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_172-ea]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172-ea]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172-ea]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172-ea]
看了报错的地方,是存活节点数为-1导致列表初始化失败。为什么总节点数比死掉的节点还少呢,求大神帮忙看下是什么原因。
es_rest_client_sniffer[T#1] MS org.elasticsearch.client.sniff.Sniffer$Task run error while sniffing nodes
java.lang.IllegalArgumentException: Illegal Capacity: -1
at java.util.ArrayList.<init>(ArrayList.java:157) ~[?:1.8.0_172-ea]
at org.elasticsearch.client.RestClient.selectNodes(RestClient.java:644) ~[elasticsearch-rest-client-6.7.1.jar:6.7.1]
at org.elasticsearch.client.RestClient.nextNode(RestClient.java:631) ~[elasticsearch-rest-client-6.7.1.jar:6.7.1]
at org.elasticsearch.client.RestClient.performRequestAsyncNoCatch(RestClient.java:520) ~[elasticsearch-rest-client-6.7.1.jar:6.7.1]
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:232) ~[elasticsearch-rest-client-6.7.1.jar:6.7.1]
at org.elasticsearch.client.sniff.ElasticsearchNodesSniffer.sniff(ElasticsearchNodesSniffer.java:104) ~[elasticsearch-rest-client-sniffer-6.7.1.jar:6.7.1]
at org.elasticsearch.client.sniff.Sniffer.sniff(Sniffer.java:209) ~[elasticsearch-rest-client-sniffer-6.7.1.jar:6.7.1]
at org.elasticsearch.client.sniff.Sniffer$Task.run(Sniffer.java:139) [elasticsearch-rest-client-sniffer-6.7.1.jar:6.7.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_172-ea]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_172-ea]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_172-ea]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_172-ea]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_172-ea]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_172-ea]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172-ea]
看了报错的地方,是存活节点数为-1导致列表初始化失败。为什么总节点数比死掉的节点还少呢,求大神帮忙看下是什么原因。
1 个回复
Memento - Memento
赞同来自: