Error while executing topic command : replication factor: 3 larger than available brokers: 2

本文解析了在使用kafka-topics.sh命令创建主题时遇到的错误:replication factor大于可用broker数量。提供了详细的错误堆栈跟踪,并给出了正确的解决方案:确保复制因子小于或等于broker的数量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Error while executing topic command : replication factor: 3 larger than available brokers: 2

kafka-topics.sh --zookeeper 130.51.23.249:5101 --create --topic UserLoginLog --replication-factor 3 --partitions 1
# 会报错
Error while executing topic command : replication factor: 3 larger than available brokers: 2
[2018-12-12 17:02:16,220] ERROR kafka.admin.AdminOperationException: replication factor: 3 larger than available brokers: 2
        at kafka.admin.AdminUtils$.assignReplicasToBrokers(AdminUtils.scala:117)
        at kafka.admin.AdminUtils$.createTopic(AdminUtils.scala:403)
        at kafka.admin.TopicCommand$.createTopic(TopicCommand.scala:110)
        at kafka.admin.TopicCommand$.main(TopicCommand.scala:61)
        at kafka.admin.TopicCommand.main(TopicCommand.scala)
 (kafka.admin.TopicCommand$)

解决:replication-factor个数不能超过broker的个数。需改为少于等于2个。

转载于:https://my.oschina.net/u/2464371/blog/2988326

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值