Attempting to send response via channel for which there is no open connection

张乘辉 发表于: 2019-10-15   最后更新时间: 2019-10-16 10:39:10   6,332 游览

兽老师你好,最近有个kafka集群遇到了一个问题,具体如下:
集群各个节点都报了一个警告:Attempting to send response via channel for which there is no open connection
经过测试,发送一旦出现这个警告,发送消息延时就特别高,看源码注释,意思是远程连接关闭了,活着空闲时间太长了的意思,但一直没找到故障原因

如上图测试结果,一旦出现那个警告,延时就飙升

而且还会导致频繁YGC

并且发现集群节点很多TIME_WAIT连接:

TIME_WAIT连接如下:

客户端频繁断开重连:

发表于 2019-10-15

针对这次问题与解决,我总结成了以下两篇文章:
1.记一次 Kafka 线上扩容
https://mp.weixin.qq.com/s/n2dMrs21nUU15Vza0VV1pA
2.Kafka 分区重分配源码分析
https://mp.weixin.qq.com/s/6BK28kf2m4ZWKzI2ZjILhw

而且还会导致频繁YGC

¥1.0

kafka什么版本?
集群已经在生产运行了多久?
检查下防火墙设置,是否有长连接时间过长会强杀。

张乘辉 -> 半兽人 5年前

kafka版本是2.2.1,客户端用的spark程序是 spark-streaming-kafka-0-10_2.11,依赖的客户端版本是0.10.1.1

张乘辉 -> 半兽人 5年前

发现集群节点很多TIME_WAIT连接

张乘辉 -> 半兽人 5年前

项目运行情况:
ps -eo pid,lstart,etime | grep 25384
Sun Aug 18 04:42:42 2019 58-12:54:51

半兽人 -> 张乘辉 5年前

我记得kafka 0.10是有这个bug的。这个很久了 不确定客户端也有这个问题。建议升级客户端。

张乘辉 -> 半兽人 5年前

1.经过这么一排查以及源码注释的意思,确实是连接断开或者连接超时的问题,而且查看日志,观察gc情况以及发送延时情况,确实都有跟这个警告有关联;
2.spark-streaming-kafka-0-10_2.11貌似现在是最新的版本了,是不是只需要升级kafka客户端就好了?
3.想问下大佬,为什么这个频繁断开重连,就会产生频繁GC呢?kafka处理连接的详细机制是怎么样的呢?有没有一些好的文章推荐?

张乘辉 -> 半兽人 5年前

还有,kafka 0.10这个bug 在github的issue上面是否有记录呢?

张乘辉 -> 半兽人 5年前

问题有点多,还有一个就是kafka节点有很多TIME_WAIT的连接,是否跟这个有关?

半兽人 -> 张乘辉 5年前

kafka的链接都是长链接,不该有那么多time_wait。

是,只升客户端。

gc回收kafka本身就是很频繁,可能你知道没有观察过。

issue是有的,google一下你这个问题 就能找到,我现在是手机 没办法google

张乘辉 -> 半兽人 5年前

嗯嗯,好的,谢谢大佬

张乘辉 -> 半兽人 5年前

我先去issue查找一下这个bug

张乘辉 -> 半兽人 5年前

大佬,我在问题描述中补充了一张TIME_WAIT连接详情图,你看看是什么情况

半兽人 -> 张乘辉 5年前

netstat -unltpa|grep 9092

