0

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?

fneron
  • 1,057
  • 3
  • 15
  • 39

2 Answers2

0

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

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
0

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
fneron
  • 1,057
  • 3
  • 15
  • 39
  • I'm now running into another issue when I try to run my python code to create a bridge between MQTT and Kafka: https://stackoverflow.com/questions/73656274/building-mqtt-and-kafka-bridge-getting-pykafka-exceptions – fneron Sep 09 '22 at 01:52
  • Did you build these yourself? If not, who maintains those images? Did you try the images I mentioned in my answer? – OneCricketeer Sep 10 '22 at 02:02
  • They are maintained and published on Dockerhub - the official source. – fneron Sep 12 '22 at 13:48
  • There is no "official" kafka Docker image, last I checked. Those are published by Canonical. That didn't answer my second question, though – OneCricketeer Sep 12 '22 at 13:52
  • I'm not maintaining any images, I'm just pulling them from DockerHub. I did not try to use the Confluent one. – fneron Sep 12 '22 at 15:21