0

I am trying to configure SASL_PLAINTEXT authentication to kafka broker, below is my configuration.

advertised.listeners=SASL_PLAINTEXT://127.0.0.1:9092
listeners=SASL_PLAINTEXT://127.0.0.1:9092

security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
sasl.enabled.mechanisms=PLAIN
sasl.jaas.config=/var/lib/kafka/config/kafka_jaas.conf

After starting zookeeper and kafka I am getting below exception

java.lang.IllegalArgumentException: requirement failed: inter.broker.listener.name must be a listener name defined in advertised.listeners. The valid options based on currently configured listeners are PLAINTEXT java.lang.IllegalArgumentException: requirement failed: inter.broker.listener.name must be a listener name defined in advertised.listeners. The valid options based on currently configured listeners are PLAINTEXT at scala.Predef$.require(Predef.scala:233) at kafka.server.KafkaConfig.validateValues(KafkaConfig.scala:1089) at kafka.server.KafkaConfig.(KafkaConfig.scala:1065) at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:795) at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:792) at kafka.server.KafkaServerStartable$.fromProps(KafkaServerStartable.scala:28) at kafka.Kafka$.main(Kafka.scala:58) at kafka.Kafka.main(Kafka.scala)

Rumit Patel
  • 8,830
  • 18
  • 51
  • 70
krish
  • 11
  • 1
  • What are you setting as `inter.broker.listener.name`? That is missing from the question – OneCricketeer May 07 '19 at 23:38
  • @cricket_007 i am not setting it as per kafka documentation http://kafka.apache.org/0102/documentation.html#security_sasl_plain, it suggest only to set above parameters. do we need to explicitly set it? i believe it will pick the value of security.inter.broker.protocol if not set as per documentation. pls suggest. – krish May 09 '19 at 04:20
  • I was just reading what the error was saying. `inter.broker.listener.name must be a listener name defined in advertised.listeners` – OneCricketeer May 09 '19 at 20:48

1 Answers1

0

I had similar issues while setting up kafka_listeners on kubernetes. Following is a working kafka configuration yaml snippet:

    env:
    ...
   - name: ALLOW_PLAINTEXT_LISTENER
     value: “yes”
   - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
     value: INSIDE:PLAINTEXT
   - name: KAFKA_LISTENERS
     value: INSIDE://0.0.0.0:9092
   - name: KAFKA_ADVERTISED_LISTENERS
     value: INSIDE://localhost:9092
   - name: KAFKA_INTER_BROKER_LISTENER_NAME
     value: INSIDE

Similar issue discussed here with ssl configuration: cant figure out setting for inter broker listener name in kafka with ssl

Also this confluence page will be helpful.

Nandan
  • 497
  • 2
  • 7
  • 18