kafka 遇到的错

D:\cluster\kafka_2.12-1.1.0>.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
Error while executing topic command : Replication factor: 1 larger than available brokers: 0.
[2019-01-18 10:04:11,703] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 1 larger than available brokers: 0.
 (kafka.admin.TopicCommand$)

 错误原因: 一时疏忽没有启动kafak就开始创建topic

2.

[kafka Java创建生产者报错:Invalid partition given with record: 1 is not in the range [0...1)]

错误原因是 kafak的配置文件中分区数不一致,需要修改 server.proerties文件汇总的num.partitions =1 这个配置

posted @ 2019-04-02 11:10  烟雨蒙尘  阅读(4204)  评论(0编辑  收藏  举报