2

我們正在使用卡夫卡高級消費者,並且我們能夠成功地使用消息,但動物園管理員連接仍然過期並重新建立。動物園管理員會話持續到期...沒有心跳?

我想知道爲什麼沒有心跳,保持連接活着:

Kafka Consumer Logs 
==================== 
[localhost-startStop-1-SendThread(10.41.105.23:2181)] [ClientCnxn$SendThread] [line : 1096 ] - Client session timed out, have not heard from server in 2666ms for sessionid 0x153175bd3860159, closing socket connection and attempting reconnect 
2016-03-08 18:00:06,750 INFO [localhost-startStop-1-SendThread(10.41.105.23:2181)] [ClientCnxn$SendThread] [line : 975 ] - Opening socket connection to server 10.41.105.23/10.41.105.23:2181. Will not attempt to authenticate using SASL (unknown error) 
2016-03-08 18:00:06,823 INFO [localhost-startStop-1-SendThread(10.41.105.23:2181)] [ClientCnxn$SendThread] [line : 852 ] - Socket connection established to 10.41.105.23/10.41.105.23:2181, initiating session 
2016-03-08 18:00:06,892 INFO [localhost-startStop-1-SendThread(10.41.105.23:2181)] [ClientCnxn$SendThread] [line : 1235 ] - Session establishment complete on server 10.41.105.23/10.41.105.23:2181, sessionid = 0x153175bd3860159, negotiated timeout = 4000 


Zookeeper Logs 
================== 
[2016-03-08 17:44:37,722] INFO Accepted socket connection from /10.10.113.92:51333 (org.apache.zookeeper.server.NIOServerCnxnFactory) 
[2016-03-08 17:44:37,742] INFO Client attempting to renew session 0x153175bd3860159 at /10.10.113.92:51333 (org.apache.zookeeper.server.ZooKeeperServer) 
[2016-03-08 17:44:37,742] INFO Established session 0x153175bd3860159 with negotiated timeout 4000 for client /10.10.113.92:51333 (org.apache.zookeeper.server.ZooKeeperServer) 
[2016-03-08 17:46:56,000] INFO Expiring session 0x153175bd3860151, timeout of 4000ms exceeded (org.apache.zookeeper.server.ZooKeeperServer) 
[2016-03-08 17:46:56,001] INFO Processed session termination for sessionid: 0x153175bd3860151 (org.apache.zookeeper.server.PrepRequestProcessor) 
[2016-03-08 17:46:56,011] INFO Closed socket connection for client /10.10.114.183:38324 which had sessionid 0x153175bd3860151 (org.apache.zookeeper.server.NIOServerCnxn) 
+0

我剛剛在我的Mac上開始出現類似的問題(單個節點Kafka/zookeeper開發集羣)。你在Mac上運行嗎? –

+0

它對我來說是Linux ... nd單節點集羣 – nikel

+0

我的問題在IntelliJ IDE中以調試模式運行而加劇。從命令行運行我們的Scala應用程序更加穩定 –

回答

0

通常的ZooKeeper會話超時由「軟故障」,這是最常見的垃圾收集暫停造成的。打開GC日誌記錄並查看連接超時時是否發生長期GC。另外,請閱讀JVM tuning in Kafka