mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
docker kafka auto-create topics
This commit is contained in:
parent
7627f97c09
commit
b0a36f18b4
@ -70,4 +70,25 @@ services:
|
||||
KAFKA_AUTHORIZER_CLASS_NAME: kafka.security.authorizer.AclAuthorizer
|
||||
KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true"
|
||||
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