Skip to content

Commit b849f6d

Browse files
committed
feat: 增加kafka
1 parent 43ea4a5 commit b849f6d

7 files changed

Lines changed: 1877 additions & 8 deletions

File tree

.env.example

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,9 @@ kIBANA_HOST_PORT=5601
4545
kIBANA_I18N_LOCALE=zh-CN
4646

4747
# ClickHouse
48-
CLICKHOUSE_PORT=8123
48+
CLICKHOUSE_VERSION=24.8
49+
CLICKHOUSE_PORT=8123
50+
51+
# kafka
52+
KAFKA_VERSION=3.8.1
53+
KAFKA_PORT=9092

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
8. elasticsearch:7.17.25(官方镜像)
3434
9. kibana:7.17.25(官方镜像)
3535
10. clickhouse-server:24.8(官方镜像)
36+
11. kafka:3.8.1(官方镜像)
3637

3738
# 目录
3839

docker-compose.yml.example

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ services:
199199
max-file: "1"
200200

201201
clickhouse:
202-
image: clickhouse/clickhouse-server:24.8
202+
image: clickhouse/clickhouse-server:${CLICKHOUSE_VERSION}
203203
ulimits:
204204
nofile:
205205
soft: 262144
@@ -212,7 +212,6 @@ services:
212212
TZ: ${TZ}
213213
volumes:
214214
- clickhouse-data:/var/lib/clickhouse
215-
- ${DIR_LOGS}/clickhouse:/var/log/clickhouse-server
216215
- ${DIR_SERVICES}/clickhouse/config.d:/etc/clickhouse-server/config.d:ro
217216
- ${DIR_SERVICES}/clickhouse/users.d:/etc/clickhouse-server/users.d:ro
218217
hostname: clickhouse
@@ -227,6 +226,35 @@ services:
227226
max-size: "10m"
228227
max-file: "1"
229228

229+
kafka:
230+
image: apache/kafka:${KAFKA_VERSION}
231+
environment:
232+
TZ: ${TZ}
233+
KAFKA_NODE_ID: 1
234+
KAFKA_PROCESS_ROLES: broker,controller
235+
KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
236+
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://:9092
237+
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
238+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
239+
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
240+
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
241+
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
242+
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
243+
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
244+
KAFKA_LOG_RETENTION_MINUTES: 10
245+
KAFKA_NUM_PARTITIONS: 3
246+
hostname: kafka
247+
ports:
248+
- "${KAFKA_PORT}:9092"
249+
networks:
250+
- default
251+
restart: unless-stopped
252+
logging:
253+
driver: "json-file"
254+
options:
255+
max-size: "10m"
256+
max-file: "1"
257+
230258
volumes:
231259
mysql-data:
232260
redis-data:

services/clickhouse/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!.gitignore
3+
!config.xml
4+
!users.xml
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<clickhouse>
2-
<!-- Listen wildcard address to allow accepting connections from other containers and host network. -->
3-
<listen_host>::</listen_host>
2+
<!-- Listen wildcard address to allow accepting connections from other containers and host network. -->
3+
<!-- <listen_host>::</listen_host> -->
44
<listen_host>0.0.0.0</listen_host>
55
<listen_try>1</listen_try>
66

7-
<!--
87
<logger>
9-
<console>1</console>
8+
<level>warning</level>
9+
<log></log>
10+
<errorlog></errorlog>
11+
<console>true</console>
1012
</logger>
11-
-->
1213
</clickhouse>

0 commit comments

Comments
 (0)