Error while executing topic command : replication factor: 3 larger than available brokers: 2scala
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個。code