docker compose up setup
# client
-docker-compose -f docker/docker-compose.yml exec cli kafka-acls \
+docker compose exec cli kafka-acls \
+ --command-config /mnt/admin.properties \
--authorizer-properties zookeeper.connect=zookeeper \
--add \
--allow-principal User:client \
image: juplo/toolbox
command: sleep infinity
volumes:
- - ./client.properties:/mnt/client.properties:ro
+ - ./admin.properties:/mnt/admin.properties:ro
stop_grace_period: 0s
depends_on:
- kafka-1
setup:
image: juplo/toolbox
volumes:
- - ./client.properties:/mnt/client.properties:ro
+ - ./admin.properties:/mnt/admin.properties:ro
command:
- bash
- -c
- |
- cub kafka-ready -b kafka-1:9092,kafka-2:9092,kafka-3:9092 3 60 > /dev/null 2>&1 || exit 1
if [ -e INITIALIZED ]
then
echo -n Bereits konfiguriert:
kafka-topics --bootstrap-server kafka:9092 --describe --topic test
else
kafka-topics --bootstrap-server kafka:9092 \
- --command-config /mnt/client.properties \
+ --command-config /mnt/admin.properties \
--delete \
--if-exists \
--topic test
kafka-topics --bootstrap-server kafka:9092 \
- --command-config /mnt/client.properties \
+ --command-config /mnt/admin.properties \
--create \
--topic test \
--partitions 2 \
--replication-factor 3 \
--config min.insync.replicas=2 \
&& echo Das Topic \'test\' wurde erfolgreich angelegt: \
- && kafka-topics --bootstrap-server kafka:9092 --command-config /mnt/client.properties --describe --topic test \
+ && kafka-topics --bootstrap-server kafka:9092 --command-config /mnt/admin.properties --describe --topic test \
&& date > INITIALIZED
fi
stop_grace_period: 0s