homelab-brain/arakava-news/scripts/README-mirror-sync.md
2026-06-28 19:36:11 +02:00

1.3 KiB

CT600 wp-mirror Sync

Nächtlicher Pull CT101 → CT600 auf pve-mu-3.

CT101-Sicherheit

Operation Auswirkung auf CT101
mysqldump --single-transaction --quick Read-only Snapshot, ~10 s, keine Table-Locks (InnoDB)
tar aus Docker-Volume Nur Lesen, kein Container-Restart
Health-Check vor/nach Sync Abbruch wenn Primary down

Nicht gemacht: docker restart, mysqladmin flush, Schreibzugriffe, Plugin-Updates.

Deployment

Ort Pfad
Git arakava-news/scripts/wp-mirror-sync.sh
pve-mu-3 /opt/wp-mirror-sync/sync-from-101.sh
Log /var/log/wp-mirror-sync.log
Staging /opt/wp-mirror-sync/staging/

Cron (pve-mu-3)

0 4 * * * root /opt/wp-mirror-sync/sync-from-101.sh >> /var/log/wp-mirror-sync.log 2>&1

Failover pausieren

touch /opt/wp-mirror-sync/FAILOVER_ACTIVE
# nach Failback:
rm /opt/wp-mirror-sync/FAILOVER_ACTIVE

Manuell

ssh pve-mu-3 '/opt/wp-mirror-sync/sync-from-101.sh'

Loki / Hausmeister

  • Promtail auf CT600 (host=wp-mirror), Install: arakava-news/scripts/install-promtail-ct600.sh
  • Sync-Logs landen in CT600 /var/log/wp-mirror-sync.log → Loki
  • Hausmeister: check_wp_mirror_sync() — Alert bei ABORT oder fehlendem DONE (ab 06:00)
  • Grafana: {host="wp-mirror"}