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

Allow listeners to bind on same port but different interfaces

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.1
    • Fix Version/s: None
    • Component/s: network
    • Labels:
      None

      Description

      It's not possible to bind two listeners to two distinct network interfaces using the same port

      listeners=ONE://<ip1>:9092,TWO://<ip2>:9092
      advertised.listeners=ONE://<hostname1>:9092,TWO://<hostname2>:9092
      listener.security.protocol.map=ONE:PLAINTEXT,TWO:PLAINTEXT

      Kafka server returns an error:

      [2019-12-02 13:07:18,256] ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
       java.lang.IllegalArgumentException: requirement failed: Each listener must have a different port, listeners: ONE://<ip1>:9092,TWO://<ip2>:9092
       at scala.Predef$.require(Predef.scala:281)
       at kafka.utils.CoreUtils$.validate$1(CoreUtils.scala:305)
       at kafka.utils.CoreUtils$.listenerListToEndPoints(CoreUtils.scala:316)
       at kafka.server.KafkaConfig.advertisedListeners(KafkaConfig.scala:1407)
       at kafka.server.KafkaConfig.validateValues(KafkaConfig.scala:1482)
       at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1460)
       at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1114)
       at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:1094)
       at kafka.server.KafkaServerStartable$.fromProps(KafkaServerStartable.scala:28)
       at kafka.Kafka$.main(Kafka.scala:68)
       at kafka.Kafka.main(Kafka.scala)

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gquintana Gérald Quintana
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: