Выполнить лабораторную 3: балансировка, отказы и исследование масштабирования

This commit is contained in:
wpyatzy
2026-10-30 20:42:40 +03:00
parent 0ab3a341aa
commit 62de9484fe
112 changed files with 1187581 additions and 55 deletions
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
: "${TARGET_INSTANCE_ID:?Required API hostname from X-Instance-Id}"
for id in $(scripts/compose.sh ps -q api); do
hostname=$(docker inspect --format '{{.Config.Hostname}}' "$id")
if [ "$hostname" = "$TARGET_INSTANCE_ID" ]; then
docker stop --time 3 "$id" >/dev/null
exit 0
fi
done
printf '%s\n' 'Target is not a running API replica' >&2
exit 1