Error creating Kafka Topics- Replication factor larger than available brokers

前端 未结 15 1915
时光取名叫无心
时光取名叫无心 2020-12-30 18:30

I am trying to create topics in Kafka by following the guide on Apache Kafka website through command line. While running the command:

bin/kafka-topics.sh --c         


        
相关标签:
15条回答
  • 2020-12-30 19:05

    For those who are sure that the brokers are up and running, check your server.properties configuration.

    In my case the znodes for kafka is /kafka as shown below.

    zookeeper.connect=zk1.beta:2181,zk2.beta:2181,zk3.beta:2181/kafka
    

    So, try the following command while creating topic:

    bin/kafka-topics.sh --create --zookeeper zk1.beta:2181/kafka --replication-factor 2 --partitions 2 --topic test2
    
    0 讨论(0)
  • 2020-12-30 19:06

    The same scenario I faced after deleting the only topic I had created.

    The way to solve it was put Kafka and Zookeeper down, updated Kafka settings (server.properties file) where I add the following setting

    delete.topic.enable=true
    

    saved file, turn Zookeeper and Kafka up and everything run as usual.

    0 讨论(0)
  • 2020-12-30 19:10

    Probably there is leftover, runaway zookeeper on your server from one of the previous deployments. List the pods, containers, processes, etc. and check their age/start time to spot it.

    0 讨论(0)
  • 2020-12-30 19:11

    Try adding in your serverwith:

    delete.topic.enable=true
    
    0 讨论(0)
  • 2020-12-30 19:12

    If I were you I would try this code:

    bin/kafka-topics.sh --create --zookeeper localhost:2181/kafka --replication-factor 1 --partitions 1 --topic test

    If you are using a cluster where zookeeper be distributed in 3 nodes you should substitue localhost:2181/kafka for direccion1:2181,direction2:2181,direction3:2181/kafka

    0 讨论(0)
  • 2020-12-30 19:12

    Delete the logs and consumer offsets folder which is getting created in the below directory.

    C:\Kafka\kafka_2.12-2.5.0\data\zookeeper

    PS: You may loose all the previous topic details.

    0 讨论(0)
提交回复
热议问题