KRaft模式下的Kafka不断询问Zookeeper

问题描述 投票:0回答:1

我有这个 docker-compose 配置:

  kafka:
    image: confluentinc/cp-kafka:latest
    container_name: 'virl-kafka'
    restart: always
    ports:
      - "9092:9092"
    environment:
      KAFKA_KRAFT_MODE: "true"
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT
      KAFKA_LISTENERS: INTERNAL://0.0.0.0:9092
      KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9092
      KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
      KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"  # Optional, set to true if you want auto-creation of topics
      KAFKA_DELETE_TOPIC_ENABLE: "false"  # Optional, set to true if you want to allow topic deletion

当卡夫卡启动时它会说:

virl-kafka     | ===> User
virl-kafka     | uid=1000(appuser) gid=1000(appuser) groups=1000(appuser)
virl-kafka     | ===> Configuring ...
virl-kafka     | Running in Zookeeper mode...
virl-kafka     | KAFKA_ZOOKEEPER_CONNECT is required.
virl-kafka     | Command [/usr/local/bin/dub ensure KAFKA_ZOOKEEPER_CONNECT] FAILED !

为什么还在尝试使用Zookeeper?

apache-kafka docker-compose apache-kafka-connect apache-zookeeper confluent-platform
1个回答
0
投票

我查看了启动此 docker 映像时运行的配置文件。我想这将为您提供 KRAFT 模式所需的一些线索。我想你需要看看 KAFKA_PROCESS_ROLES。

https://github.com/confluenceinc/kafka-images/blob/master/kafka/include/etc/confluence/docker/configure

这里有更多文档https://docs.confluence.io/platform/current/installation/docker/config-reference.html#required-ak-configurations-for-kraft-mode

© www.soinside.com 2019 - 2024. All rights reserved.