From 7782722862346c41895de2331170e5df0570acbe Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 16 Sep 2022 16:19:05 +0200 Subject: [PATCH] =?utf8?q?README.sh=20f=C3=BCht=20die=20=C3=9Cbung=20zum?= =?utf8?q?=20Default-Error-Handling=20vor?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- README.sh | 98 +++++++++++++++++++++---------------------------------- 1 file changed, 37 insertions(+), 61 deletions(-) diff --git a/README.sh b/README.sh index a2d813d..e981735 100755 --- a/README.sh +++ b/README.sh @@ -34,78 +34,54 @@ while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Wait while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for requests-1..."; sleep 1; done while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for requests-2..."; sleep 1; done -docker-compose up -d peter klaus +docker-compose up -d adder-1 adder-2 -docker-compose up -d adder-1 while ! [[ $(http 0:8091/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for adder-1..."; sleep 1; done -while [[ "$(http :8091/results | jq -r .)" == "{}" ]]; do echo "Waiting for some results to show up on adder-1..."; sleep 1; done -http -v --pretty none -S :8091/results -echo - -sleep 3 -echo "Resultate für adder-1" -http -v --pretty none -S :8091/results -echo - -echo "Resultate für peter von adder-1" -http :8091/results/peter | jq .[].sum | uniq -echo "Resultate für klaus von adder-1" -http :8091/results/klaus | jq .[].sum | uniq - - -docker-compose up -d adder-2 while ! [[ $(http 0:8092/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for adder-2..."; sleep 1; done +while [[ "$(http :8091/results | jq -r .)" == "{}" ]]; do echo "Waiting for some results to show up on adder-1..."; sleep 1; done while [[ "$(http :8092/results | jq -r .)" == "{}" ]]; do echo "Waiting for some results to show up on adder-2..."; sleep 1; done -http -v --pretty none -S :8092/results -echo - -sleep 3 -echo "Resultate für adder-2" -http -v --pretty none -S :8092/results -echo - -echo "Resultate für peter von adder-1" -http :8091/results/peter | jq .[].sum | uniq -echo "Resultate für klaus von adder-1" -http :8091/results/klaus | jq .[].sum | uniq -echo "Resultate für peter von adder-2" -http :8092/results/peter | jq .[].sum | uniq -echo "Resultate für klaus von adder-2" -http :8092/results/klaus | jq .[].sum | uniq - -docker-compose stop adder-1 -until [ $(http --check-status :8092/results/peter 2> /dev/null) ]; do echo "Waiting for some results for peter to show up on adder-2..."; sleep 1; done -until [ $(http --check-status :8092/results/klaus 2> /dev/null) ]; do echo "Waiting for some results for klaus to show up on adder-2..."; sleep 1; done +echo 6 | http -v :8080/peter +echo 6 | http -v :8080/klaus +echo "Resultate für adder-1" +http -v :8091/results echo "Resultate für adder-2" -http -v --pretty none -S :8092/results -echo +http -v :8092/results -echo "Resultate für peter von adder-2" -http :8092/results/peter | jq .[].sum | uniq -echo "Resultate für klaus von adder-2" -http :8092/results/klaus | jq .[].sum | uniq +echo "Writing poison pill into topic out..." +# tag::poisonpill[] +echo 'BOOM!' | kafkacat -P -b :9092 -t out +# end::poisonpill[] -docker-compose kill -s 9 adder-2 +sleep 5 +echo "Resultate & Status für adder-1" +http -v :8091/results +http -v :8091/actuator/health +echo "Resultate & Status für adder-2" +http -v :8092/results +http -v :8092/actuator/health + +echo "Stopping adder-1 & adder-2" +# tag::stop[] +docker-compose stop adder-1 adder-2 +# end::stop[] + +docker-compose logs --tail=50 adder-1 adder-2 + +echo "Restarting adder-1" +# tag::start[] docker-compose start adder-1 -docker-compose kill -s 9 peter klaus +# end::start[] while ! [[ $(http 0:8091/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for adder-1..."; sleep 1; done -until [ $(http --check-status :8091/results/peter 2> /dev/null) ]; do echo "Waiting for some results for peter to show up on adder-1..."; sleep 1; done -until [ $(http --check-status :8091/results/klaus 2> /dev/null) ]; do echo "Waiting for some results for klaus to show up on adder-1..."; sleep 1; done - -echo "Resultate für adder-1" -http -v --pretty none -S :8091/results -echo - -echo "Resultate für peter von adder-1" -http :8091/results/peter | jq .[].sum | uniq -echo "Resultate für klaus von adder-1" -http :8091/results/klaus | jq .[].sum | uniq +while [[ "$(http :8091/results | jq -r .)" == "{}" ]]; do echo "Waiting for some results to show up on adder-1..."; sleep 1; done sleep 5 +echo "Resultate & Status für adder-1" +# tag::status[] +http -v :8091/results +http -v :8091/actuator/health +# end::status[] -echo "Resultate für peter von adder-1" -http :8091/results/peter | jq .[].sum | uniq -echo "Resultate für klaus von adder-1" -http :8091/results/klaus | jq .[].sum | uniq +docker-compose stop adder-1 +docker-compose logs --tail=50 adder-1 -- 2.20.1