Re: Archive clean up command in recovery.conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

check notes after

archive cleanup command  from https://www.postgresql.org/docs/9.1/static/archive-recovery-settings.html

i think it's not for you because you have 3 serveurs and two slaves.. check replication slot instead it's most efficient for your usage.

archive_cleanup_command (string)

This optional parameter specifies a shell command that will be executed at every restartpoint. The purpose of archive_cleanup_command is to provide a mechanism for cleaning up old archived WAL files that are no longer needed by the standby server. Any %r is replaced by the name of the file containing the last valid restart point. That is the earliest file that must be kept to allow a restore to be restartable, and so all files earlier than %r may be safely removed. This information can be used to truncate the archive to just the minimum required to support restart from the current restore. The pg_archivecleanup module is often used in archive_cleanup_command for single-standby configurations, for example:

archive_cleanup_command = 'pg_archivecleanup /mnt/server/archivedir %r'

Note however that if multiple standby servers are restoring from the same archive directory, you will need to ensure that you do not delete WAL files until they are no longer needed by any of the servers. archive_cleanup_command would typically be used in a warm-standby configuration (see Section 25.2). Write %% to embed an actual % character in the command.

If the command returns a non-zero exit status then a WARNING log message will be written.


Le 23/09/2018 à 14:13, "> Prince Pathria (par Internet, dépôt pgsql-admin-owner+m63745-89476@xxxxxxxxxxxxxxxxxxxx)" a écrit :
Hi,

I have a doubt, assume that I have 3 psql10 nodes (n1, n2, n3) and n1 is master ,n2+n3 are standbys. In n1 archive mode is on, and wal_logs are going to volume which is shared with n2 and n3. If   archive_cleanup_command = 'pg_archivecleanup /path/to/nfs %r' is enabled on both n2 and n3.

Can a situation might arise that a wal segment required by n2 is already cleaned up by n3?

If yes, then how to mitigate it?

Thanks!
Prince Pathria Systems Architect Evive +91 9478670472 goevive.com


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux