wurstmeister / kafka-docker

Dockerfile for Apache Kafka
http://wurstmeister.github.io/kafka-docker/
Apache License 2.0
6.89k stars 2.73k forks source link

Getting an error in zookeeper #734

Open Y07yoyo opened 1 year ago

Y07yoyo commented 1 year ago

Hi,

I am suddenly getting this error on my zookeeper logs:

image This is my docker-compose file:

version: '3.2'
services:
  zookeeper:
    image: wurstmeister/zookeeper
    ports:
      - "2181:2181"
    restart: "always"
  kafka:
    image: wurstmeister/kafka:latest
    depends_on:
      - zookeeper
    ports:
      - target: 9094
        published: 9094
        protocol: tcp
        mode: host
    restart: "always"
    environment:
      HOSTNAME_COMMAND: "route -n | awk '/UG[ \t]/{print $$2}'"
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
      KAFKA_ADVERTISED_LISTENERS: INSIDE://:9092,OUTSIDE://_{HOSTNAME_COMMAND}:9094
      KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:9094
      KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
      KAFKA_LOG_RETENTION_MS: 3600000
      KAFKA_LOG_RETENTION_HOURS: 1
      KAFKA_LOG_RETENTION_CHECK_INTERVAL_MS: 1800000
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
  viewer:
    image: 'obsidiandynamics/kafdrop'
    ports:
      - '9000:9000'
    restart: "always"
    environment:
      - KAFKA_BROKERCONNECT=kafka:9092
      - JVM_OPTS=-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify
    depends_on:
      - kafka
ChenZhongPu commented 1 year ago

The issue is also found in my computer. I suggest bitnami/zookeeper because it is well maintained.

opencmit2 commented 1 year ago

Please use the compose file I provided. I have been using this file,The image wurstmeister has been customized. You'd better use the same image of wurstmeister Note:

version: '3' services: zookeeper: image: wurstmeister/zookeeper

image: zookeeper

container_name: zookeeper
ports:
  - "2181:2181"
privileged: true

kafka1: image: wurstmeister/kafka ports: