简体   繁体   中英

Kafka service unable to run/start on container

Couple of things to know:

  • Using a raspberry pi 4
  • Running Unbuntu 20.04 image on ri4
  • I use ZeroTier and SSH to connect remotely to the ri4
  • I was able to run 3 containers: nodered, mosquito and portainer.

I'm having issues with different Zookeeper and/or Kafka images when trying to run/start the Kafka service. I wonder if I have to use a specific image due to the arm64 architecture since I'm using a ri4.

So far, I've used the general images:

  • confluent, bitnami and wurstmeister.

Here's a section of my docker-compose:

  zookeeper:
    image: confluent/zookeeper
    container_name: zookeeper
    environment:
      - ZOOKEEPER_CLIENT_PORT=2181
  kafka:
    image: confluent/kafka
    container_name: kafka
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=kafka
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_CREATE_TOPICS=mqtt-sensor-1
    depends_on:
      - zookeeper
    restart: on-failure

I'm always getting this error from Kafka whenever I initiate a docker-compose up:

kafka        | exec /usr/local/bin/kafka-docker.sh: exec format error

I'm not getting anything else. Any idea?

The Docker images you want are in the confluentinc/ repo, and latest versions support multi-arch builds.

This seems to do the trick, with the ubuntu images (supports ARM64):

  zookeeper:
    image: ubuntu/zookeeper
    container_name: zookeeper
    ports:
      - "2181:2181"
  kafka:
    image: ubuntu/kafka
    container_name: kafka
    ports:
      - "9092:9092"
    environment:
      - KAFKA_ADVERTISED_HOST_NAME=kafka
      - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
      - KAFKA_CREATE_TOPICS= "mqtt-sensor-1:1:1"
      - KAFKA_DELETE_TOPIC_ENABLE=true
    depends_on:
      - zookeeper
    restart: on-failure

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM