java.lang.IllegalArgumentException: requirement failed: sasl.mechanism.inter.broker.protocol must be included in sasl.enabled.mechanisms

Viewed 672

When I try to use docker-compose to start Kafka, got the error: java.lang.IllegalArgumentException: requirement failed: sasl.mechanism.inter.broker.protocol must be included in sasl.enabled.mechanisms when SASL is used for inter-broker communication

But I have already set sasl.mechanism.inter.broker.protocol in docker-compose.yml.

docker-compose.yml:

version: '2'

services:
  zookeeper:
    container_name: zookeeper      
    image: 'docker.io/bitnami/zookeeper:3-debian-10'
    ports:
      - '2181:2181'
    volumes:
      - 'zookeeper_data:/bitnami/zookeeper-data'
    environment:
      ZOO_ENABLE_AUTH: 'yes'             
      ZOO_SERVER_USERS: zookeeper-user
      ZOO_SERVER_PASSWORDS: zookeeper-password
  kafka:
    container_name: kafka-c      
    image: 'docker.io/bitnami/kafka:2-debian-10'
    ports:
      - '9095:9095'
    volumes:
      - 'kafka_data:/bitnami/kafka-data'
      - './kafka_server_jaas.conf:/bitnami/kafka/config/kafka_server_jaas.conf'
    hostname: kafka
    environment:
      KAFKA_ADVERTISED_PORT: 9095 
      KAFKA_ADVERTISED_HOST_NAME: kafka
      KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_CFG_LISTENERS: SASL_PLAINTEXT://:9095
      KAFKA_CFG_ADVERTISED_LISTENERS: SASL_PLAINTEXT://:9095
      KAFKA_INTER_BROKER_USER: admin
      KAFKA_INTER_BROKER_PASSWORD: admin-password
      KAFKA_ZOOKEEPER_USER: zookeeper-user
      KAFKA_ZOOKEEPER_PASSWORD: zookeeper-password
      KAFKA_OPTS: '-Djava.security.auth.login.config=/bitnami/kafka/config/kafka_server_jaas.conf'
      KAFKA_SASL_ENABLED_MECHANISMS: PLAIN
      KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN
      KAFKA_INTER_BROKER_LISTENER_NAME: SASL_PLAINTEXT
 
    depends_on:
      - zookeeper

volumes:
  zookeeper_data:
    driver: local
  kafka_data:
    driver: local

Dose anyone meets the same problem or any suggestion? Thank you!

0 Answers
Related