provectus / kafka-ui

Open-Source Web UI for Apache Kafka Management
Apache License 2.0
8.97k stars 1.1k forks source link

could not be established. Broker may not be available. #4403

Closed CesaragsUC closed 2 months ago

CesaragsUC commented 3 months ago

Issue submitter TODO list

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

github-actions[bot] commented 3 months ago

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. 👀

CesaragsUC commented 3 months ago

can help?

buniql commented 2 months ago

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!

CesaragsUC commented 2 months ago

I Fixed this The problem was in this line.

KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS

Should be

KAFKA_CLUSTERS_1_BOOTSTRAPSERVERS

KAFKA_CLUSTERS_2_BOOTSTRAPSERVERS

And so on.

just use this my compose as example , Here my git hub https://github.com/CesaragsUC/kafka-connect-mongodb

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Lukas @.> Sent: Monday, April 22, 2024 4:59:40 AM To: provectus/kafka-ui @.> Cc: Cesar Augusto @.>; Author @.> Subject: Re: [provectus/kafka-ui] could not be established. Broker may not be available. (Issue #4403)

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:

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

— Reply to this email directly, view it on GitHubhttps://github.com/provectus/kafka-ui/issues/4403#issuecomment-2068739863, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AF7ZOU7MRCCDSD6AMGGTGUDY6S7OZAVCNFSM6AAAAABERFQAEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRYG4ZTSOBWGM. You are receiving this because you authored the thread.Message ID: @.***>

buniql commented 2 months ago

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 :)