Search code examples
dockerapache-kafkaapache-zookeeperbitnami

Bitnami Kafka/Zookeper docker-compose gets me : KeeperErrorCode = NoAuth for /consumers


when trying to start a zookeeper and kafka cluster with this docker-compose.yml

services:

  zookeeper1:
    image: 'bitnami/zookeeper:latest'
    ports:
      - '2181:2181'
      - '2888:2888'
      - '3888:3888'
      - '8080:8080'
    volumes:
      - zoo-persistence1:/bitnami/zookeeper
    environment:
      - ZOO_SERVER_ID=1
      - ZOO_SERVERS=zookeeper1:2888:3888
      - ZOO_ENABLE_AUTH=yes
      - ZOO_SERVER_USERS=kafka
      - ZOO_SERVER_PASSWORDS=password
      - ZOO_CLIENT_USER=kafka
      - ZOO_CLIENT_PASSWORD=password

  kafka1:
    image: 'bitnami/kafka:latest'
    ports:
      - "9092:9092"
    environment:
      - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper1:2181
      - KAFKA_CFG_BROKER_ID=1
      - ALLOW_PLAINTEXT_LISTENER=yes
      - KAFKA_ZOOKEEPER_USER=kafka
      - KAFKA_ZOOKEEPER_PASSWORD=password
      - KAFKA_CLIENT_USERS=kafka
      - KAFKA_CLIENT_PASSWORDS=password
    volumes:
      - kafka_1_data:/bitnami/kafka
    depends_on:
      - zookeeper1

volumes:
  zoo-persistence1:
  kafka_1_data:

I receive the following exception:

[2022-08-03 12:12:26,260] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
2022-08-03T12:12:26.263406700Z org.apache.zookeeper.KeeperException$NoAuthException: KeeperErrorCode = NoAuth for /config

actually I don´t get it. Something with the users. But which attribute is wrong or missing. The documentation is not of great help here

see : https://hub.docker.com/r/bitnami/zookeeper, https://hub.docker.com/r/bitnami/kafka

Michael


Solution

  • Found it : kafka containers are missing the - KAFKA_ZOOKEEPER_PROTOCOL=SASL environment