Kafka 创建topic 时抛出 replication factor: 3 larger than available brokers: 0
在Kafka 创建topic时抛出如下错误信息:Error while executing topic command : replication factor: 3 larger than available brokers: 0[2019-05-26 13:17:23,160] ERROR org.apache.kafka.common.errors.InvalidReplic...
在Kafka 创建topic时抛出如下错误信息:
Error while executing topic command : replication factor: 3 larger than available brokers: 0
[2019-05-26 13:17:23,160] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException: replication factor: 3 larger than available brokers: 0
(kafka.admin.TopicCommand$)
分析
根据错误信息,可知要创建的topic副本数为3,而brokers 为0 。表示kafka没有获取到zookeeper中的存储brokers信息。
排查
1、检查kafka集群是否启动,或者集群挂掉了。另外需要注意:创建的topic 副本数不能大于 集群中存活的broker数,否则或抛出相似错误,如: replication factor: 3 larger than available brokers: 2
2、需要检查 zookeeper连接参数是否正确。即:服务器中kafka server的zookeeper.connect参数是与 --zookeeper 参数保持一直
zookeeper.connect=hadoop001:2181,hadoop002:2181,hadoop003:2181/kafka
--zookeeper hadoop001:2181,hadoop002:2181,hadoop003:2181
最终将 --zookeeper参数改为 hadoop001:2181,hadoop002:2181,hadoop003:2181/kafka 就行
3、zookeeper 元数据是否被删除
更多推荐
所有评论(0)