我的Java应用程序在Linux机器上运行,它连接到在不同Linux机器上运行的Zookeeper和Kafka。有时,应用程序日志中会出现警告消息。
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
有人可以帮我解决这个问题吗?
最佳答案
由于垃圾收集进程过长,Zookeeper session 超时。在 Kafka 生产者和消费者应用程序中查找内存泄漏、适当的堆空间分配。
此外,请查看以下用于优化 Kafka 的链接,
http://docs.confluent.io/2.0.1/kafka/deployment.html#jvm
以及使用 Zookeeper 时的最佳实践和避免的事情,
https://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html#sc_commonProblems
关于apache-kafka - 动物园管理员 : Connection Timed Out,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44825436/