Kafka topic no longer exists after restart

前端 未结 3 1828
傲寒
傲寒 2021-01-21 12:15

I created a topic in my local kafka cluster with 3 servers / brokers by running the following from my kafka installation directory

bin/kafka-topics.sh --create         


        
3条回答
  •  有刺的猬
    2021-01-21 12:37

    kafka-topics.sh actually uses zookeeper data under the hood to answer the query. The rationale being that a single broker generally can't have enough information by itself to describe topics completely.

    If you lost (which I suspect you did, since you mention a new zookeeper start) zookeeper data during your restart process, kafka-topics is now totally blind and can't see former kafka data.

    The best way to check what's happening is to actually do what kafka is doing when you query it ! Launch your zookeeper client (it's as simple as doing ./zkCli.sh, and type ls /brokers/topics. If it's empty, your ZK data is lost.

提交回复
热议问题