ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

kafka学习问题

2026/8/10 23:08:06 拓冰建站 浏览量
kafka学习问题

查看topic列表报超时

报错如下:

Error while executing topic command : Timed out waiting for a node assignment. Call: listTopics
[2024-02-28 14:36:57,024] ERROR org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. Call: listTopics(kafka.admin.TopicCommand$)

解决方法:修改server.properties文件中的listeners

listeners=PLAINTEXT://ip:9092

停止kafka运行:

bin/kafka-server-stop.sh 

重新启动kafka:

bin/kafka-server-start.sh -daemon config/server.properties

再次查看topic列表,发现如下报错:

bin/kafka-topics.sh --bootstrap-server 192.168.15.187:9092 --list#报错内容
[2024-02-28 14:57:22,420] WARN [AdminClient clientId=adminclient-1] Connection to node -1 (/192.168.15.187:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)

解决方法:修改server.properties文件中的advertised.listeners即可

advertised.listeners=PLAINTEXT://ip:9092