mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
docker kafka auto-create topics
This commit is contained in:
parent
7627f97c09
commit
b0a36f18b4
@ -71,3 +71,24 @@ services:
|
|||||||
KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true"
|
KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true"
|
||||||
depends_on:
|
depends_on:
|
||||||
- zoo1
|
- zoo1
|
||||||
|
|
||||||
|
init-kafka:
|
||||||
|
image: confluentinc/cp-kafka:7.2.0
|
||||||
|
depends_on:
|
||||||
|
- kafka1
|
||||||
|
- kafka2
|
||||||
|
- kafka3
|
||||||
|
entrypoint: [ '/bin/sh', '-c' ]
|
||||||
|
command: |
|
||||||
|
"
|
||||||
|
# blocks until kafka is reachable
|
||||||
|
kafka-topics --bootstrap-server kafka1:19092 --list
|
||||||
|
|
||||||
|
echo -e 'Creating kafka topics'
|
||||||
|
kafka-topics --bootstrap-server kafka1:19092 --create --if-not-exists --topic pageview --replication-factor 3 --partitions 3
|
||||||
|
kafka-topics --bootstrap-server kafka2:19093 --create --if-not-exists --topic event --replication-factor 3 --partitions 3
|
||||||
|
kafka-topics --bootstrap-server kafka3:19094 --create --if-not-exists --topic session --replication-factor 3 --partitions 3
|
||||||
|
|
||||||
|
echo -e 'Successfully created the following topics:'
|
||||||
|
kafka-topics --bootstrap-server kafka1:19092 --list
|
||||||
|
"
|
Loading…
Reference in New Issue
Block a user