This is the command I ran.
bin/kafka-topics.sh --create --zookeeper cmtoldhwdpadm03.dev.bmocm.com:2181 --replication-factor 1 --partitions 1 --topic test21 Error while executing topic command : replication factor: 1 larger than available brokers: 0
I am getting the below error.
ERROR kafka.admin.AdminOperationException: replication factor: 1 larger than available brokers: 0 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$)
But, I am seeing in Ambari, There are two brokers has been started. Please help me. Thanks.
understand that your zookeeper is running. Want you to run zkCli at the command line, so that we can check whether it can connect from nodes to the zookeeper server.
not sure what are the url for your zookeeper sever. you should run as /usr/hdp/current/zookeeper-server/bin/zkCli.sh -server cmtoldhwdpadm03.dev.bmocm.com:2181 if cmtoldhwdpadm03.dev.bmocm.com is your zookeeper server.
Now, please follow the steps below:
/usr/hdp/current/zookeeper-server/bin/zkCli.sh -server cmtoldhwdpadm01.dev.bmocm.com
ls /brokers/ids/ <-- here you should see two ids as there are two broker nodes
get /brokers/ids/<id1> and <id2> <--- Please share the output
Just check the value of "zookeeper.chroot"(znode in ZooKeeper used as a root for Kafka cluster) property in your Kafka configurations. According to the command, which you have mentioned, it should be '/'.
i.e connect to the correct znode for kafka.