java.io.IOException:通过kafka.utils.NetworkClientBlockingOps $ .awaitReady连接到kafka VIA端口6667失败

时间:2018-10-01 21:33:07

标签: apache-kafka apache-zookeeper

我们有3台Kafka机器和3台Zookper机器

kafka机器与zookeper机器分离,并且所有机器都装有操作系统-redhat 7.x

/var/log/kafka下,我们可以看到java.io.IOException中显示的以下server.log

               at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:63)
[2018-10-07 07:42:13,342] WARN [ReplicaFetcherThread-0-1007], Error in fetch kafka.server.ReplicaFetcherThread$FetchRequest@407ac4e4 (kafka.server.ReplicaFetcherThread)
java.io.IOException: Connection to kafka03.hfge.com:6667 (id: 1007 rack: null) failed
               at kafka.utils.NetworkClientBlockingOps$.awaitReady$1(NetworkClientBlockingOps.scala:83)
               at kafka.utils.NetworkClientBlockingOps$.blockingReady$extension(NetworkClientBlockingOps.scala:93)
               at kafka.server.ReplicaFetcherThread.sendRequest(ReplicaFetcherThread.scala:248)
               at kafka.server.ReplicaFetcherThread.fetch(ReplicaFetcherThread.scala:238)
               at kafka.server.ReplicaFetcherThread.fetch(ReplicaFetcherThread.scala:42)
               at kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:118)
               at kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:103)
               at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:63)
[2018-10-07 07:42:13,551] WARN [ReplicaFetcherThread-0-1002], Error in fetch kafka.server.ReplicaFetcherThread$FetchRequest@2f9f8ecd (kafka.server.ReplicaFetcherThread)
java.io.IOException: Connection to kafka07.hfge.com:6667 (id: 1002 rack: null) failed
               at kafka.utils.NetworkClientBlockingOps$.awaitReady$1(NetworkClientBlockingOps.scala:83)
               at kafka.utils.NetworkClientBlockingOps$.blockingReady$extension(NetworkClientBlockingOps.scala:93)
               at kafka.server.ReplicaFetcherThread.sendRequest(ReplicaFetcherThread.scala:248)
               at kafka.server.ReplicaFetcherThread.fetch(ReplicaFetcherThread.scala:238)
               at kafka.server.ReplicaFetcherThread.fetch(ReplicaFetcherThread.scala:42)
               at kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:118)
               at kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:103)
               at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:63)
[2018-10-07 07:42:15,343] WARN [ReplicaFetcherThread-0-1007], Error in fetch kafka.server.ReplicaFetcherThread$FetchRequest@4dafd0d9 (kafka.server.ReplicaFetcherThread)
java.io.IOException: Connection to kafka03.hfge.com:6667 (id: 1007 rack: null) failed
               at kafka.utils.NetworkClientBlockingOps$.awaitReady$1(NetworkClientBlockingOps.scala:83)
               at kafka.utils.NetworkClientBlockingOps$.blockingReady$extension(NetworkClientBlockingOps.scala:93)
               at kafka.server.ReplicaFetcherThread.sendRequest(ReplicaFetcherThread.scala:248)
               at kafka.server.ReplicaFetcherThread.fetch(ReplicaFetcherThread.scala:238)
               at kafka.server.ReplicaFetcherThread.fetch(ReplicaFetcherThread.scala:42)
               at kafka.server.AbstractFetcherThread.processFetchRequest(AbstractFetcherThread.scala:118)
               at kafka.server.AbstractFetcherThread.doWork(AbstractFetcherThread.scala:103)
               at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:63)
[2018-10-07 07:42:15,552] WARN [ReplicaFetcherThread-0-1002], Error in fetch kafka.server.ReplicaFetcherThread$FetchRequest@5ce51081 (kafka.server.ReplicaFetcherThread)
java.io.IOException: Connection to kafka07.hfge.com:6667 (id: 1002 rack: null) failed

此外,我们还有一个问题,就是一段时间后,卡夫卡与动物园管理员断开了连接, 这意味着经纪人ID已从Zookeeper中删除(从Zoo session / brokers / ids中删除)

cd /usr/hdp/current/zookeeper-server/bin

./zkCli.sh

ls /brokers/ids

任何想法如何找到

java.io.IOException: Connection to kafka03.hfge.com:6667

1 个答案:

答案 0 :(得分:0)

inter.broker.protocol.version未正确更新时,会发生此问题。要解决此问题,请更新inter.broker.protocol.version并按照Documentation中的说明一步一步地重新启动代理。