Kafka consumer fetching metadata for topics failed

前端 未结 4 1659
情话喂你
情话喂你 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 12:59

    The broker tells the client which hostname should be used to produce/consume messages. By default Kafka uses the hostname of the system it runs on. If this hostname can not be resolved by the client side you get this exception.

    You can try setting advertised.host.name in the Kafka configuration to an hostname/address which the clients should use.

    0 讨论(0)
  • 2020-12-28 13:00

    Ran into this error on AWS. Problem was I was overly restrictive with the security group and set ports 2181 and 9092 to "my IP". This meant the kafka instance couldn't find the ZK running on the same box.

    Solution - open it up - a little.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-28 13:22

    You have a problem with Zookeeper. 255.255.255.255:2181 is not a valid Zookeeper address; this is a broadcast address on your network or a subnet mask. To make the things work, find the IP Address or hostname of the machine running Zookeeper.

    0 讨论(0)
提交回复
热议问题