sadanand48 commented on code in PR #526: URL: https://github.com/apache/ozone-site/pull/526#discussion_r3851336118
########## docs/05-administrator-guide/03-operations/16-backup-and-recovery/01-om-metadata-backup.md: ########## @@ -0,0 +1,141 @@ +--- +sidebar_label: OM metadata backup +--- + +# OM metadata backup (including bucket snapshots) + +Back up **Ozone Manager (OM) namespace metadata**, including **bucket snapshot** RocksDB state. This is not a substitute for Datanode block or SCM metadata backups. + +The transfer uses the same v2 checkpoint mechanism as OM HA follower bootstrap ([design doc](../../../system-internals/features/om-bootstrapping-with-snapshots)). + +## What is included + +- `om.db` — volumes, buckets, keys, and related AOS metadata +- `db.snapshots` — bucket snapshot RocksDB state (when snapshots exist on the leader) +- Compaction backup and log directories needed to read snapshot SST files + +Requires Ozone **2.2+** with inode-based checkpoint transfer (default: `ozone.om.db.checkpoint.use.inode.based.transfer=true`). + +## Backup and restore (recommended) + +Use `ozone repair om download` ([HDDS-16171](https://issues.apache.org/jira/browse/HDDS-16171)) when a live OM is reachable. It handles multi-batch transfer, hard link reconstruction, and writes a **ready-to-install** copy of everything under `--output-dir` (including `db.snapshots` when snapshots exist on the leader). No separate snapshot steps. + +**Requirements:** `ozone-site.xml` on the host; `kinit` in secure clusters (`ozone.administrators`); stop the **target** OM before installing downloaded metadata. + +```shell +# Download +ozone repair om download --output-dir /backup/om-metadata --overwrite + +# OM HA — add --service-id; --node-id targets a specific OM (leader recommended) +ozone repair om download \ + --service-id <om-service-id> \ + --node-id <om-node-id> \ + --output-dir /backup/om-metadata \ + --overwrite + +# Archive off-cluster (top-level om-metadata/ directory in the tarball) +tar -czf om-metadata-$(date +%Y%m%d).tar.gz -C /backup om-metadata +``` + +**Restore** — stop the target OM first. If a live OM is still up, re-run `ozone repair om download`. Otherwise extract a CLI backup archive and install: + +```shell +mkdir -p /restore +tar -xzf om-metadata-YYYYMMDD.tar.gz -C /restore # yields /restore/om-metadata/ + +OM_DB_DIRS=/var/lib/ozone/om/metadata # ozone.om.db.dirs +rm -rf "$OM_DB_DIRS/om.db" "$OM_DB_DIRS/db.snapshots" +rsync -a /restore/om-metadata/ "$OM_DB_DIRS/" + +# Start OM; verify with: ozone sh volume list +``` + +For HA with an intact Ratis ring, prefer `ozone om --bootstrap` over manual install. See [Replacing Ozone Manager disks](../disk-replacement/ozone-manager) and [Ozone Repair](../tools/ozone-repair#download). + +## Alternative: HTTP checkpoint download + +Use `curl` or `om-metadata-backup.sh` only when the backup host has no Ozone CLI. This runs the same `/v2/dbCheckpoint` transfer, but the saved tarball stays in inode-based form and needs hard link reconstruction before install. Review Comment: problem with direct curl for V2 is that it doesn't construct the paths from hardlink file. We can document this limitation if we are going with the alternative , while the backup is available it needs the unpack logic from folloer -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
