Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-13003

KafkaBroker advertises socket port instead of the configured advertised port

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.8.0
    • 3.0.0
    • core

    Description

      In Kraft mode Apache Kafka 2.8.0 does advertise the socket port instead of the configured advertised port.

      A broker given with the following configuration

      listeners=PUBLIC://0.0.0.0:19092,REPLICATION://0.0.0.0:9091
      advertised.listeners=PUBLIC://envoy-kafka-broker:9091,REPLICATION://kafka-broker1:9091
      

      advertises on the PUBLIC listener envoy-kafka-broker:19092, however I would expect that envoy-kafka-broker:9091 is advertised. In ZooKeeper mode it works as expected.

      In a deployment with a L4 proxy in front of the Kafka cluster, it is important, that the advertised port can be different from the actual socket port.

      I tested it with a Docker-Compose setup which runs 3 Kafka Broker in Kraft mode and an Envoy proxy in front of them. With Apache Kafka 2.8.0 it does not work, because Kafka does not advertise the configured advertised port. For more details see: https://github.com/ueisele/kafka/tree/fix/kraft-advertisedlisteners-build/proxy-examples/proxyl4-kafkakraft-bug-2.8

      Client – 909[1-3] --> Envoy Proxy – 19092 --> Kafka Broker [1-3]

      Envoy Host Envoy Port Kafka Broker Kafka Port Advertised Listener
      envoy-kafka-broker 9091 kafka-broker1 19092 envoy-kafka-broker:9091
      envoy-kafka-broker 9092 kafka-broker2 19092 envoy-kafka-broker:9092
      envoy-kafka-broker 9093 kafka-broker3 19092 envoy-kafka-broker:9093
      > docker-compose exec kafkacat kafkacat -b envoy-kafka-broker:9091 -L
      Metadata for all topics (from broker -1: envoy-kafka-broker:9091/bootstrap):
       3 brokers:
        broker 101 at envoy-kafka-broker:19092
        broker 102 at envoy-kafka-broker:19092 (controller)
        broker 103 at envoy-kafka-broker:19092
       0 topics:
      

      Attachments

        Issue Links

          Activity

            People

              ueisele Uwe Eisele
              ueisele Uwe Eisele
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: