-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
191 lines (177 loc) · 5.84 KB
/
docker-compose.yaml
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
version: '3'
volumes:
prometheus_data: {}
grafana_data_v3: {}
services:
spark:
image: bitnami/spark:3.3.2
container_name: spark
ports:
- 8085:8080
- 7077:7077
- 9099:9099 # Driver
environment:
- SPARK_MODE=master
volumes:
- ./config/spark/metrics.properties:/opt/bitnami/spark/conf/metrics.properties
- ./src:/app
- ./data:/data
# - ./config/spark/spark-defaults.conf:/opt/bitnami/spark/conf/spark-defaults.conf
spark-worker:
image: bitnami/spark:3.3.2
container_name: spark-worker
depends_on:
- spark
ports:
- 8081:8081
- 10099:9099 # Driver
environment:
- SPARK_MODE=worker
- SPARK_MASTER_URL=spark://spark:7077
- SPARK_WORKER_MEMORY=2G
- SPARK_WORKER_CORES=2
- SPARK_RPC_AUTHENTICATION_ENABLED=no
- SPARK_RPC_ENCRYPTION_ENABLED=no
- SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no
- SPARK_SSL_ENABLED=no
volumes:
- ./config/spark/metrics.properties:/opt/bitnami/spark/conf/metrics.properties
zookeeper:
image: confluentinc/cp-zookeeper:7.3.2
container_name: zookeeper
ports:
- 22181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:7.3.2
hostname: kafka
container_name: kafka
depends_on:
- zookeeper
ports:
- "9092:9092"
- "9997:9997"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CONFLUENT_BALANCER_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_JMX_PORT: 9997
KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka -Dcom.sun.management.jmxremote.rmi.port=9997
KAFKA_JMX_HOSTNAME: kafka
jmx-kafka:
image: sscaling/jmx-prometheus-exporter:0.12.0
# restart: always
ports:
- "5556:5556"
environment:
CONFIG_YML : "/etc/jmx_exporter/config.yml"
volumes:
- ./config/jmx_exporter/config_kafka.yml:/etc/jmx_exporter/config.yml
container_name: jmx-kafka
depends_on:
- kafka
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:v0.6.2
depends_on:
- kafka
ports:
- 8088:8080
environment:
DYNAMIC_CONFIG_ENABLED: "true"
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
KAFKA_CLUSTERS_0_METRICS_PORT: 9997
# volumes:
# - config/kafka_ui_config.yml:/etc/kafkaui/dynamic_config.yaml
kafka-init-topics:
container_name: kafka-init-topics
image: confluentinc/cp-kafka:7.3.2
volumes:
- ./data/reviews.json:/data/reviews.json
depends_on:
- kafka
command: "bash -c 'echo Waiting for Kafka to be ready... && \
cub kafka-ready -b kafka:29092 1 30 && \
kafka-topics --create --topic hotel-reviews --partitions 2 --replication-factor 1 --if-not-exists --bootstrap-server kafka:29092 && \
kafka-topics --create --topic hotel-reviews-ratings --partitions 2 --replication-factor 1 --if-not-exists --bootstrap-server kafka:29092 && \
kafka-topics --create --topic statistics --partitions 2 --replication-factor 1 --if-not-exists --bootstrap-server kafka:29092 && \
kafka-console-producer --bootstrap-server kafka:29092 --topic hotel-reviews < /data/reviews.json'"
prometheus:
container_name: prometheus
image: prom/prometheus:v2.43.0
restart: always
volumes:
- ./config/prometheus:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- 9090:9090
links:
- alertmanager:alertmanager
alertmanager:
container_name: alertmanager
image: prom/alertmanager:v0.25.0
restart: always
ports:
- 9093:9093
volumes:
- ./config/alertmanager/:/etc/alertmanager/
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
grafana:
container_name: grafana
image: grafana/grafana:9.4.7
user: '472'
restart: always
environment:
GF_INSTALL_PLUGINS: 'grafana-clock-panel,grafana-simple-json-datasource'
GF_USERS_ALLOW_SIGN_UP: 'false'
volumes:
- grafana_data_v3:/var/lib/grafana
- ./config/grafana/dashboards:/var/lib/grafana/dashboards
- ./config/grafana/provisioning/:/etc/grafana/provisioning
env_file:
- ./config/grafana/config.monitoring
ports:
- 3000:3000
depends_on:
- prometheus
node-exporter:
container_name: node-exporter
image: prom/node-exporter:v1.5.0
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- --collector.filesystem.ignored-mount-points
- '^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)'
ports:
- 9100:9100
restart: always
deploy:
mode: global
data-dispatcher:
container_name: data-dispatcher
build: src/dispatcher
ports:
- 8222:8222
depends_on:
- kafka