Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-9213

debezium/kafka:3.2 fails to start when role is 'broker'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 3.4.0.CR1
    • 3.2.0.Final
    • container-images
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Important

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      If you run a "complex" kafka configuration in docker compose (for example) and you set at least one of the containers to the NODE_ROLE to 'broker', the containers fails to start and exits. 

      What behavior do you expect?

      I expect the container to start up normally and get it up and running.

      What behavior do you see?

      The container complains with the following message: 

       

      Starting in KRaft mode, using CLUSTER_ID=oh-sxaDRTcyAr6pFRbXyzA, NODE_ID=4 and NODE_ROLE=broker.
      Using configuration config/broker.properties.
      Using KAFKA_LISTENERS=PLAINTEXT://kafka-4:9092 and KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka-4:9092
      Enabling JMX on 0.0.0.0:9012
      No meta.properties found in /kafka/data/4; going to format the directory
      -Dlog4j.configuration=file:/kafka/config/log4j.properties
      DEPRECATED: A Log4j 1.x configuration file has been detected, which is no longer recommended.
      To use a Log4j 2.x configuration, please see https://logging.apache.org/log4j/2.x/migrate-from-log4j1.html#Log4j2ConfigurationFormat for details about Log4j configuration file migration.
      You can also use the $KAFKA_HOME/config/tools-log4j2.yaml file as a starting point. Make sure to remove the Log4j 1.x configuration after completing the migration.
      2025-07-10T10:16:38,749 - INFO  [main:Log4jControllerRegistration$@31] - Registered kafka:type=kafka.Log4jController MBean
      2025-07-10T10:16:43,257 - INFO  [main:AbstractConfig@371] - KafkaConfig values: [...]
             
      You can only use --standalone on a controller. 

       

      Do you see the same behaviour using the latest released Debezium version?

      Yes. I am using the latest version.

      How to reproduce the issue using our tutorial deployment?

      More or less using [this docker compose |https://github.com/debezium/debezium-examples/blob/main/tutorial/docker-compose-zookeeperless-kafka.yaml.] 

       

      Some modifications has to be done in order to use the latest kafka image.

      Implementation ideas (optional)

      Some modifications to docker-entrypoint.sh

      L90: Do not unset NODE_ROLE

      L175 Add the following if condition:

      standalone_mode=""                
      if [[ "$NODE_ROLE" != "broker" ]]; then
           standalone_mode="--standalone"                
      fi
      
      $KAFKA_HOME/bin/kafka-storage.sh format $standalone_mode -t $CLUSTER_ID -c $KAFKA_HOME/$CONFIG_FILE

              rh-ee-aviana Alvar Viana
              rh-ee-aviana Alvar Viana
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: