Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Error while executing topic command : replication factor: 1 larger than available brokers: 0

Error while executing topic command : replication factor: 1 larger than available brokers: 0

Explorer

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.

15 REPLIES 15
Highlighted

Re: Error while executing topic command : replication factor: 1 larger than available brokers: 0

Contributor
@Jeeva Jeeva

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.

Re: Error while executing topic command : replication factor: 1 larger than available brokers: 0

Explorer

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.

Re: Error while executing topic command : replication factor: 1 larger than available brokers: 0

Contributor

@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/

Re: Error while executing topic command : replication factor: 1 larger than available brokers: 0

Explorer

Hi,

I ran the command as you said. Here is the ouptut.

broker-id.png

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) ~ ~

 

Re: Error while executing topic command : replication factor: 1 larger than available brokers: 0

Explorer

Thanks for your reply. Here I have attached the Kafka-Broker screenshot for your reference. kafka-error.png

Re: Error while executing topic command : replication factor: 1 larger than available brokers: 0

Explorer

Hi,

Here I have attached the screenshot. Please take a look to what the error is.kaferror.png

Re: Error while executing topic command : replication factor: 1 larger than available brokers: 0

Expert Contributor

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.

Re: Error while executing topic command : replication factor: 1 larger than available brokers: 0

Explorer

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

Re: Error while executing topic command : replication factor: 1 larger than available brokers: 0

Expert Contributor

try to check the zkCli, to see whether you are able to connect to zookeeper. As mentioned above post.

Don't have an account?
Coming from Hortonworks? Activate your account here