diff --git a/devopsMonitoring.tex b/devopsMonitoring.tex index 5b96e6f..6acc21c 100644 --- a/devopsMonitoring.tex +++ b/devopsMonitoring.tex @@ -31,7 +31,7 @@ what has been verified. \endhead \bottomrule \endlastfoot -1 & Deployment and reproducibility (15) & \StatusPending & Restart persistence recorded (Nov.~2). Backup procedure; second verifier.\\ +1 & Deployment and reproducibility (15) & \StatusPending & Restart persistence and backup recorded (Nov.~2). Second team member's verification.\\ 2 & Metrics and probes (15) & \StatusPending & Host comparison and target health recorded (Nov.~1). Team approval and reload time of the Jenkins probe exception.\\ 3 & HTTPS and access control (10) & \StatusPending & Public Grafana hostname; external exposure tests.\\ 4 & Dashboard and CI correlation (15) & \StatusPending & Dashboard screenshot recorded (Nov.~1). Normal-build before/during/after comparison.\\ @@ -150,8 +150,42 @@ volumes and all monitoring history. To upgrade, back up state, change one pinned tag, pull and recreate only that service, then verify health and persistence. Dashboards, the data source, and alert rules are provisioned from read-only files in Git, so they can be rebuilt; Prometheus history and -Grafana runtime state cannot. \StatusPending{} Document the backup procedure -for the two named volumes and the rollback compatibility check. +Grafana runtime state cannot. + +\paragraph{Backup procedure.} Each named volume is archived while its +service is briefly stopped, so the archive is consistent. Run from +\path{/home/ubuntu/monitoring}: +\begin{verbatim} +mkdir -p ~/backups +for s in prometheus grafana; do + docker compose stop $s + docker run --rm -v monitoring_${s}_data:/data:ro \ + -v ~/backups:/backup alpine \ + tar czf /backup/${s}_data-$(date -u +%Y%m%dT%H%MZ).tgz -C /data . + docker compose start $s +done +\end{verbatim} +To restore one service, stop it, empty its volume, extract the archive into +the volume with the same \texttt{alpine} container (\texttt{tar xzf} into +\texttt{/data}), and start it again. Before an image upgrade, take a backup +first; Grafana and Prometheus can change their storage format, so rolling +back to an older image must use the backup taken before the upgrade, not +the upgraded volume. + +\StatusPass{} The procedure ran on November 2 at 16:39~UTC +(\autoref{Figure:MonitoringBackup}): \path{prometheus_data-20261102T1639Z.tgz} +(12~MB) and \path{grafana_data-20261102T1639Z.tgz} (163~MB). Each service was +down for a few seconds, and both returned to running; Grafana logged its +startup at 16:40:27~UTC. \StatusPending{} The archives are on the same host, +so they do not survive loss of the instance; copy them off the host, and +restrict them to mode 0600 because the Grafana archive contains its database. +A restore has not been tested. + +\begin{figure}[htbp]\centering +\includegraphics[width=0.8\linewidth]{prism-uploads/ch5-backup.png} +\caption{Backup archives of the two monitoring volumes, November 2, 2026.} +\label{Figure:MonitoringBackup} +\end{figure} \subsection{Restart Persistence} \StatusPass{} After the incident on November 2, Prometheus was restarted at diff --git a/prism-uploads/ch5-backup.png b/prism-uploads/ch5-backup.png new file mode 100644 index 0000000..3bf46f9 Binary files /dev/null and b/prism-uploads/ch5-backup.png differ