From cef51b1a79552963bef5bd7e0ebb04065da2abef Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 28 Aug 2022 15:33:52 +0200 Subject: [PATCH] =?utf8?q?Vorf=C3=BChr-Skript=20und=20Setup=20f=C3=BCr=20F?= =?utf8?q?ehler=20bei=20hoher=20(h=C3=B6herer)=20Auslastung?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- README.sh | 90 +++++++++++++++++++++++++++++++++------------- docker-compose.yml | 23 ++++++++++++ 2 files changed, 88 insertions(+), 25 deletions(-) diff --git a/README.sh b/README.sh index fbd0331..6be4b11 100755 --- a/README.sh +++ b/README.sh @@ -36,41 +36,81 @@ while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Wait while ! [[ $(http 0:8091/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for adder-1..."; sleep 1; done while ! [[ $(http 0:8092/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for adder-2..."; sleep 1; done -# tag::nachrichten[] -echo 6 | http -v :8080/peter -echo 6 | http -v :8080/klaus -# end::nachrichten[] +docker-compose up -d peter klaus while [[ "$(http :8091/results | jq -r .)" == "{}" ]]; do echo "Waiting for some results to show up on adder-1..."; sleep 1; done -echo "Resultate für adder-1" -# tag::resultate[] -http -v :8091/results -# end::resultate[] - +http -v --pretty none -S :8091/results +echo 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-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 echo "Resultate für adder-2" -# tag::resultate[] -http -v :8092/results -# end::resultate[] +http -v --pretty none -S :8092/results +echo +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 - -echo 66 | http -v :8080/peter -echo 66 | http -v :8080/klaus sleep 1 echo "Resultate für adder-2" -http -v :8092/results +http -v --pretty none -S :8092/results +echo +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-2 docker-compose start 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..."; - echo 666 | http -v :8080/peter - echo 666 | http -v :8080/klaus - sleep 1; -done +while [[ "$(http :8091/results | jq -r .)" == "{}" ]]; do echo "Waiting for some results 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 + +docker-compose start adder-2 +while ! [[ $(http 0:8092/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for adder-2..."; sleep 1; done +while [[ "$(http :8092/results | jq -r .)" == "{}" ]]; do echo "Waiting for some results to show up on adder-2..."; sleep 1; done echo "Resultate für adder-1" -http -v :8091/results +http -v --pretty none -S :8091/results +echo echo "Resultate für adder-2" -http -v :8092/results +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 kill -s 9 adder-1 + +docker-compose start 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 +docker-compose kill -s 9 peter klaus +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 diff --git a/docker-compose.yml b/docker-compose.yml index 5ab11a0..5f0acac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -135,6 +135,7 @@ services: sumup.adder.throttle: 3ms spring.data.mongodb.uri: mongodb://juplo:training@mongo:27017 spring.data.mongodb.database: juplo + logging.level.org.apache.kafka.clients.consumer: DEBUG adder-2: image: juplo/sumup-adder:1.0-SNAPSHOT @@ -148,3 +149,25 @@ services: sumup.adder.throttle: 3ms spring.data.mongodb.uri: mongodb://juplo:training@mongo:27017 spring.data.mongodb.database: juplo + logging.level.org.apache.kafka.clients.consumer: DEBUG + + peter: + image: juplo/toolbox + command: > + bash -c " + while [[ true ]]; + do + echo 666 | http -v gateway:8080/peter; + sleep 1; + done + " + klaus: + image: juplo/toolbox + command: > + bash -c " + while [[ true ]]; + do + echo 666 | http -v gateway:8080/klaus; + sleep 1; + done + " -- 2.20.1