我使用单节点Kafka(v 0.10.2)和单节点zookeeper(v 3.4.8),我的controller.log文件填充了此异常
java.io.IOException: Connection to 1 was disconnected before the response was read
at kafka.utils.NetworkClientBlockingOps$.$anonfun$blockingSendAndReceive$3(NetworkClientBlockingOps.scala:114)
at kafka.utils.NetworkClientBlockingOps$.$anonfun$blockingSendAndReceive$3$adapted(NetworkClientBlockingOps.scala:112)
at scala.Option.foreach(Option.scala:257)
at kafka.utils.NetworkClientBlockingOps$.$anonfun$blockingSendAndReceive$1(NetworkClientBlockingOps.scala:112)
at kafka.utils.NetworkClientBlockingOps$.recursivePoll$1(NetworkClientBlockingOps.scala:136)
at kafka.utils.NetworkClientBlockingOps$.pollContinuously$extension(NetworkClientBlockingOps.scala:142)
at kafka.utils.NetworkClientBlockingOps$.blockingSendAndReceive$extension(NetworkClientBlockingOps.scala:108)
at kafka.controller.RequestSendThread.liftedTree1$1(ControllerChannelManager.scala:192)
at kafka.controller.RequestSendThread.doWork(ControllerChannelManager.scala:184)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:63)
我用Google搜索了此异常,但无法找到此异常的根本原因。有人可以告诉我为什么会发生这种错误以及如何防止这种错误吗?
答案 0 :(得分:0)
在多节点群集方案中,我也遇到相同的问题。这是因为kafka-node和zookeeper之间的连接关闭。我建议先重新启动Zookeeper服务器,然后再重新启动kafka-node,以便重新建立连接,因此代理应处理发布/订阅消息转换。 希望它能使您从中受益。