简体   繁体   English

Postgresql pg_basebackup 和 archive_command

[英]Postgresql pg_basebackup and archive_command

I'm considering the delete archive_command due to the pg_basebackup introduction which executed is during replication.由于在复制期间执行的 pg_basebackup 介绍,我正在考虑删除 archive_command。 I'm not sure if I understand it correctly - I assume that I don't need archive_command, because pg_basebackup -X stream - will backup also the pg_wal directory, so I don't want to duplicate WALs made by archive_command.我不确定我是否理解正确 - 我假设我不需要 archive_command,因为 pg_basebackup -X stream - 也会备份 pg_wal 目录,所以我不想复制由 archive_command 制作的 WAL。

Could you tell me if it's a good option?你能告诉我这是否是一个好的选择吗? Thanks.谢谢。

Without a WAL archive, a backup can only be restored as of a single point in time, the moment when the backup task finished.如果没有 WAL 存档,则只能在单个时间点(即备份任务完成的那一刻)恢复备份。

With a WAL archive, you can restore to any point in time going forward from when the backup finished up until the most recent WAL file archival.使用 WAL 存档,您可以恢复到从备份完成到最近的 WAL 文件存档的任何时间点。 Whether this ability is of any value to you is something you need to answer for yourself.这种能力对你是否有价值,你需要自己回答。

If you do keep an archive, then you can do the basebackup with -X none to avoid duplicating WALs.如果您确实保留了存档,那么您可以使用-X none进行基本备份以避免重复 WAL。 Although I would think the extra protection of having a few key WAL files duplicated is usually worth the extra space.虽然我认为复制几个关键 WAL 文件的额外保护通常值得额外的空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM