kafka 的这个错误 很多地方会触发 :
CDH 继续测试中. 今天遇到了这个比较坑.
Error while executing topic command : replication factor: 2 larger
kafka-topics --create --topic event_topic --zookeeper x.x.x.x --replication-factor 2 --partitions 3 --config retention.ms=600000
然后就报了这么一大堆错误:
Error while executing topic command : replication factor: 2 larger than available brokers: 0
20/04/16 11:01:15 ERROR admin.TopicCommand$: org.apache.kafka.common.errors.InvalidReplicationFactorException: replication factor: 2 larger than available brokers: 0
百思不得解 .
然后去看了 config .
发现 config 的 zookeeper.connect 写的不是ip 是主机名. 于是在命令行上改为主机名.
竟然ok 了.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/133735/viewspace-2686462/ ,如需转载,请注明出处,否则将追究法律责任。