-
Notifications
You must be signed in to change notification settings - Fork 59
/
docker-compose.yml
125 lines (113 loc) · 3.33 KB
/
docker-compose.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# By default, this docker-compose setup uses Kafka 2.7.0. This version can
# be overwritten by setting the KAFKA_IMAGE_TAG environment variable.
#
# See https://hub.docker.com/r/bitnami/kafka/tags for the complete list.
version: '3'
services:
zookeeper:
container_name: zookeeper
hostname: zookeeper
image: bitnami/zookeeper:latest
ports:
- "2181:2181"
environment:
ALLOW_ANONYMOUS_LOGIN: yes
# Zone 1 brokers
kafka1:
container_name: kafka1
hostname: 169.254.123.123
image: bitnami/kafka:${KAFKA_IMAGE_TAG:-2.7.0}
ports:
- "9092:9092"
environment:
KAFKA_CFG_BROKER_ID: 1
KAFKA_CFG_BROKER_RACK: zone1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://169.254.123.123:9092
restart: on-failure
depends_on:
- zookeeper
kafka2:
container_name: kafka2
hostname: 169.254.123.123
image: bitnami/kafka:${KAFKA_IMAGE_TAG:-2.7.0}
ports:
- "9093:9092"
environment:
KAFKA_CFG_BROKER_ID: 2
KAFKA_CFG_BROKER_RACK: zone1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://169.254.123.123:9093
restart: on-failure
depends_on:
- zookeeper
# Zone 2 brokers
kafka3:
container_name: kafka3
hostname: 169.254.123.123
image: bitnami/kafka:${KAFKA_IMAGE_TAG:-2.7.0}
ports:
- "9094:9092"
environment:
KAFKA_CFG_BROKER_ID: 3
KAFKA_CFG_BROKER_RACK: zone2
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://169.254.123.123:9094
restart: on-failure
depends_on:
- zookeeper
kafka4:
container_name: kafka4
hostname: 169.254.123.123
image: bitnami/kafka:${KAFKA_IMAGE_TAG:-2.7.0}
ports:
- "9095:9092"
environment:
KAFKA_CFG_BROKER_ID: 4
KAFKA_CFG_BROKER_RACK: zone2
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://169.254.123.123:9095
restart: on-failure
depends_on:
- zookeeper
# Zone 3 brokers
kafka5:
container_name: kafka5
hostname: 169.254.123.123
image: bitnami/kafka:${KAFKA_IMAGE_TAG:-2.7.0}
ports:
- "9096:9092"
environment:
KAFKA_CFG_BROKER_ID: 5
KAFKA_CFG_BROKER_RACK: zone3
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://169.254.123.123:9096
restart: on-failure
depends_on:
- zookeeper
kafka6:
container_name: kafka6
hostname: 169.254.123.123
image: bitnami/kafka:${KAFKA_IMAGE_TAG:-2.7.0}
ports:
- "9097:9092"
environment:
KAFKA_CFG_BROKER_ID: 6
KAFKA_CFG_BROKER_RACK: zone3
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://169.254.123.123:9097
restart: on-failure
depends_on:
- zookeeper