kafka-console-consumer 参数 --zookeeper 不可用 与 The coordinator is not available的问题

事情起因是这样的。我们环境需要用到kafka,现在都是使用容器化的部署,大佬就找了个github星最多docker-kafka连接给我,建议我用这个来搭建。我们开发环境已经有了zk,所以就让我用kafka连上面的zk。kafka搭起来了,生产者可以生产。但是消费者始终是消费不到消息。使用tcpdump抓包也可以确认,消息已经发送到kafka。但是消费者始终无法消费。猜想是不是那个步骤执行错了。所以就按照https://github.com/wurstmeister/kafka-docker的官方文档一步一步来做。

wurstmeister docker-kafka tutorial:http://wurstmeister.github.io/kafka-docker/

发现里面有一步骤怎么也走不通:

$KAFKA_HOME/bin/kafka-console-consumer.sh --topic=topic --zookeeper=$ZK

本地查看脚本的帮助,也没有这个参数,类似功能的是--bootstrap-server的参数:

D:\Programs\kafka_2.11-2.4.0\bin\windows>kafka-console-consumer.bat --help
This tool helps to read data from Kafka topics and outputs it to standard output
.
Option                                   Description

------                                   -----------

--bootstrap-server <String: server to    REQUIRED: The server(s) to connect to.

  connect to>

--consumer-property <String:             A mechanism to pass user-defined

  consumer_prop>                           properties in the form key=value to

                                           the consumer.

--consumer.config <String: config file>  Consumer config properties file. Note

                                           that [consumer-property] takes

                                           precedence over this config.

--enable-systest-events                  Log lifecycle events of the consumer

                                           in addition to logging consumed

                                           messages. (This is specific for

                                           system tests.)

--formatter <
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值