diff --git a/CN/modules/ROOT/pages/9.adoc b/CN/modules/ROOT/pages/9.adoc index 2432ee47..21780a41 100644 --- a/CN/modules/ROOT/pages/9.adoc +++ b/CN/modules/ROOT/pages/9.adoc @@ -897,10 +897,18 @@ pg_basebackup — 获得一个IvorySQL集簇的一个基础备份 为输出选择格式。*`format`* 可以是下列之一: `p` `plain` 把输出写成平面文件,使用和源服务器数据目录和表空间相同的布局。 当集簇没有额外表空间时,整个数据库将被放在目标目录中。 如果集簇包含额外的表空间,主数据目录将被放置在目标目录中,但是所有其他表空间将被放在它们位于源服务器上的相同的绝对路径中。 (参见 `--tablespace-mapping` 来更改。)这是默认格式。`t` `tar` 将输出作为tar文件写入目标目录中。 主数据目录的内容将被写入名为 `base.tar` 的文件,而其他表空间将被写入以该表空间的OID命名的单独的tar文件。如果将目标目录指定为 `-`(破折号),则tar内容将被写入标准输出,该标准输出适用于管道传输至gzip(例如)。 只有当集簇没有额外表空间并且没有使用WAL流时才允许这样做。 +- `-i *old_manifest_file*` `--incremental=*old_manifest_file*` + +执行增量备份。必须提供参考备份的备份清单,该清单将被上传到服务器,服务器将通过发送所请求的增量备份来进行响应。 + - `-R` `--write-recovery-conf` 创建一个 http://www.postgresql.org/docs/17/warm-standby.html#FILE-STANDBY-SIGNAL[`standby.signal`] 文件,并将连接设置附加到目标目录(或使用tar格式的基本存档文件中)的 `postgresql.auto.conf` 文件中。 这样可以简化使用备份结果设置后备服务器的过程。 `postgresql.auto.conf` 文件将记录连接设置(如果有)以及pg_basebackup所使用的复制槽,这样流复制后面就会使用相同的设置。 +- `-t *target*` `--target=*target*` + +指示服务器将基础备份放置在何处。默认目标是 `client`,指定应将备份发送到运行 pg_basebackup 的计算机。如果目标改为设置为 `server:/some/path`,则备份将存储在运行服务器的计算机的 `/some/path` 目录中。将备份存储在服务器上需要超级用户权限或具有 `pg_write_server_files` 角色的权限。如果目标设置为 `blackhole`,则会丢弃内容且不存储在任何位置。这应仅用于测试目的,因为最终不会生成实际的备份。由于 WAL 流式传输由 pg_basebackup 而不是由服务器实现,因此此选项不能与 `-Xstream` 一起使用。由于这是默认设置,因此在指定此选项时,还必须指定 `-Xfetch` 或 `-Xnone`。 + - `-T *olddir*=*newdir*` `--tablespace-mapping=*olddir*=*newdir*` 在备份期间将目录 *`olddir`* 中的表空间重定位到 *`newdir`* 中。为使之有效,*`olddir`* 必须与源服务器上定义的表空间的路径规范完全匹配。(但如果备份中没有包含 *`olddir`* 中的表空间也不是错误)。同时,*`newdir`* 是接收主机文件系统中的目录。与主目标目录一样,*`newdir`* 不必已经存在,但是如果确实存在,则必须为空。*`olddir`* 和 *`newdir`* 必须是绝对路径。如果一个路径凑巧包含了一个 `=` 符号,可用反斜线对它转义。对于多个表空间可以多次使用这个选项。如果以这种方法重定位一个表空间,主数据目录中的符号链接会被更新成指向新位置。因此新数据目录已经可以被一个所有表空间位于更新后位置的新服务器实例使用。目前,这个选项仅以普通输出格式工作,如果选择了tar格式,请忽略它。 @@ -985,6 +993,9 @@ pg_basebackup — 获得一个IvorySQL集簇的一个基础备份 如果在取基础备份的服务器上启用了校验码验证,则禁用校验码验证。默认情况下,校验码会被验证并且校验码失败将会导致一种非零的退出状态。不过,基础备份在这种情况下将不会被移除,就好像使用了 `--no-clean` 选项一样。校验和验证失败也将报告在 http://www.postgresql.org/docs/17/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW[`pg_stat_database`] 视图中。 +- `--sync-method=*method*` + +当设置为 `fsync`(默认值)时,pg_basebackup 将递归打开并同步备份目录中的所有文件。当使用普通(plain)格式时,搜索文件将跟随 WAL 目录和每个已配置表空间的符号链接。在 Linux 上,可以使用 `syncfs` 来请求操作系统同步包含备份目录的整个文件系统。当使用普通格式时,pg_basebackup 还将同步包含 WAL 文件和每个表空间的文件系统。有关使用 `syncfs` 时需要注意的事项,请参阅 `recovery_init_sync_method`。当使用 `--no-sync` 时,此选项无效。 以下命令行选项控制到源服务器的连接: diff --git a/EN/modules/ROOT/pages/9.adoc b/EN/modules/ROOT/pages/9.adoc index d4b420c6..d05b1cf7 100644 --- a/EN/modules/ROOT/pages/9.adoc +++ b/EN/modules/ROOT/pages/9.adoc @@ -903,6 +903,10 @@ Sets the target directory to write the output to. pg_basebackup will create this Selects the format for the output. *`format`* can be one of the following: `p` `plain` Write the output as plain files, with the same layout as the source server's data directory and tablespaces. When the cluster has no additional tablespaces, the whole database will be placed in the target directory. If the cluster contains additional tablespaces, the main data directory will be placed in the target directory, but all other tablespaces will be placed in the same absolute path as they have on the source server. (See `--tablespace-mapping` to change that.)This is the default format. `t` `tar` Write the output as tar files in the target directory. The main data directory's contents will be written to a file named `base.tar`, and each other tablespace will be written to a separate tar file named after that tablespace's OID.If the target directory is specified as `-` (dash), the tar contents will be written to standard output, suitable for piping to (for example) gzip. This is only allowed if the cluster has no additional tablespaces and WAL streaming is not used. +- `-i *old_manifest_file*` `--incremental=*old_manifest_file*` + +Performs an incremental backup. The backup manifest for the reference backup must be provided, and will be uploaded to the server, which will respond by sending the requested incremental backup. + - `-R` `--write-recovery-conf` Creates a http://www.postgresql.org/docs/17/warm-standby.html#FILE-STANDBY-SIGNAL[`standby.signal`] file and appends connection settings to the `IvorySQL.auto.conf` file in the target directory (or within the base archive file when using tar format). This eases setting up a standby server using the results of the backup.The `IvorySQL.auto.conf` file will record the connection settings and, if specified, the replication slot that pg_basebackup is using, so that streaming replication will use the same settings later on. @@ -993,6 +997,10 @@ Prevents the creation of a temporary replication slot for the backup.By default, Disables verification of checksums, if they are enabled on the server the base backup is taken from.By default, checksums are verified and checksum failures will result in a non-zero exit status. However, the base backup will not be removed in such a case, as if the `--no-clean` option had been used. Checksum verification failures will also be reported in the http://www.postgresql.org/docs/17/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW[`pg_stat_database`] view. +- `--sync-method=*method*` + +When set to `fsync`, which is the default, pg_basebackup will recursively open and synchronize all files in the backup directory. When the plain format is used, the search for files will follow symbolic links for the WAL directory and each configured tablespace. On Linux, `syncfs` may be used instead to ask the operating system to synchronize the whole file system that contains the backup directory. When the plain format is used, pg_basebackup will also synchronize the file systems that contain the WAL files and each tablespace. See `recovery_init_sync_method` for information about the caveats to be aware of when using `syncfs`. This option has no effect when `--no-sync` is used. + The following command-line options control the connection to the source server: - `-d *connstr*` `--dbname=*connstr*`