-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
108 lines (108 loc) · 3.31 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
---
version: '2'
services:
zk-1:
image: confluentinc/cp-zookeeper:5.2.1
hostname: zk-1
container_name: zk-1
ports:
- 22181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SERVERS: zk-1:2888:3888;zk-2:2888:3888;zk-3:2888:3888
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_SYNC_LIMIT: 2
ZOOKEEPER_TICK_TIME: 2000
zk-2:
image: confluentinc/cp-zookeeper:5.2.1
hostname: zk-2
container_name: zk-2
ports:
- 32181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SERVERS: zk-1:2888:3888;zk-2:2888:3888;zk-3:2888:3888
ZOOKEEPER_SERVER_ID: 2
ZOOKEEPER_SYNC_LIMIT: 2
ZOOKEEPER_TICK_TIME: 2000
zk-3:
image: confluentinc/cp-zookeeper:5.2.1
hostname: zk-3
container_name: zk-3
ports:
- 42181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SERVERS: zk-1:2888:3888;zk-2:2888:3888;zk-3:2888:3888
ZOOKEEPER_SERVER_ID: 3
ZOOKEEPER_SYNC_LIMIT: 2
ZOOKEEPER_TICK_TIME: 2000
kafka-1:
image: confluentinc/cp-kafka:5.2.1
hostname: kafka-1
container_name: kafka-1
depends_on:
- zk-1
ports:
- 19092:19092
- 9092:9092
environment:
KAFKA_ZOOKEEPER_CONNECT: zk-1:2181,zk-2:2181,zk-3:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-1:19092,PLAINTEXT_HOST://localhost:9092
KAFKA_BROKER_ID: 1
kafka-2:
image: confluentinc/cp-kafka:5.2.1
hostname: kafka-2
container_name: kafka-2
depends_on:
- zk-1
ports:
- 29092:19092
- 9093:9093
environment:
KAFKA_ZOOKEEPER_CONNECT: zk-1:2181,zk-2:2181,zk-3:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-2:19092,PLAINTEXT_HOST://localhost:9093
KAFKA_BROKER_ID: 2
kafka-3:
image: confluentinc/cp-kafka:5.2.1
hostname: kafka-3
container_name: kafka-3
depends_on:
- zk-1
ports:
- 39092:19092
- 9094:9094
environment:
KAFKA_ZOOKEEPER_CONNECT: zk-1:2181,zk-2:2181,zk-3:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-3:19092,PLAINTEXT_HOST://localhost:9094
KAFKA_BROKER_ID: 3
kafka-producer:
build: .
image: de.qimia.task2/de.qimia.task2.kafka
depends_on:
- kafka-1
- kafka-2
- kafka-3
command: java -cp /app/de.qimia.task2.kafka-jar-with-dependencies.jar ProducerKafka testTopic kafka-1:19092,kafka-2:19092,kafka-3:19092
intermediate-processes:
build: .
image: de.qimia.task2/de.qimia.task2.kafka
depends_on:
- kafka-1
- kafka-2
- kafka-3
command: java -cp /app/de.qimia.task2.kafka-jar-with-dependencies.jar IntermediateProcesses testTopic Testingtopic kafka-1:19092,kafka-2:19092,kafka-3:19092
kafka-consumer:
build: .
image: de.qimia.task2/de.qimia.task2.kafka
depends_on:
- kafka-1
- kafka-2
- kafka-3
command: java -cp /app/de.qimia.task2.kafka-jar-with-dependencies.jar ConsumerKafka Testingtopic kafka-1:19092,kafka-2:19092,kafka-3:19092