forked from mtusi2026/mtusi2026lab4
Implement lab4 attachments on RustFS for grade 4.
Carry over lab3 HA stack and add private S3 storage, Attachment API, orphan compensation/reaper, own tests, and evidence for smoke/persistence/failover.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
# Stop ONE API replica matching TARGET_INSTANCE_ID (= X-Instance-Id = container hostname).
|
||||
# Leave it stopped; do not touch DB/LB/volumes. Return quickly.
|
||||
cd "$(dirname "$0")/.."
|
||||
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID required}"
|
||||
|
||||
for id in $(docker compose --env-file .env ps -q api); do
|
||||
[ -n "$id" ] || continue
|
||||
host=$(docker inspect -f '{{.Config.Hostname}}' "$id")
|
||||
if [ "$host" = "$TARGET_INSTANCE_ID" ]; then
|
||||
docker stop "$id" >/dev/null
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
printf '%s\n' "API replica not found for TARGET_INSTANCE_ID" >&2
|
||||
exit 1
|
||||
Reference in New Issue
Block a user