provectus / kafka-ui

Open-Source Web UI for Apache Kafka Management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

could not be established. Broker may not be available.

CesaragsUC opened this issue Β· comments

Issue submitter TODO list

  • I've looked up my issue in FAQ
  • I've searched for an already existing issues here
  • I've tried running master-labeled docker image and the issue still persists there
  • I'm running a supported version of the application which is listed here

Describe the bug (actual behavior)

Hi,
i new with kafka, then i tried use this great ui v0.7.1, but after run de compose. I can access the ui normaly, but when i try create a new cluster i get error :

Expected behavior

No response

Your installation details

version: "3.7"
services:
  kafka-ui:
    container_name: kafka-ui
    image: provectuslabs/kafka-ui:latest
    ports:
      - 8080:8080
    environment:
      DYNAMIC_CONFIG_ENABLED: 'true'
    volumes:
      - ~/kui/config.yml:/etc/kafkaui/dynamic_config.yaml

Steps to reproduce

docker run -it -p 8080:8080 -e DYNAMIC_CONFIG_ENABLED=true provectuslabs/kafka-ui

Screenshots

i saw the log i in the console show this.
Screenshot_1

Logs

024-03-11 22:40:38,884 INFO [kafka-admin-client-thread | kafka-ui-admin-1710196838-1] o.a.k.c.NetworkClient: [AdminClient clientId=kafka-ui-admin-1710196838-1] Node -1 disconnected.
2024-03-11 22:40:38,886 WARN [kafka-admin-client-thread | kafka-ui-admin-1710196838-1] o.a.k.c.NetworkClient: [AdminClient clientId=kafka-ui-admin-1710196838-1] Connection to node -1 (/127.0.0.1:9092) could not be established. Broker may not be available.

Kafka Cluster
Error connecting to cluster. See logs for details.

Additional context

No response

Hello there CesaragsUC! πŸ‘‹

Thank you and congratulations πŸŽ‰ for opening your very first issue in this project! πŸ’–

In case you want to claim this issue, please comment down below! We will try to get back to you as soon as we can. πŸ‘€

can help?

commented

Hey, I'm encountering the same issue. I tried adding kafka-ui (v0.7.2) in my docker-compose, but I couldn't manage to get a connection to the broker.

version: "2"

services:
  kafka:
    image: docker.io/bitnami/kafka:3.7
    ports:
      - "9092:9092"
    volumes:
      - "kafka_data:/bitnami"
    environment:
      # KRaft settings
      - KAFKA_CFG_NODE_ID=0
      - KAFKA_CFG_PROCESS_ROLES=controller,broker
      - KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093
      # Listeners
      - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
      - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092
      - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
      - KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
      - KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT

  kafka-ui:
    image: provectuslabs/kafka-ui
    depends_on:
      - kafka
    ports:
      - "8080:8080"
    environment:
      DYNAMIC_CONFIG_ENABLED: 'true'
      KAFKA_CLUSTERS_0_NAME: kafkacluster
      #KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: 'kafka:9092' <- doesn't work either
      KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: 'localhost:9092,broker:9092'
volumes:
  kafka_data:
    driver: local

I couldn't find any information on this, any help is highly appreciated!

commented

Thanks for the response!
I've made some changes and now it works. Here is my updated docker-compose.yml, if anyone needs it:

version: "2"

services:
  kafka:
    image: docker.io/bitnami/kafka:3.7
    hostname: kafka
    ports:
      - "9092:9092"
      - "9094:9094"
    volumes:
      - "kafka_data:/bitnami"
    environment:
      # KRaft settings
      - KAFKA_ENABLE_KRAFT=yes
      - KAFKA_CFG_NODE_ID=0
      - KAFKA_CFG_PROCESS_ROLES=controller,broker
      - KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@localhost:9093
      # Listeners
      - KAFKA_BROKER_ID=0
      - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
      - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092,EXTERNAL://kafka:9094
      - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT
      - KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
      - KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
      - ALLOW_PLAINTEXT_LISTENER=yes
      - KAFKA_AUTO_CREATE_TOPICS_ENABLE=true

  kafka-ui:
    image: provectuslabs/kafka-ui
    depends_on:
      - kafka
    ports:
      - "8080:8080"
    environment:
      DYNAMIC_CONFIG_ENABLED: 'true'
      KAFKA_CLUSTERS_0_NAME: kafkacluster
      KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: 'kafka:9094'
volumes:
  kafka_data:
    driver: local

If anyone encounters this problem, I can highly recommend the following article: https://medium.com/@tetianaokhotnik/setting-up-a-local-kafka-environment-in-kraft-mode-with-docker-compose-and-bitnami-image-enhanced-29a2dcabf2a9

Thanks again, the issue can be closed now :)