Zookeeper:连接超时

时间:2017-06-29 12:41:05

标签: apache-kafka apache-zookeeper

我的Java应用程序在Linux机器上运行,该机器连接到在不同的Linux机器上运行的Zookeeper和Kafka。有时,应用程序日志中有WARN消息。

 WARN  [ClientCnxn:1108] Client session timed out, have not heard from server in 36670ms for sessionid 0x15cf3c1eccf0001

我的Zookeeper配置是:

tickTime=2000
dataDir=/var/lib/zookeeper
clientPort=2181
initLimit=5
syncLimit=2
maxClientCnxns=300

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

由于长垃圾收集进程,导致Zookeeper会话超时。在Kafka生产者和消费者应用程序中查找内存泄漏,适当的堆空间分配。

另外,请查看以下链接以优化Kafka,

http://docs.confluent.io/2.0.1/kafka/deployment.html#jvm

以及使用Zookeeper时要避免的最佳做法和事项,

https://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html#sc_commonProblems