kafka 创建主题 Replication factor: 1 larger than available brokers: 0. 错误
[root@localhost bin]# ./kafka-topics.sh —zookeeper localhost:2181 —create —topic hello-kafka —replication-factor 1 —partitions 4
Created topic hello-kafka.
[root@localhost bin]# ./kafka-topics.sh —zookeeper localhost:2181/kafka —create —topic hello-kafka2 —replication-factor 1 —partitions 4
Error while executing topic command : Replication factor: 1 larger than available brokers: 0.
[2019-10-11 21:12:20,867] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: Replication factor: 1 larger than available brokers: 0.
(kafka.admin.TopicCommand$)
[root@localhost bin]#
可以看到./kafka-topics.sh —zookeeper localhost:2181/kafka —create —topic hello-kafka2 —replication-factor 1 —partitions 4
这个主题创建命令出错了,这是因为localhost:2181/kafka 和server.properties 的
zookeeper.connect=localhost:2181 配置项匹配不上导致的,需要一致才行
还没有评论,来说两句吧...