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
14 changes: 14 additions & 0 deletions CN/modules/ROOT/pages/master/tools_reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2802,6 +2802,20 @@ $ edit /usr/local/pgsql/data/note.to.self
$ pg_verifybackup --ignore=note.to.self --skip-checksums /usr/local/pgsql/data
```

==== 创建并校验基础备份

本例假定主库没有额外表空间,备份用户拥有复制权限,目标目录为空或尚未创建。在 `pg_hba.conf` 中允许复制连接,并为备份流和 WAL 流预留两个 WAL 发送连接。使用与服务器主版本一致的 IvorySQL 工具运行以下命令。

[source,sh]
----
pg_basebackup --host=primary.example --username=backup_user \
--pgdata=/srv/backups/ivorysql-base --format=plain --wal-method=stream \
--manifest-checksums=SHA256
pg_verifybackup /srv/backups/ivorysql-base
----

`pg_basebackup` 将 `backup_manifest` 写入备份目录。备份文件、清单和随备份接收的 WAL 应一同保存。`pg_verifybackup` 对照清单检查文件,并解析备份所需范围的 WAL。如果校验失败,保留原始错误信息并重新备份。在独立的数据目录中演练恢复,再将备份用于实际恢复。

=== psql

psql — IvorySQL的交互式终端
Expand Down
14 changes: 14 additions & 0 deletions EN/modules/ROOT/pages/master/tools_reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2761,6 +2761,20 @@ $ edit /usr/local/pgsql/data/note.to.self
$ pg_verifybackup --ignore=note.to.self --skip-checksums /usr/local/pgsql/data
```

==== Take and verify a base backup

The example assumes a primary with no additional tablespaces, a user with replication access, and an empty or nonexistent backup directory. Allow replication connections in `pg_hba.conf` and reserve two WAL sender connections for the backup and WAL stream. Run both commands with the IvorySQL tools from the server's major version.

[source,sh]
----
pg_basebackup --host=primary.example --username=backup_user \
--pgdata=/srv/backups/ivorysql-base --format=plain --wal-method=stream \
--manifest-checksums=SHA256
pg_verifybackup /srv/backups/ivorysql-base
----

`pg_basebackup` writes `backup_manifest` alongside the backup files. Keep the manifest and the streamed WAL with the backup. `pg_verifybackup` checks the files against the manifest and parses the WAL ranges required by the backup. If verification fails, keep the original diagnostics and take a fresh backup. Test recovery in a separate data directory before relying on the backup.

=== psql

psql — IvorySQL interactive terminal
Expand Down
Loading