Apache kafka 缺少必需的参数“;[动物园管理员]”;
我正在尝试使用Apache Kafka启动一个消费者,它以前工作得很好,但我必须格式化我的电脑并重新安装所有内容,现在在尝试运行此功能时:Apache kafka 缺少必需的参数“;[动物园管理员]”;,apache-kafka,apache-zookeeper,kafka-consumer-api,Apache Kafka,Apache Zookeeper,Kafka Consumer Api,我正在尝试使用Apache Kafka启动一个消费者,它以前工作得很好,但我必须格式化我的电脑并重新安装所有内容,现在在尝试运行此功能时: bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning 这就是我得到的: Missing required argument "[zookeeper]" Option
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning
这就是我得到的:
Missing required argument "[zookeeper]"
Option Description
------ -----------
--blacklist <blacklist> Blacklist of topics to exclude from
consumption.
--bootstrap-server <server to connect
to>
--consumer.config <config file> Consumer config properties file.
--csv-reporter-enabled If set, the CSV metrics reporter will
be enabled
--delete-consumer-offsets If specified, the consumer path in
zookeeper is deleted when starting up
--formatter <class> The name of a class to use for
formatting kafka messages for
display. (default: kafka.tools.
DefaultMessageFormatter)
--from-beginning If the consumer does not already have
an established offset to consume
from, start with the earliest
message present in the log rather
than the latest message.
--key-deserializer <deserializer for
key>
--max-messages <Integer: num_messages> The maximum number of messages to
consume before exiting. If not set,
consumption is continual.
--metrics-dir <metrics directory> If csv-reporter-enable is set, and
this parameter isset, the csv
metrics will be outputed here
--new-consumer Use the new consumer implementation.
--property <prop>
--skip-message-on-error If there is an error when processing a
message, skip it instead of halt.
--timeout-ms <Integer: timeout_ms> If specified, exit if no message is
available for consumption for the
specified interval.
--topic <topic> The topic id to consume on.
--value-deserializer <deserializer for
values>
--whitelist <whitelist> Whitelist of topics to include for
consumption.
--zookeeper <urls> REQUIRED: The connection string for
the zookeeper connection in the form
host:port. Multiple URLS can be
given to allow fail-over.
缺少必需的参数“[zookeeper]”
选项说明
------ -----------
--黑名单要从中排除的主题的黑名单
消费。
--引导服务器
--consumer.config消费者配置属性文件。
--csv报告器启用如果设置,csv度量报告器将
启用
--删除使用者偏移如果指定,则在
启动时将删除zookeeper
--格式化程序要用于的类的名称
设置卡夫卡消息的格式
展示。(默认值:kafka.tools。
DefaultMessageFormatter)
--从一开始,如果消费者还没有
已建立的消耗补偿
从最早的开始
日志中存在消息,而不是
而不是最新的消息。
--密钥反序列化器
--最大消息要发送的最大消息数
在退出前消费。如果没有设置,
消费是持续的。
--如果设置了csv报告器启用,则为metrics dir,以及
此参数设置为csv
指标将在此处输出
--新使用者使用新使用者实现。
--财产
--如果在处理错误时出错,则跳过错误消息
消息,跳过它而不是停止。
--超时毫秒(如果指定),如果未显示任何消息,则退出
可供在
指定的时间间隔。
--主题要在其上使用的主题id。
--值反序列化器
--白名单要包含的主题的白名单
消费。
--需要zookeeper:的连接字符串
表单中的zookeeper连接
主机:端口。可以创建多个URL
允许故障转移。
我的猜测是zookeeper连接端口存在某种问题,因为它告诉我指定zookeeper连接到kafka必须使用的端口。但我不确定这一点,也不知道如何找出端口来指定这是否是问题所在。有什么建议吗
提前感谢您的帮助如果您想直接连接到代理,您似乎正在使用旧版本的卡夫卡工具,需要设置
--新消费者
我建议您选择卡夫卡的最新版本,这样您只需指定
--引导服务器
,如您的示例所示:您可以分享您正在使用的卡夫卡版本吗?在卡夫卡0.10之前,Zookeeper是一个必需的参数您好,谢谢您的回答。事实上,我使用的是卡夫卡0.9,我没有注意到,我已经安装了最新的卡夫卡版本,现在它工作得很好。再次感谢!!你好@Mickeel Maison,谢谢你的回答。你是对的,我没有注意到我在运行一个老卡夫卡版本。我一装上最新的,问题就解决了。答案被标记为正确,并投了赞成票!!谢谢!!:)