-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
23 lines (19 loc) · 1.18 KB
/
docker-compose.yml
File metadata and controls
23 lines (19 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
services:
kafka:
image: confluentinc/cp-kafka:7.8.3
container_name: kafka
ports:
- "9092:9092"
environment:
KAFKA_KRAFT_MODE: "true" # Enable KRaft mode instead of ZooKeeper
# Config the broker ID
# In real deployments, there are many brokers, each with a unique ID under a Kafka cluster
CLUSTER_ID: "justarandomclusterid1234"
KAFKA_BROKER_ID: 1
KAFKA_PROCESS_ROLES: broker,controller # this makes this broker both function as store and serve data as well as controll cluster coordination
KAFKA_CONTROLLER_QUORUM_VOTERS: "1@kafka:9093" # define the controller node(s) in the cluster
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 # Keep only one copy of metadate to track which messages have been consumed by whom, no backup
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092, CONTROLLER://0.0.0.0:9093 # The first port is for producer and consumer connections, the second is for connections between brokers in the cluster
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: /tmp/kafka/kafka_data # Where to store data files, broker logs, controller metadata