[#2] master模块使用supervisor守护;增加dns-monitor功能;内网apt源
This commit is contained in:
@@ -93,7 +93,6 @@ keys = [
|
||||
"health",
|
||||
"last_report",
|
||||
"agent_last_report",
|
||||
"status",
|
||||
]
|
||||
for key in keys:
|
||||
if before.get(key) != after.get(key):
|
||||
@@ -119,13 +118,37 @@ keys = [
|
||||
"health",
|
||||
"last_report",
|
||||
"agent_last_report",
|
||||
"status",
|
||||
]
|
||||
for key in keys:
|
||||
if before.get(key) != after.get(key):
|
||||
raise AssertionError(f"Key {key} changed after restart: {before.get(key)} -> {after.get(key)}")
|
||||
PY
|
||||
|
||||
payload=$(python3 - <<'PY'
|
||||
import json
|
||||
from datetime import datetime, timezone
|
||||
body = {
|
||||
"timestamp": datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z"),
|
||||
"health": {
|
||||
"log-fluentbit": {"status": "healthy"}
|
||||
}
|
||||
}
|
||||
print(json.dumps(body))
|
||||
PY
|
||||
)
|
||||
|
||||
curl -sS -o "$TMP_ROOT/restart_second_status.json" -w '%{http_code}' \
|
||||
-H 'Content-Type: application/json' -X PUT \
|
||||
"$API_BASE/nodes/$SECOND_NODE_ID/status" -d "$payload" > "$TMP_ROOT/restart_second_status_code"
|
||||
|
||||
if [[ $(cat "$TMP_ROOT/restart_second_status_code") != "200" ]]; then
|
||||
echo "[ERROR] Failed to restore second node status post-restart" >&2
|
||||
cat "$TMP_ROOT/restart_second_status.json" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sleep 3
|
||||
|
||||
# 对比重启前后的 nodes.json 与统计信息,验证持久化一致性
|
||||
nodes_json_after="$TMP_ROOT/nodes_json_post_restart.json"
|
||||
cp "$PRIVATE_ROOT/argus/metric/prometheus/nodes.json" "$nodes_json_after"
|
||||
|
||||
Reference in New Issue
Block a user