Reputation: 101
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
Upvotes: 0
Views: 1488
Reputation: 2657
kafka-topics.sh specifies a bootstrap server of localhost:9092 and is not finding it there. You need to start kafka on localhost first.
Please undo your change to server.properties and
start zookeeper with
zookeeper-server-start.sh <path_to_your_kafka>/kafka_2.13-3.0.0/config/zookeeper.properties
start kafka with
kafka-server-start.sh <path_to_your_kafka>/kafka_2.13-3.0.0/config/server.properties
Upvotes: 1