Kafka创建Topic出现replication factor: 2 larger than available brokers: 0 减少replication factor还是出现错误的解决办法
kafka-topics.sh --zookeeper hbase:2181 --create --topic ct --partitions 3 --replication-factor 2
[root@hbase kafka]# bin/kafka-topics.sh --zookeeper hbase:2181 --create --topic ct --partitions 3 --replication-factor 2 Error while executing topic command : replication factor: 2 larger than available brokers: 0 [2022-01-16 04:24:57,896] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: replication factor: 2 larger than available brokers: 0 (kafka.admin.TopicCommand$)
错误
出现这样情况是因为kafka的节点只有1个,但是备份却大于1个.所以减少备份数目
kafka-topics.sh --zookeeper hbase:2181 --create --topic ct --partitions 3 --replication-factor 1
出现这种情况
Error while executing topic command : replication factor: 1 larger than available brokers: 0 [2022-01-16 04:26:46,096] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: replication factor: 1 larger than available brokers: 0
这就奇怪了明明已经减少了备份数量还是出现了错误
解决办法
修改创建Topic指令,创建成功
kafka-topics.sh --create -zookeeper hbase:2181 --topic ct --partitions 3 --replication-factor 1
|