查看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
版权归原作者 我超级能吃的 所有, 如有侵权,请联系我们删除。