张乘辉 -> 半兽人 5年前
tcp6       0      0 192.168.73.31:9092      :::*                    LISTEN      25384/java
tcp6       0      0 192.168.73.31:32493     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55029     192.168.73.34:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:40609     192.168.73.31:9092      TIME_WAIT   -
tcp6       0    128 192.168.73.31:40505     192.168.73.34:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.35.190:24797    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38682     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:25056     192.168.73.36:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:40633     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.52:51350    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55375     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55397     192.168.73.34:9092      TIME_WAIT   -
tcp6       0  23573 192.168.73.31:9092      192.168.25.209:32472    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40537     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.48:58358    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38754     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.198:1528     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.183:64943    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.21:14697    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.191:3464     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62765     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.182:52272    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.198:8294     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.44.130:26756    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17005    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4167      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:4165      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:4189      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.191:61462    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55277     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.104:16983    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.209:38970    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.208:13192    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38530     192.168.73.35:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:55449     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:62865     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55215     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40425     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:3983      192.168.73.33:9092      TIME_WAIT   -
tcp6       0     73 192.168.73.31:9092      192.168.27.70:19265     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.27.70:18075     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38706     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.31:34616    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.207:38315    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40585     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:38730     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55373     192.168.73.34:9092      TIME_WAIT   -
tcp6       0     73 192.168.73.31:9092      192.168.27.70:23323     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32555     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:32707     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:32495     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55399     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.27:43233    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38916     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:4143      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.21:12618    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:55088    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.33:3352     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.183:58792    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:17915    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:21338    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4119      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.52:13837    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55189     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.33:45553     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32471     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.101:5192     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.27:46427    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.27:50117    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.13.35:63928     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.33:11305    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62867     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:38968     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:38732     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.31:2868      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17067    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17043    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62605     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:62741     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.22.70:28949     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.58:35627    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38708     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.58:35561    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4069      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.105:55148    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.58:35035    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.52:53502    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4007      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.35.190:24785    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.23:54129    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.52:9828     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:55134    ESTABLISHED 25384/java
tcp6       0     73 192.168.73.31:9092      192.168.27.70:18179     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32421     192.168.73.32:9092      TIME_WAIT   -
tcp6       0     73 192.168.73.31:9092      192.168.27.69:64698     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:24452    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40513     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.184:6634     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38756     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:62791     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.34:49433     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40449     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17095    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.106:34341    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.27.69:64405     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40535     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:53274     192.168.73.33:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32607     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40401     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.52:53294    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.101:48278    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.107:30763    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.35:48796    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:3957      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:59219     192.168.73.36:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:9092      192.168.25.204:54335    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:17556     192.168.73.34:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:55213     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:58871     192.168.73.32:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:9092      192.168.73.35:3744      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32445     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.49:17785    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40511     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.42:44307    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.35.190:24804    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.13.35:63846     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:17640     192.168.73.34:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:9092      192.168.73.32:34337     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:1135      192.168.73.35:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:55168    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32423     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55451     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:4091      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:3959      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17045    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.28:43038    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4241      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.193:36088    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32557     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:17759     192.168.73.32:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.190:42578    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.20:51851    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32653     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:4031      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:32581     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40451     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40563     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:4117      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.33:45555     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62743     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55325     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.191:61828    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55239     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17059    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40475     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.52:13847    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4067      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:3981      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:62629     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:32629     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.34:49435     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.38:6446     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:39955     192.168.73.31:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:40587     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.183:44949    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.73.31:39955     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17013    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.27:43267    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38868     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.101:40522    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.58:37120    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.204:54309    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.197:17916    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55299     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40635     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.105:16499    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.101:49170    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4191      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:62631     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40403     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.105:55056    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62655     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.13.35:25831     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32605     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.58:35619    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62815     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:38890     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17075    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:47933     192.168.73.36:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:24290    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40561     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.205:22512    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.197:28408    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.27.69:64264     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32705     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.105:55030    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.37:29199    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.209:39610    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.35.190:24773    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.45.45:5776      ESTABLISHED 25384/java
tcp6       0    128 192.168.73.31:24016     192.168.73.35:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.186:32439    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.101:53288    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4005      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.204:54267    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32531     192.168.73.32:9092      TIME_WAIT   -
tcp6       0    128 192.168.73.31:17763     192.168.73.32:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.42:18517    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.198:8246     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.20:64835    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55327     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:4243      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17023    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62789     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55237     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40473     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:38842     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55167     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.20:48226    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.21:51534    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32533     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.36:23221     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55165     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.104:16647    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32469     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.209:32416    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.45.46:13198     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.185:55492    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38816     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:38914     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.105:21356    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.38:58732    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40499     192.168.73.34:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38684     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.104:31390    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62767     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:32631     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:55275     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:47931     192.168.73.36:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55351     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:24004     192.168.73.35:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.21:51149    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.193:58590    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55191     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40611     192.168.73.31:9092      TIME_WAIT   -
tcp6       0     73 192.168.73.31:9092      192.168.27.70:19992     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:25542    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:30399     192.168.73.33:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:9092      192.168.25.205:22238    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.29:6371     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38866     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.42:18525    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4029      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:4141      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.183:54031    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38794     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.34:38238     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:36349    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62717     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:62581     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:62653     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.21:16915    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.193:30175    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.104:16989    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.129.28:31617    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55301     192.168.73.34:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.32:5090     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62715     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.35:3742      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:31655     192.168.73.32:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:9092      192.168.11.104:16975    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.11.104:16971    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.209:25342    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:55349     192.168.73.34:9092      TIME_WAIT   -
tcp6       0     65 192.168.73.31:9092      192.168.25.186:22942    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:2868      192.168.73.31:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:9092      192.168.11.105:13871    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62693     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.191:3370     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32447     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.25.209:32448    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62583     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.35.190:24809    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32583     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.104:16961    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62691     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.36:23223     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62813     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.55:18176    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:62607     192.168.73.36:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.13.35:25815     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:32655     192.168.73.32:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.35.190:24781    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.191:61728    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38844     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:38892     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.129.27:46459    ESTABLISHED 25384/java
tcp6       0    128 192.168.73.31:53276     192.168.73.33:9092      ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:9092      192.168.25.207:5807     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:38792     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:38818     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.11.105:55020    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:3811      192.168.73.33:9092      ESTABLISHED 17911/java
tcp6       0      0 192.168.73.31:9092      192.168.11.104:17031    ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:40427     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:38966     192.168.73.35:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:9092      192.168.73.32:34339     ESTABLISHED 25384/java
tcp6       0      0 192.168.73.31:4093      192.168.73.33:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40685     192.168.73.31:9092      TIME_WAIT   -
tcp6       0      0 192.168.73.31:40687     192.168.73.31:9092      TIME_WAIT   -
半兽人 -> 张乘辉 5年前

正常的是没有TIME_WAIT的,客户端升级了吗?

张乘辉 -> 半兽人 5年前

那边不愿意升级,说双11临近有风险,其实就是我没有找到确凿证据事实,他们还说spark-streaming连接kafka是短连接方式才导致频繁重连接的

张乘辉 -> 半兽人 5年前

我还发现这些time_wait都是节点直接的连接

张乘辉 -> 半兽人 5年前

这些连接大部分是副本之间同步数据用的吧,所以如果使用了acks=all,发送消息延时就特别高

半兽人 -> 张乘辉 5年前

acks=all是所有的副本都要应答,副本越多,就会越慢(推荐2个副本即可)。
测试结果怎么样?

张乘辉 -> 半兽人 5年前

他们说spark集群跑批的操作,用完就释放,说这个是正常现象,抛开这点,那么多节点间连接是 TIME_WAIT 状态,我就觉得不正常了

hi,请问楼主这个问题,最后你们spark组商量的最后方案是什么?通过升级客户端解决了吗?

你的答案

查看kafka相关的其他问题或提一个您自己的问题