Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CN/modules/ROOT/pages/9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,27 @@ $ pg_basebackup -D - -Ft -X fetch | bzip2 > backup.tar.bz2
$ pg_basebackup -D backup/data -T /opt/ts=$(pwd)/backup/ts
```

==== 合成增量备份链

要恢复 `inc2`,按时间顺序传入完整备份和它依赖的每份增量备份。对于 `full` → `inc1` → `inc2` 这条备份链,使用为空或尚未创建的输出目录 `/srv/backup/rebuilt`。命令结束前,保留所有输入备份及其清单。

[source,sh]
----
pg_combinebackup --output=/srv/backup/rebuilt /srv/backup/full /srv/backup/inc1 /srv/backup/inc2
pg_verifybackup /srv/backup/rebuilt
----

`pg_combinebackup` 在输出目录中生成完整备份。启动恢复实例前,用 `pg_verifybackup` 对照清单检查合成结果。

如果集簇还有额外表空间,将最后一份输入备份中的表空间路径映射到空的恢复位置。如果 `pg_basebackup` 已重定位表空间,应使用备份路径。例如,`inc2` 将一个表空间链接到 `/srv/backup/inc2-ts` 时,第一条命令使用以下形式。

[source,sh]
----
pg_combinebackup --output=/srv/backup/rebuilt --tablespace-mapping=/srv/backup/inc2-ts=/restore/ts /srv/backup/full /srv/backup/inc1 /srv/backup/inc2
----

映射的目标目录也应为空或尚未创建,用于保存合成后的表空间文件。

=== pgbench

pgbench — 在IvorySQL上运行一个基准测试
Expand Down
21 changes: 21 additions & 0 deletions EN/modules/ROOT/pages/9.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,27 @@ To create a backup of a local server with one tar file for each tablespace compr
$ pg_basebackup -D backup -Ft --compress=gzip:9
```

==== Reconstruct an incremental backup

To restore `inc2`, supply the full backup and every incremental backup on which it depends, in chronological order. For a chain `full` → `inc1` → `inc2`, use empty or nonexistent output directory `/srv/backup/rebuilt`. Keep the input backups and their manifests available until the command finishes.

[source,sh]
----
pg_combinebackup --output=/srv/backup/rebuilt /srv/backup/full /srv/backup/inc1 /srv/backup/inc2
pg_verifybackup /srv/backup/rebuilt
----

`pg_combinebackup` writes a full backup to the output directory. Use `pg_verifybackup` to check that reconstructed backup against its manifest before starting a server from it.

For additional tablespaces, map their paths in the last input backup to empty restore locations. If `pg_basebackup` relocated the tablespaces, use those backup paths, not the paths on the source server. For example, when `inc2` links a tablespace to `/srv/backup/inc2-ts`, use this form of the first command.

[source,sh]
----
pg_combinebackup --output=/srv/backup/rebuilt --tablespace-mapping=/srv/backup/inc2-ts=/restore/ts /srv/backup/full /srv/backup/inc1 /srv/backup/inc2
----

The mapping's destination must also be empty or nonexistent. It identifies where the reconstructed tablespace files will be written.

=== pgbench

pgbench — run a benchmark test on IvorySQL
Expand Down
Loading