Open nhatthanh020996 opened 9 months ago
Hello there nhatthanh020996! π
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. π
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: 'localhost:9092'
If you point to localhost within a container it will send requests to the container's loopback interface and since Kafka lives in another container this cannot work.
Instead put kafka ui and kafka on the same docker network and resolve using the container name like so :
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: 'kafka:9092'
I have this configured appropriately:
environment:
DYNAMIC_CONFIG_ENABLED: 'true'
KAFKA_CLUSTERS_0_NAME: relay-cluster
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
And I am still getting this error in the logs:
kafka-ui | 2024-08-24 15:50:31,526 WARN [kafka-admin-client-thread | kafka-ui-admin-1724514626-3] o.a.k.c.NetworkClient: [AdminClient clientId=kafka-ui-admin-1724514626-3] Connection to node 1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
Same problem here, I'm trying with kafka local (docker.io/confluentinc/confluent-local image). I tried both configuration with environment variables:
nerdctl run -d --name kafka-ui -p 8080:8080 -e "KAFKA_CLUSTERS_0_NAME=local0" -e "KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka:9092" provectuslabs/kafka-ui
and with dynamic_config.yaml:
auth:
type: DISABLED
kafka:
clusters:
- bootstrapServers: kafka:9092
name: local-cluster
properties:
security.protocol: PLAINTEXT
readOnly: false
rbac:
roles: []
webclient: {}
nerdctl run -d --name kafka-ui -p 8080:8080 -e DYNAMIC_CONFIG_ENABLED=true -e LOGGING_LEVEL_ROOT=DEBUG -v "C:\PSI\LIM\dynamic_config.yaml:/etc/kafkaui/dynamic_config.yaml" provectuslabs/kafka-ui
But I have the same problem:
[30m2024-11-22 11:44:36,908[0;39m [31mWARN [0;39m [[34mkafka-admin-client-thread | kafka-ui-admin-1732275876-27[0;39m] [33mo.a.k.c.NetworkClient[0;39m: [AdminClient clientId=kafka-ui-admin-1732275876-27] Connection to node 1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
Then some debug log:
[30m2024-11-22 11:44:37,003[0;39m [39mDEBUG[0;39m [[34mkafka-admin-client-thread | kafka-ui-admin-1732275876-27[0;39m] [33mo.a.k.c.ClientUtils[0;39m: Resolved host localhost as 127.0.0.1
[30m2024-11-22 11:44:37,003[0;39m [39mDEBUG[0;39m [[34mkafka-admin-client-thread | kafka-ui-admin-1732275876-27[0;39m] [33mo.a.k.c.NetworkClient[0;39m: [AdminClient clientId=kafka-ui-admin-1732275876-27] Initiating connection to node localhost:9092 (id: 1 rack: null) using address localhost/127.0.0.1
[30m2024-11-22 11:44:37,003[0;39m [39mDEBUG[0;39m [[34mkafka-admin-client-thread | kafka-ui-admin-1732275876-27[0;39m] [33mo.a.k.c.n.Selector[0;39m: [AdminClient clientId=kafka-ui-admin-1732275876-27] Connection with localhost/127.0.0.1 (channelId=1) disconnected
If I try to change the port to 9094, it seems to convert the host name Kafka to the correct ip address:
[30m2024-11-22 11:44:37,770[0;39m [39mDEBUG[0;39m [[34mkafka-admin-client-thread | kafka-ui-admin-1732275471-20[0;39m] [33mo.a.k.c.NetworkClient[0;39m: [AdminClient clientId=kafka-ui-admin-1732275471-20] Initiating connection to node kafka:9094 (id: -1 rack: null) using address kafka/10.4.0.113
Why does it try to connect in localhost if I use port 9092?
Issue submitter TODO list
Is your proposal related to a problem?
This is my docker compose file that helps me to create my kafka server.
kafka_server_jaas.conf
This is my docker for creating kafka-ui
I get the following error after runing kafka-ui docker:
AdminClient clientId=kafka-ui-admin-1707208145-7] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
Describe the feature you're interested in
I want to log into the kafka server successfully.
Describe alternatives you've considered
I did read this issue, however the issue still remain. https://github.com/provectus/kafka-ui/issues/573
Version you're running
the latest version
Additional context
No response