From: Kai Moritz Date: Wed, 25 Sep 2024 20:03:20 +0000 (+0200) Subject: Schreibweise des CLI-Kommandos für Docker-Compose korrigiert X-Git-Tag: producer/spring-producer--Shutdown-Hängt~5 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=b1f2b8a709b960c40f056e5469ef752f1e2b0157;p=demos%2Fkafka%2Ftraining Schreibweise des CLI-Kommandos für Docker-Compose korrigiert --- diff --git a/README.sh b/README.sh index 6d555fd..d23ed67 100755 --- a/README.sh +++ b/README.sh @@ -4,13 +4,13 @@ IMAGE=juplo/rest-producer:1.0-SNAPSHOT if [ "$1" = "cleanup" ] then - docker-compose -f docker/docker-compose.yml down -t0 -v --remove-orphans + docker compose -f docker/docker-compose.yml down -t0 -v --remove-orphans mvn clean exit fi -docker-compose -f docker/docker-compose.yml up -d --remove-orphans kafka-1 kafka-2 kafka-3 -docker-compose -f docker/docker-compose.yml rm -svf producer producer-0 producer-1 +docker compose -f docker/docker-compose.yml up -d --remove-orphans kafka-1 kafka-2 kafka-3 +docker compose -f docker/docker-compose.yml rm -svf producer producer-0 producer-1 if [[ $(docker image ls -q $IMAGE) == "" || @@ -23,13 +23,13 @@ else docker image ls $IMAGE fi -docker-compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1 +docker compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1 -docker-compose -f docker/docker-compose.yml up -t0 -d cli +docker compose -f docker/docker-compose.yml up -t0 -d cli sleep 1 -docker-compose -f docker/docker-compose.yml logs setup +docker compose -f docker/docker-compose.yml logs setup -docker-compose -f docker/docker-compose.yml up -d producer +docker compose -f docker/docker-compose.yml up -d producer while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done # tag::hashed[] @@ -50,7 +50,7 @@ echo Nachrichten in Partition 1: kafkacat -b :9092 -t test -o 0 -p1 -f'key: %k\toffset: %o\tvalue: %s\n' -qe echo -docker-compose -f docker/docker-compose.yml exec -T cli bash << 'EOF' +docker compose -f docker/docker-compose.yml exec -T cli bash << 'EOF' echo "Altering number of partitions from 2 to 3..." kafka-topics --bootstrap-server kafka:9092 --describe --topic test # tag::repartitioning[] @@ -59,7 +59,7 @@ kafka-topics --bootstrap-server kafka:9092 --alter --topic test --partitions 3 kafka-topics --bootstrap-server kafka:9092 --describe --topic test EOF -docker-compose -f docker/docker-compose.yml restart producer +docker compose -f docker/docker-compose.yml restart producer while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done echo -n Nachricht 4 an klaus über producer | http -v :8080/klaus @@ -83,9 +83,9 @@ echo Nachrichten in Partition 2: kafkacat -b :9092 -t test -o 0 -p2 -f'key: %k\toffset: %o\tvalue: %s\n' -qe -docker-compose -f docker/docker-compose.yml restart setup +docker compose -f docker/docker-compose.yml restart setup sleep 1 -docker-compose -f docker/docker-compose.yml up -d producer-0 producer-1 +docker compose -f docker/docker-compose.yml up -d producer-0 producer-1 while ! [[ $(http 0:8000/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-0..."; sleep 1; done while ! [[ $(http 0:8001/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-1..."; sleep 1; done @@ -96,14 +96,14 @@ echo -n Nachricht 2 über producer-0 | http -v :8000/peter echo -n Nachricht 2 über producer-1 | http -v :8001/peter # end::fixed[] -docker-compose -f docker/docker-compose.yml exec -T cli bash << 'EOF' +docker compose -f docker/docker-compose.yml exec -T cli bash << 'EOF' echo "Altering number of partitions from 2 to 3..." kafka-topics --bootstrap-server kafka:9092 --describe --topic test kafka-topics --bootstrap-server kafka:9092 --alter --topic test --partitions 3 kafka-topics --bootstrap-server kafka:9092 --describe --topic test EOF -docker-compose -f docker/docker-compose.yml restart producer-0 producer-1 +docker compose -f docker/docker-compose.yml restart producer-0 producer-1 while ! [[ $(http 0:8000/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-0..."; sleep 1; done while ! [[ $(http 0:8001/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-1..."; sleep 1; done