- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Error while executing topic command : replication factor: 1 larger than available brokers: 0
- Labels:
-
Apache Kafka
Created ‎02-23-2017 08:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
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.
Created ‎02-23-2017 08:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you please confirm if all brokers/broker in your cluster is up and running ? If not please start your broker node and try to execute create topic command.
Created ‎02-23-2017 08:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi amankumbare,
Thanks for your reply. I am seeing in the ambari, the broker status are started. There are 2 brokers. Both are started. But, still I am getting the error. Because of this , I am stuck at office work.
Created ‎02-23-2017 08:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Jeeva Jeeva Could you please check in zookeeper if they are registered :
Execute below command to login to zkcli : /usr/hdp/current/zookeeper-server/bin/zkCli.sh
ls /brokers/ids/<id's> <-- here you should see two ids as there are two broker nodes
get /brokers/ids/<id1> and <id2> <--- Please share the output
Do you see any error is server.log which is located at /var/log/kafka/
Created ‎02-23-2017 09:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I ran the command as you said. Here is the ouptut.
also I checked the vi /var/log/kafka/server.log.2017-02-23-14
[2017-02-23 14:07:13,099] INFO [Group Metadata Manager on Broker 1]: Removed 0 expired offsets in 0 milliseconds. (kafka.coordinator.GroupMetadataManager) [2017-02-23 14:17:13,099] INFO [Group Metadata Manager on Broker 1]: Removed 0 expired offsets in 0 milliseconds. (kafka.coordinator.GroupMetadataManager) [2017-02-23 14:27:13,099] INFO [Group Metadata Manager on Broker 1]: Removed 0 expired offsets in 0 milliseconds. (kafka.coordinator.GroupMetadataManager) [2017-02-23 14:37:13,099] INFO [Group Metadata Manager on Broker 1]: Removed 0 expired offsets in 0 milliseconds. (kafka.coordinator.GroupMetadataManager) [2017-02-23 14:47:13,099] INFO [Group Metadata Manager on Broker 1]: Removed 0 expired offsets in 0 milliseconds. (kafka.coordinator.GroupMetadataManager) [2017-02-23 14:57:13,099] INFO [Group Metadata Manager on Broker 1]: Removed 0 expired offsets in 0 milliseconds. (kafka.coordinator.GroupMetadataManager) ~ ~
Created ‎02-23-2017 08:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply. Here I have attached the Kafka-Broker screenshot for your reference. kafka-error.png
Created ‎02-24-2017 02:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Here I have attached the screenshot. Please take a look to what the error is.kaferror.png
Created ‎02-23-2017 08:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like your brokers are not running correctly, or at least not registered on the zookeeper. Please check the kafka server log, and see what's the reason for that. The server log is located at /var/log/kafka.
Created ‎02-23-2017 08:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Frank,
Thanks for your reply. I will check as you mentioned also here i have attached the kafka broker screenshot for your reference. Thanks again!kafka-error.png
Created ‎02-23-2017 08:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try to check the zkCli, to see whether you are able to connect to zookeeper. As mentioned above post.
