Created
January 22, 2025 13:37
-
-
Save aks2291/234f281301c81964b23f723eca0e391b to your computer and use it in GitHub Desktop.
Kafka Setup with UI dashboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| zookeeper: | |
| image: confluentinc/cp-zookeeper:latest | |
| environment: | |
| ZOOKEEPER_CLIENT_PORT: 2181 | |
| ZOOKEEPER_TICK_TIME: 2000 | |
| ports: | |
| - '2181:2181' | |
| kafka: | |
| image: confluentinc/cp-kafka:latest | |
| environment: | |
| KAFKA_BROKER_ID: 1 | |
| KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | |
| KAFKA_LISTENERS: INSIDE://0.0.0.0:9092,OUTSIDE://0.0.0.0:9094 | |
| KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9092,OUTSIDE://localhost:9094 | |
| KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT | |
| KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE # Set this to INSIDE or OUTSIDE | |
| KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 6000 | |
| KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 6000 | |
| KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
| ports: | |
| - '9092:9092' | |
| - '9094:9094' | |
| depends_on: | |
| - zookeeper | |
| kafka-ui: | |
| image: provectuslabs/kafka-ui:latest | |
| ports: | |
| - "8080:8080" | |
| environment: | |
| KAFKA_CLUSTERS_0_NAME: local | |
| KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092 | |
| KAFKA_CLUSTERS_0_READONLY: "false" | |
| AUTH_TYPE: "LOGIN_FORM" | |
| SPRING_SECURITY_USER_NAME: admin | |
| SPRING_SECURITY_USER_PASSWORD: pass | |
| depends_on: | |
| - kafka |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kafka setup in KRAFT Mode
This setup doesn't require zookeeper (Not recommended for production)
How to use it
Everything will be the same as the above with zookeeper setup for deploying and way to connect to the broker