Kafka consumer fetching metadata for topics failed

前端 未结 4 1695
情话喂你
情话喂你 2020-12-28 12:20

I am attempting to write a Java client for a third party\'s Kafka and ZooKeeper servers. I am able to list and describe topics, but when I attempt to read any, a Close

4条回答
  •  忘掉有多难
    2020-12-28 13:13

    Here is my way to solve this problem:

    1. run bin/kafka-server-stop.sh to stop running kafka server.
    2. modify the properties file config/server.properties by adding a line: listeners=PLAINTEXT://{ip.of.your.kafka.server}:9092
    3. restart kafka server.

    Since without the lisener setting, kafka will use java.net.InetAddress.getCanonicalHostName() to get the address which the socket server listens on.

提交回复
热议问题