From b1f2b8a709b960c40f056e5469ef752f1e2b0157 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 25 Sep 2024 22:03:20 +0200 Subject: [PATCH] =?utf8?q?Schreibweise=20des=20CLI-Kommandos=20f=C3=BCr=20?= =?utf8?q?Docker-Compose=20korrigiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- README.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) 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 -- 2.20.1