一、问题描述
es集群连接超时,导致消费方消费kafka卡死
org.elasticsearch.client.transport : [Arachne] failed to get node info for [#transport#-1][prd-clubtm-new-09][inet[/xxx:9300]], disconnecting...
org.elasticsearch.transport.ReceiveTimeoutTransportException: [][inet[/xxx:9300]][cluster:monitor/nodes/info] request_id [8715189] timed out after [5000ms]
at org.elasticsearch.transport.TransportService$TimeoutHandler.run(TransportService.java:531) ~[elasticsearch-1.5.0.jar!/:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
二、问题分析
1. es集群挂掉了,登陆线上监控平台发现es运行正常,但是堆内存使用过高
2. 堆内存过大,可能导致FULL GC,影响ES数据写入,默认是5s超时
3. ES长时间运行可能导致堆内存过高
三、解决办法
1. 重启es集群,堆内存恢复
2. 修改消费者连接ES的超时时间.put("client.transport.ping_timeout", "120s")
3. 优化ES集群堆内存,保持在70%以下,或者扩容
4. 重启消费者