forked from sauljabin/kaskade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
103 lines (98 loc) · 3.57 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
services:
kafka1:
image: confluentinc/cp-kafka:${CP_VERSION}
environment:
KAFKA_NODE_ID: 1
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:9092,EXTERNAL://localhost:19092
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENERS: CONTROLLER://0.0.0.0:9093,INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:19092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
CLUSTER_ID: ${CLUSTER_ID}
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka1:9093,2@kafka2:9093,3@kafka3:9093
KAFKA_LOG_DIRS: /var/lib/kafka/data
ports:
- "19092:19092"
restart: on-failure
volumes:
- kafka1_data:/var/lib/kafka/data
healthcheck:
test: kafka-topics --bootstrap-server localhost:9092 --list > /dev/null 2>&1
interval: 10s
timeout: 10s
retries: 5
start_period: 10s
kafka2:
image: confluentinc/cp-kafka:${CP_VERSION}
environment:
KAFKA_NODE_ID: 2
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka2:9092,EXTERNAL://localhost:29092
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENERS: CONTROLLER://0.0.0.0:9093,INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
CLUSTER_ID: ${CLUSTER_ID}
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka1:9093,2@kafka2:9093,3@kafka3:9093
KAFKA_LOG_DIRS: /var/lib/kafka/data
ports:
- "29092:29092"
restart: on-failure
volumes:
- kafka2_data:/var/lib/kafka/data
healthcheck:
test: kafka-topics --bootstrap-server localhost:9092 --list > /dev/null 2>&1
interval: 10s
timeout: 10s
retries: 5
start_period: 10s
kafka3:
image: confluentinc/cp-kafka:${CP_VERSION}
environment:
KAFKA_NODE_ID: 3
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka3:9092,EXTERNAL://localhost:39092
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENERS: CONTROLLER://0.0.0.0:9093,INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:39092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
CLUSTER_ID: ${CLUSTER_ID}
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka1:9093,2@kafka2:9093,3@kafka3:9093
KAFKA_LOG_DIRS: /var/lib/kafka/data
ports:
- "39092:39092"
restart: on-failure
volumes:
- kafka3_data:/var/lib/kafka/data
healthcheck:
test: kafka-topics --bootstrap-server localhost:9092 --list > /dev/null 2>&1
interval: 10s
timeout: 10s
retries: 5
start_period: 10s
schema-registry:
image: confluentinc/cp-schema-registry:${CP_VERSION}
environment:
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_METHODS: GET,POST,PUT,OPTIONS
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_ORIGIN: "*"
SCHEMA_REGISTRY_DEBUG: "true"
SCHEMA_REGISTRY_HOST_NAME: localhost
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka1:9092,kafka2:9092,kafka3:9092
SCHEMA_REGISTRY_KAFKASTORE_TOPIC: registry.schemas
ports:
- "8081:8081"
restart: on-failure
healthcheck:
test: curl http://localhost:8081
interval: 30s
timeout: 30s
retries: 5
start_period: 30s
volumes:
kafka1_data:
kafka2_data:
kafka3_data:
networks:
default:
name: cluster