-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
218 lines (206 loc) · 7.36 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
version: "2.4"
services:
zookeeper-1:
image: confluentinc/cp-zookeeper:7.0.0
hostname: zookeeper-1
ports:
- 12181:2181
environment:
ZOOKEEPER_SERVER_ID: "1"
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_SERVERS: zookeeper-1:2888:3888;zookeeper-2:2888:3888;zookeeper-3:2888:3888
ZOOKEEPER_4LW_COMMANDS_WHITELIST: "*"
EXTRA_ARGS: -javaagent:/usr/share/jmx_exporter/jmx_prometheus_javaagent-0.14.0.jar=1234:/usr/share/jmx_exporter/zookeeper.yml
KAFKA_HEAP_OPTS: "-Xmx512M -Xms512M"
volumes:
- ./jmx-exporter:/usr/share/jmx_exporter/
zookeeper-2:
image: confluentinc/cp-zookeeper:7.0.0
hostname: zookeeper-2
ports:
- 12182:2181
environment:
ZOOKEEPER_SERVER_ID: "2"
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_SERVERS: zookeeper-1:2888:3888;zookeeper-2:2888:3888;zookeeper-3:2888:3888
ZOOKEEPER_4LW_COMMANDS_WHITELIST: "*"
EXTRA_ARGS: -javaagent:/usr/share/jmx_exporter/jmx_prometheus_javaagent-0.14.0.jar=1234:/usr/share/jmx_exporter/zookeeper.yml
KAFKA_HEAP_OPTS: "-Xmx512M -Xms512M"
volumes:
- ./jmx-exporter:/usr/share/jmx_exporter/
zookeeper-3:
image: confluentinc/cp-zookeeper:7.0.0
hostname: zookeeper-3
ports:
- 12183:2181
environment:
ZOOKEEPER_SERVER_ID: "3"
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_SERVERS: zookeeper-1:2888:3888;zookeeper-2:2888:3888;zookeeper-3:2888:3888
ZOOKEEPER_4LW_COMMANDS_WHITELIST: "*"
EXTRA_ARGS: -javaagent:/usr/share/jmx_exporter/jmx_prometheus_javaagent-0.14.0.jar=1234:/usr/share/jmx_exporter/zookeeper.yml
KAFKA_HEAP_OPTS: "-Xmx512M -Xms512M"
volumes:
- ./jmx-exporter:/usr/share/jmx_exporter/
kafka-1:
image: confluentinc/cp-kafka:7.0.0
hostname: kafka-1
ports:
- 19092:19092
depends_on:
- zookeeper-1
- zookeeper-2
- zookeeper-3
environment:
KAFKA_LISTENERS: "INTERNAL://kafka-1:9092,EXTERNAL://:19092"
KAFKA_ADVERTISED_LISTENERS: "INTERNAL://kafka-1:9092,EXTERNAL://localhost:19092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_ZOOKEEPER_CONNECT: "zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"
KAFKA_BROKER_ID: "1"
KAFKA_OPTS: -javaagent:/usr/share/jmx_exporter/jmx_prometheus_javaagent-0.14.0.jar=1234:/usr/share/jmx_exporter/kafka-broker.yml
KAFKA_HEAP_OPTS: "-Xmx512M -Xms512M"
KAFKA_MIN_INSYNC_REPLICAS: 2
volumes:
- ./jmx-exporter:/usr/share/jmx_exporter/
kafka-2:
image: confluentinc/cp-kafka:7.0.0
hostname: kafka-2
ports:
- 19093:19093
depends_on:
- zookeeper-1
- zookeeper-2
- zookeeper-3
environment:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"
KAFKA_LISTENERS: "INTERNAL://kafka-2:9092,EXTERNAL://:19093"
KAFKA_ADVERTISED_LISTENERS: "INTERNAL://kafka-2:9092,EXTERNAL://localhost:19093"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_BROKER_ID: "2"
KAFKA_OPTS: -javaagent:/usr/share/jmx_exporter/jmx_prometheus_javaagent-0.14.0.jar=1234:/usr/share/jmx_exporter/kafka-broker.yml
KAFKA_HEAP_OPTS: "-Xmx512M -Xms512M"
KAFKA_MIN_INSYNC_REPLICAS: 2
volumes:
- ./jmx-exporter:/usr/share/jmx_exporter/
kafka-3:
image: confluentinc/cp-kafka:7.0.0
hostname: kafka-3
ports:
- 19094:19094
depends_on:
- zookeeper-1
- zookeeper-2
- zookeeper-3
environment:
KAFKA_ZOOKEEPER_CONNECT: "zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181"
KAFKA_LISTENERS: "INTERNAL://kafka-3:9092,EXTERNAL://:19094"
KAFKA_ADVERTISED_LISTENERS: "INTERNAL://kafka-3:9092,EXTERNAL://localhost:19094"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
KAFKA_BROKER_ID: "3"
KAFKA_OPTS: -javaagent:/usr/share/jmx_exporter/jmx_prometheus_javaagent-0.14.0.jar=1234:/usr/share/jmx_exporter/kafka-broker.yml
KAFKA_HEAP_OPTS: "-Xmx512M -Xms512M"
KAFKA_MIN_INSYNC_REPLICAS: 2
volumes:
- ./jmx-exporter:/usr/share/jmx_exporter/
producer:
build: ./sample-application/producer
environment:
JAVA_OPTS: "-javaagent:/usr/share/jmx_exporter/jmx_prometheus_javaagent-0.14.0.jar=1234:/usr/share/jmx_exporter/kafka-producer.yml -Xmx256M -Xms256M"
KAFKA_BOOTSTRAP_SERVERS: "kafka-1:9092, kafka-2:9092, kafka-3:9092"
TOPIC: "orders"
REPLICATION_FACTOR: 3
NUMBER_OF_PARTITIONS: 4
MESSAGE_BACKOFF: 100 # Frequency of message injection
NUMBER_MESSAGE_PER_BATCH: 100
CATALOG_PRODUCTS_PATH: /usr/share/products
KAFKA_ACKS: "all"
KAFKA_LINGER_MS: "25"
KAFKA_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
volumes:
- ./jmx-exporter:/usr/share/jmx_exporter/
- ./referential/products:/usr/share/products
restart: always
depends_on:
- kafka-1
- kafka-2
- kafka-3
- streams #Stream create topic
- schema-registry
streams:
build: ./sample-application/streams
hostname: streams-1
environment:
JAVA_OPTS: -javaagent:/usr/share/jmx_exporter/jmx_prometheus_javaagent-0.14.0.jar=1234:/usr/share/jmx_exporter/kafka-streams-post-2.5.yml -Xmx256M -Xms256M
KAFKA_BOOTSTRAP_SERVERS: "kafka-1:9092, kafka-2:9092, kafka-3:9092"
INPUT_TOPIC: "orders"
APPLICATION_ID: "order-aggregate-streams"
REPLICATION_FACTOR: 3
NUMBER_OF_PARTITIONS: 4
KAFKA_PROCESSING_GUARANTEE: "at_least_once"
KAFKA_COMMIT_INTERVAL_MS: 1000 # 1 seconds
KAFKA_CACHE_MAX_BYTES_BUFFERING: 1048576 # 1MB
KAFKA_METRICS_RECORDING_LEVEL: "DEBUG"
KAFKA_NUM_STREAM_THREADS: "2"
KAFKA_REPLICATION_FACTOR: "3"
KAFKA_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
ports:
- "8080:8080"
volumes:
- ./jmx-exporter:/usr/share/jmx_exporter/
depends_on:
- kafka-1
- kafka-2
- kafka-3
- schema-registry
prometheus:
image: prom/prometheus:v2.11.1
ports:
- 9090:9090
volumes:
- ./prometheus/:/etc/prometheus/
grafana:
image: grafana/grafana:7.3.3
environment:
GF_INSTALL_PLUGINS: grafana-piechart-panel
ports:
- 3000:3000
volumes:
- ./grafana/provisioning/:/etc/grafana/provisioning/
schema-registry:
image: confluentinc/cp-schema-registry:7.0.0
hostname: schema-registry
container_name: schema-registry
depends_on:
- kafka-1
- kafka-2
- kafka-3
ports:
- "8081:8081"
environment:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'kafka-1:9092,kafka-2:9092,kafka-3:9092'
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
akhq:
image: tchiotludo/akhq
environment:
AKHQ_CONFIGURATION: |
akhq:
server:
access-log:
enabled: false
connections:
docker-kafka-server:
properties:
bootstrap.servers: "kafka-1:9092,kafka-2:9092,kafka-3:9092"
ports:
- 8082:8080
depends_on:
- kafka-1
- kafka-2
- kafka-3