-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkafka-cluster.yaml
73 lines (68 loc) · 1.93 KB
/
kafka-cluster.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
version: '3.8'
services:
zookeeper:
image: zookeeper
restart: always
hostname: zookeeper
container_name: zookeeper
ports:
- 2181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_SERVERS: zoo1:2888:3888
kafka-1:
image: 'confluentinc/cp-kafka'
hostname: kafka-1
container_name: kafka-1
ports:
- 9091:9091
environment:
- KAFKA_BROKER_ID=1
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=3
- DEFAULT_REPLICATION_FACTOR=3
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka-1:9091
- KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9091
- BOOTSTRAP_SERVERS=kafka-1:9091,kafka-2:9092,kafka-3:9093
- ZOOKEEPER=zookeeper:2181
depends_on:
- zookeeper
kafka-2:
image: 'confluentinc/cp-kafka'
hostname: kafka-2
container_name: kafka-2
ports:
- 9092:9092
environment:
- KAFKA_BROKER_ID=2
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=3
- DEFAULT_REPLICATION_FACTOR=3
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka-2:9092
- KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092
- BOOTSTRAP_SERVERS=kafka-1:9091,kafka-2:9092,kafka-3:9093
- ZOOKEEPER=zookeeper:2181
depends_on:
- zookeeper
kafka-3:
image: 'confluentinc/cp-kafka'
hostname: kafka-3
container_name: kafka-3
ports:
- 9093:9093
environment:
- KAFKA_BROKER_ID=3
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=3
- DEFAULT_REPLICATION_FACTOR=3
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka-3:9093
- KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9093
- BOOTSTRAP_SERVERS=kafka-1:9091,kafka-2:9092,kafka-3:9093
- ZOOKEEPER=zookeeper:2181
depends_on:
- zookeeper
networks:
default:
name: local-environment
external: true