打折购物就上打折屋,打折屋Dazhewu.com带你来嗨,领券再买,更省钱,半价抢先购!

kafka启动了创建topic报错:Replication factor: 1 larger than available brokers: 0

kafka 扩产网 1304℃ 0评论

小白配置kafka踩坑第三波。

kafka和zookeeper都启动了

用命令./bin/kafka-topics.sh –zookeeper 127.0.0.1:2181/kafka –create –topic kuochan.com –replication-factor 1 –partitions 1创建topic,报错Error while executing topic command : Replication factor: 1 larger than available brokers: 0.

spring项目启动报

Error while executing topic command : Replication factor: 1 larger than available brokers: 0.
[2019-09-19 11:03:41,029] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 1 larger than available brokers: 0.

经过折腾发现是kafka配置的zookeeper的配置有问题,/config/server.properties里面配置的是127.0.0.1:2181,结果用到的地方是127.0.0.1:2181/kafka,所以一直报错。

解决方法就是/config/server.properties里面配置成127.0.0.1:2181/kakfa

转载请注明:扩产网 » kafka启动了创建topic报错:Replication factor: 1 larger than available brokers: 0

喜欢 (2)
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址