简体   繁体   中英

Getting Error when trying to list Kafka topics

I am new to Apache Kafka and trying to list kafka topics. I'm using --bootstrap-server and the following command.

kafka-topics.sh --bootstrap-server localhost:9092 --list

I am getting the following error when run the command.

[2022-11-22 17:15:10,646] WARN [AdminClient clientId=adminclient-1] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) 

I also changed the server.properties file. I uncommented the listeners part and change it to the following.

listeners=PLAINTEXT://127.0.0.1:9092

kafka-topics.sh specifies a bootstrap server of localhost:9092 and is not finding it there. You need to start kafka on localhost first.

  1. Please undo your change to server.properties and

  2. start zookeeper with

    zookeeper-server-start.sh <path_to_your_kafka>/kafka_2.13-3.0.0/config/zookeeper.properties

  3. start kafka with

    kafka-server-start.sh <path_to_your_kafka>/kafka_2.13-3.0.0/config/server.properties

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM