0

I'm trying to run several containers using docker-compose with the following config:

version: "2.1"
services:
    # Kafka/Zookeeper container
  kafka:
    build: kafka/
    container_name: kafka
    environment:
      - ADVERTISED_HOST=localhost
      - LOG_RETENTION_HOURS=1
      - AUTO_CREATE_TOPICS=false
      - KAFKA_CREATE_TOPICS=divolte:4:1
    ports:
      - 9092:9092 # kafka broker
      - 2181:2181 # Zookeeper
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
  # Divolte container
  divolte:
    image: divolte/divolte-collector
    container_name: divolte
    environment:
      - DIVOLTE_KAFKA_BROKER_LIST=localhost:9092
    volumes:
      - ./conf/divolte/:/opt/divolte/divolte-collector/conf/
    ports:
      - 8290:8290
    depends_on:
      - kafka
    links:
      - kafka:kafka

And I get the following error everytime. Everything else seems to be working fine.

kafka       | 2020-03-27 21:46:33,260 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
kafka       | 2020-03-27 21:46:33,260 INFO Included extra file "/etc/supervisord.d/initialize.ini" during parsing
kafka       | 2020-03-27 21:46:33,260 INFO Included extra file "/etc/supervisord.d/kafka.ini" during parsing
kafka       | 2020-03-27 21:46:33,260 INFO Included extra file "/etc/supervisord.d/zookeeper.ini" during parsing
kafka       | /usr/lib/python3.6/site-packages/supervisor/options.py:471: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
kafka       |   'Supervisord is running as root and it is searching '
kafka       | Error: Cannot open an HTTP server: socket.error reported errno.ENOENT (2)
kafka       | For help, use /usr/bin/supervisord -h

Btw, I'm trying to test from this website: https://godatadriven.com/blog/real-time-analytics-divolte-kafka-druid-superset/

I have been trying to fix it with no success (tried to change permissions and directories)

Thank you for the help.

João
  • 13
  • 1
  • 5
  • You might want to raise an issue against the github repo from which that Docker image originates: https://github.com/krisgeus/docker-kafka – Robin Moffatt Mar 27 '20 at 22:31

1 Answers1

0

This will never work.

- DIVOLTE_KAFKA_BROKER_LIST=localhost:9092

You are telling the divolte container to point at itself. It should at the very least be kafka:9092. And you must change ADVERTISED_HOST of the Kafka container to advertise its hostname.

  kafka:
    build: kafka/
    container_name: kafka
    hostname: kafka  # added
    environment:
      - ADVERTISED_HOST=kafka  # changed
      - LOG_RETENTION_HOURS=1
      - AUTO_CREATE_TOPICS=false
      - KAFKA_CREATE_TOPICS=divolte:4:1
    ports:
      - 9092:9092 # kafka broker
      - 2181:2181 # Zookeeper

See answer - Connect to Kafka running in Docker

Also - Try not running Zookeper and Kafka in the same image just for purpose of convience. It works better when they are separate.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245