-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.zk-kafka.yml
282 lines (275 loc) · 9.71 KB
/
docker-compose.zk-kafka.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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
version: '3.6'
services:
zookeeper:
image: confluentinc/cp-zookeeper:${CONFLUENT_VERSION}
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SYNC_LIMIT: 2
ports:
- "2181:2181"
container_name: zookeeper
healthcheck:
test: nc -z zookeeper 2181 || exit -1
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
broker01:
image: confluentinc/cp-kafka:${CONFLUENT_VERSION}
depends_on:
zookeeper:
condition: service_healthy
container_name: broker01
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: PLAINTEXT_HOST://broker01:9092,PLAINTEXT://broker01:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT_HOST://localhost:9092,PLAINTEXT://broker01:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_JMX_PORT: 9090
KAFKA_LOG_DIRS: /var/log/kafka
KAFKA_NUM_PARTITIONS: 2
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 100
CONFLUENT_METRICS_ENABLE: 'false'
volumes:
- ./config/kafka_init/run_workaround.sh:/tmp/run_workaround.sh
ports:
- 9092:9092
mem_limit: ${MEM_LIMIT}
healthcheck:
test: nc -z broker01 9092 || exit -1
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
broker02:
image: confluentinc/cp-kafka:${CONFLUENT_VERSION}
depends_on:
zookeeper:
condition: service_healthy
container_name: broker02
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENERS: PLAINTEXT_HOST://broker01:9094,PLAINTEXT://broker01:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT_HOST://localhost:9094,PLAINTEXT://broker02:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_JMX_PORT: 9090
KAFKA_LOG_DIRS: /var/log/kafka
KAFKA_NUM_PARTITIONS: 2
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 100
CONFLUENT_METRICS_ENABLE: 'false'
volumes:
- ./config/kafka_init/run_workaround.sh:/tmp/run_workaround.sh
ports:
- 9094:9094
mem_limit: ${MEM_LIMIT}
healthcheck:
test: nc -z broker02 9094 || exit -1
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
kc01:
image: confluentinc/cp-kafka-connect:${CONFLUENT_VERSION}
container_name: kc01
ports:
- 8083:8083
depends_on:
broker01:
condition: service_healthy
broker02:
condition: service_healthy
# schema-registry:
# condition: service_healthy
volumes:
- ./connectors:/home/appuser/connectors
- ./libs:/home/appuser/libs
environment:
CLASSPATH: /home/appuser/libs/*
CONNECT_BOOTSTRAP_SERVERS: "broker01:9093,broker02:9093"
CONNECT_REST_ADVERTISED_HOST_NAME: "kc01"
CONNECT_REST_PORT: 8083
CONNECT_GROUP_ID: kafka-connect-vdt
CONNECT_CONFIG_STORAGE_TOPIC: _kafka-connect-configs
CONNECT_OFFSET_STORAGE_TOPIC: _kafka-connect-offsets
CONNECT_STATUS_STORAGE_TOPIC: _kafka-connect-status
CONNECT_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
# CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
# CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
CONNECT_INTERNAL_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_INTERNAL_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_LOG4J_ROOT_LOGLEVEL: "INFO"
CONNECT_LOG4J_LOGGERS: "org.apache.kafka.connect.runtime.rest=WARN,org.reflections=ERROR"
CONNECT_LOG4J_APPENDER_STDOUT_LAYOUT_CONVERSIONPATTERN: "[%d] %p %X{connector.context}%m (%c:%L)%n"
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_PLUGIN_PATH: '/usr/share/java,/usr/share/confluent-hub-components/,/home/appuser/connectors/'
mem_limit: ${MEM_LIMIT}
command:
- bash
- -c
- |
# Run kafka
echo "Launching Kafka Connect worker"
/etc/confluent/docker/run &
#
sleep infinity
healthcheck:
test: nc -z kc01 8083 || exit -1
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
kc02:
image: confluentinc/cp-kafka-connect:${CONFLUENT_VERSION}
container_name: kc02
ports:
- 8093:8083
depends_on:
broker01:
condition: service_healthy
broker02:
condition: service_healthy
# schema-registry:
# condition: service_healthy
volumes:
- ./connectors:/home/appuser/connectors
- ./libs:/home/appuser/libs
environment:
CLASSPATH: /home/appuser/libs/*
CONNECT_BOOTSTRAP_SERVERS: "broker01:9093,broker02:9093"
CONNECT_REST_ADVERTISED_HOST_NAME: "kc02"
CONNECT_REST_PORT: 8083
CONNECT_GROUP_ID: kafka-connect-vdt
CONNECT_CONFIG_STORAGE_TOPIC: _kafka-connect-configs
CONNECT_OFFSET_STORAGE_TOPIC: _kafka-connect-offsets
CONNECT_STATUS_STORAGE_TOPIC: _kafka-connect-status
CONNECT_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
# CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
# CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
CONNECT_INTERNAL_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_INTERNAL_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
CONNECT_LOG4J_ROOT_LOGLEVEL: "INFO"
CONNECT_LOG4J_LOGGERS: "org.apache.kafka.connect.runtime.rest=WARN,org.reflections=ERROR"
CONNECT_LOG4J_APPENDER_STDOUT_LAYOUT_CONVERSIONPATTERN: "[%d] %p %X{connector.context}%m (%c:%L)%n"
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: "1"
CONNECT_PLUGIN_PATH: '/usr/share/java,/usr/share/confluent-hub-components/,/home/appuser/connectors/'
mem_limit: ${MEM_LIMIT}
command:
- bash
- -c
- |
# Run kafka
echo "Launching Kafka Connect worker"
/etc/confluent/docker/run &
#
sleep infinity
healthcheck:
test: nc -z kc02 8083 || exit -1
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
# schema-registry:
# image: confluentinc/cp-schema-registry:${CONFLUENT_VERSION}
# hostname: schema-registry
# container_name: schema-registry
# ports:
# - "8081:8081"
# environment:
# SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "broker01:9093,broker02:9093"
# SCHEMA_REGISTRY_HOST_NAME: schema-registry
# SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
# depends_on:
# broker01:
# condition: service_healthy
# broker02:
# condition: service_healthy
# mem_limit: ${MEM_LIMIT}
# healthcheck:
# test: nc -z schema-registry 8081 || exit -1
# start_period: 15s
# interval: 5s
# timeout: 10s
# retries: 10
# ksqldb:
# image: confluentinc/ksqldb-server:${KSQL_VERSION}
# hostname: ksqldb
# container_name: ksqldb
# depends_on:
# broker01:
# condition: service_healthy
# broker02:
# condition: service_healthy
# kc01:
# condition: service_healthy
# kc02:
# condition: service_healthy
# ports:
# - 9088:8088
# environment:
# KSQL_LISTENERS: http://0.0.0.0:8088
# KSQL_BOOTSTRAP_SERVERS: broker01:9093,broker02:9093
# KSQL_KSQL_LOGGING_PROCESSING_STREAM_AUTO_CREATE: "true"
# KSQL_KSQL_LOGGING_PROCESSING_TOPIC_AUTO_CREATE: "true"
# KSQL_KSQL_CONNECT_URL: http://kc01:8083
# KSQL_KSQL_SCHEMA_REGISTRY_URL: http://schema-registry:8081
# KSQL_KSQL_SERVICE_ID: confluent_rmoff_01
# KSQL_KSQL_HIDDEN_TOPICS: '^_.*'
# mem_limit: ${MEM_LIMIT}
# healthcheck:
# test: nc -z ksqldb 8088 || exit -1
# start_period: 15s
# interval: 5s
# timeout: 10s
# retries: 10
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- 8080:8080
depends_on:
broker01:
condition: service_healthy
broker02:
condition: service_healthy
kc01:
condition: service_healthy
kc02:
condition: service_healthy
# schema-registry:
# condition: service_healthy
environment:
KAFKA_CLUSTERS_0_NAME: vdt-kafka-cluster
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: broker01:9093,broker02:9093
KAFKA_CLUSTERS_0_METRICS_PORT: 9090
KAFKA_CLUSTERS_0_KAFKACONNECT_0_NAME: kc01
KAFKA_CLUSTERS_0_KAFKACONNECT_0_ADDRESS: http://kc01:8083
KAFKA_CLUSTERS_0_KAFKACONNECT_1_NAME: kc02
KAFKA_CLUSTERS_0_KAFKACONNECT_1_ADDRESS: http://kc02:8083
# KAFKA_CLUSTERS_0_SCHEMAREGISTRY: http://schema-registry:8081
mem_limit: ${MEM_LIMIT}
healthcheck:
test: nc -z kafka-ui 8080 || exit -1
start_period: 15s
interval: 5s
timeout: 10s
retries: 10