X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=README.sh;h=f337d5ce9067fb3aa41202b29615333057aca40d;hb=refs%2Fheads%2Fsumup-adder--rebalance-listener--sticky-assignor;hp=6be4b11879af0fdc8d4f5867145ccb4f22412fca;hpb=4555c5783f1d27e896c54591bfb6d433beb57556;p=demos%2Fkafka%2Ftraining diff --git a/README.sh b/README.sh index 6be4b11..f337d5c 100755 --- a/README.sh +++ b/README.sh @@ -28,89 +28,63 @@ fi echo "Waiting for the Kafka-Cluster to become ready..." docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1 docker-compose up setup -docker-compose up -d gateway requests-1 requests-2 adder-1 adder-2 +docker-compose up -d gateway requests-1 requests-2 while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for gateway..."; sleep 1; done 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 -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 docker-compose up -d peter klaus +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 -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" -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 -sleep 1 -echo "Resultate für adder-2" -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..."; 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 + +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 :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 --pretty none -S :8091/results +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 kill -s 9 adder-1 +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 peter to show up on adder-2..."; sleep 1; done + +echo "Resultate für adder-2" +http -v --pretty none -S :8092/results +echo -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 + +docker-compose kill -s 9 peter klaus