分享

启动消费者报错

pig2 2017-6-26 18:09:23 发表于 问题解答 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 1 8568

[mw_shl_code=bash,true]kafka-console-consumer.sh --zookeeper master:2181,slave1:2181,slave2:2181  --topic aboutyunlog --from-beginning
[/mw_shl_code]

[2017-06-26 17:59:25,127] WARN Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
java.net.ConnectException: 拒绝连接
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
[2017-06-26 17:59:26,228] WARN Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
java.net.ConnectException: 拒绝连接
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
[2017-06-26 17:59:26,330] WARN Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
原因:
zookeeper未启动
解决办法:
[mw_shl_code=bash,true]zkServer.sh start[/mw_shl_code]

已有(1)人评论

跳转到指定楼层
yunge2016 发表于 2017-6-26 19:07:27
恩恩, 这个是因为链接不上zookeeper. 不论是kafka自带的zk还是单独的zk都必须先启动zookeeper后保证服务可用,才能启动kafka进行生产数据和消费数据的操作。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条