Обновила скрипты restart

This commit is contained in:
vasyukova
2026-11-06 00:53:49 +03:00
parent 8bd408b5d1
commit 497c6a8f05
2 changed files with 27 additions and 10 deletions
+14 -4
View File
@@ -1,19 +1,29 @@
#!/bin/sh
set -eu
# Перезапускаем LB, обе реплики API, PostgreSQL, Redis, MinIO и s3_cleanup (тома сохраняются)
# lab7: перезапуск LB, обеих реплик API, PostgreSQL, Redis, MinIO, OpenBao
# и s3_cleanup. Volumes сохраняются. После рестарта OpenBao sealed —
# его надо распечатать (unseal), что делает openbao-init (идемпотентно).
# 1) openbao после рестарта sealed — unseal через openbao-init.
# openbao-init зависит от openbao (healthy) и security_init (completed).
docker compose --env-file .env up -d openbao >/dev/null 2>&1 || true
docker compose --env-file .env run --rm --no-deps openbao-init >/dev/null 2>&1 || true
# 2) Перезапуск остальных сервисов (volumes сохраняются).
docker compose --env-file .env restart lb api postgres redis minio s3_cleanup >/dev/null 2>&1 || {
docker restart mtuci-lb >/dev/null 2>&1 || true
docker restart mtuci-postgres >/dev/null 2>&1 || true
docker restart mtuci-redis >/dev/null 2>&1 || true
docker restart mtuci-minio >/dev/null 2>&1 || true
for c in $(docker ps -a --filter "name=mtuci2026lab4_api" -q); do
for c in $(docker ps -a --filter "name=mtuci2026lab7_api" -q); do
docker restart "$c" >/dev/null 2>&1 || true
done
}
# Ждём readiness
# 3) Ждём готовности LB :8443 по HTTPS с проверкой CA.
i=0
while [ $i -lt 90 ]; do
if curl -fsS http://localhost:8080/health/ready >/dev/null 2>&1; then
if curl -fsS --cacert ./certs/ca.crt https://localhost:8443/health/ready >/dev/null 2>&1; then
exit 0
fi
i=$((i+1)); sleep 1