-
Notifications
You must be signed in to change notification settings - Fork 66
/
docker-compose.yml
127 lines (120 loc) · 3.97 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
version: '3.4'
services:
zookeeper:
image: confluentinc/cp-zookeeper:5.3.1
hostname: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
healthcheck:
test: ["CMD", "bash", "-c", "echo ruok | nc localhost 2181 | grep imok"]
start_period: 30s
kafka-1:
image: confluentinc/cp-kafka:5.3.1
hostname: kafka-1
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-1:9092
KAFKA_DEFAULT_REPLICATION_FACTOR: 3
healthcheck:
test: ["CMD", "nc", "127.0.0.1", "9092"]
start_period: 30s
kafka-2:
image: confluentinc/cp-kafka:5.3.1
hostname: kafka-2
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 2
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-2:9092
KAFKA_DEFAULT_REPLICATION_FACTOR: 3
healthcheck:
test: ["CMD", "nc", "127.0.0.1", "9092"]
start_period: 30s
kafka-3:
image: confluentinc/cp-kafka:5.3.1
hostname: kafka-3
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 3
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-3:9092
KAFKA_DEFAULT_REPLICATION_FACTOR: 3
healthcheck:
test: ["CMD", "nc", "127.0.0.1", "9092"]
start_period: 30s
mysql:
image: mysql:5.7
volumes:
- ../step11/mysql.cnf:/etc/mysql/conf.d/custom.cnf
- ../step11/mysql-init.sql:/docker-entrypoint-initdb.d/mysql-init.sql
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: db
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_HOST: 172.% # Allow docker containers to connect to mysql
schema-registry:
image: confluentinc/cp-schema-registry:5.3.1
ports:
- "8082:8082"
depends_on:
- zookeeper
- kafka-1
- kafka-2
- kafka-3
environment:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_LISTENERS: "http://0.0.0.0:8082"
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: "PLAINTEXT://kafka-1:9092,PLAINTEXT://kafka-2:9092,PLAINTEXT://kafka-3:9092"
connect:
image: confluentinc/cp-kafka-connect:5.3.1
hostname: connect
restart: always
ports:
- "8083:8083"
depends_on:
- zookeeper
- kafka-1
- kafka-2
- kafka-3
- schema-registry
- mysql
environment:
CONNECT_BOOTSTRAP_SERVERS: "kafka-1:9092,kafka-2:9092,kafka-3:9092"
CONNECT_GROUP_ID: "connect"
CONNECT_CONFIG_STORAGE_TOPIC: connect-config
CONNECT_OFFSET_STORAGE_TOPIC: connect-offsets
CONNECT_STATUS_STORAGE_TOPIC: connect-status
CONNECT_REPLICATION_FACTOR: 2
CONNECT_KEY_CONVERTER: io.confluent.connect.avro.AvroConverter
CONNECT_VALUE_CONVERTER: io.confluent.connect.avro.AvroConverter
CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8082
CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8082
CONNECT_REST_ADVERTISED_HOST_NAME: "connect"
CONNECT_PLUGIN_PATH: "/usr/share/java"
CONNECT_LOG4J_LOGGERS: org.reflections=ERROR
volumes:
- ../step9/mysql-connector-java-5.1.45-bin.jar:/usr/share/java/kafka-connect-jdbc/mysql-connector-java-5.1.45-bin.jar
- ../step11/debezium-connector-mysql:/usr/share/java/debezium-connector-mysql
healthcheck:
test: ["CMD", "nc", "127.0.0.1", "8083"]
start_period: 30s
ksql:
image: confluentinc/cp-ksql-server:5.3.1
hostname: ksql-cli
depends_on:
- kafka-1
- kafka-2
- kafka-3
- schema-registry
environment:
KSQL_BOOTSTRAP_SERVERS: kafka-1:9092
KSQL_LISTENERS: http://0.0.0.0:8088
KSQL_KSQL_SCHEMA_REGISTRY_URL: http://schema-registry:8082