我安装了新鲜的动物园管理员&卡夫卡。我开始他们两个。然后当我想用这个命令看到主题列表时:
bin/kafka-topics.sh --list --zookeeper localhost 2181
它让套接字连接关闭。这是屏幕截图:
darpanshah@darpan-ubuntu:/opt/Kafka$ bin/kafka-topics.sh --list --zookeeper localhost 2181
2016-08-17 10:44:44,053] INFO Accepted socket connection from /127.0.0.1:48452 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2016-08-17 10:44:44,059] INFO Client attempting to establish new session at /127.0.0.1:48452 (org.apache.zookeeper.server.ZooKeeperServer)
[2016-08-17 10:44:44,069] INFO Established session 0x15698f5ac360001 with negotiated timeout 30000 for client /127.0.0.1:48452 (org.apache.zookeeper.server.ZooKeeperServer)
[2016-08-17 10:44:44,095] INFO Processed session termination for sessionid: 0x15698f5ac360001 (org.apache.zookeeper.server.PrepRequestProcessor)
[2016-08-17 10:44:44,105] INFO Closed socket connection for client /127.0.0.1:48452 which had sessionid 0x15698f5ac360001 (org.apache.zookeeper.server.NIOServerCnxn)
darpanshah@darpan-ubuntu:/opt/Kafka$
提前致谢。卡住了。
答案 0 :(得分:9)
这不是错误。主题详细信息从Zookeeper获取。因此,客户端(由kafka-topics.sh调用)首先连接到Zookeeper,然后建立会话,获取数据,然后在结束时断开连接。 这是从Zookeeper获取一些数据的任何客户端的预期行为。