Re: pg_archivecleanup - Increase time files are deleted

Поиск
Список
Период
Сортировка
От Ian Barwick
Тема Re: pg_archivecleanup - Increase time files are deleted
Дата
Msg-id 577067A1.9090508@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: pg_archivecleanup - Increase time files are deleted  (Patrick B <patrickbakerbr@gmail.com>)
Ответы Re: pg_archivecleanup - Increase time files are deleted  (Melvin Davidson <melvin6925@gmail.com>)
Список pgsql-general
On 06/27/2016 06:33 AM, Patrick B wrote:
>>> ...I'd like to have the wal_files stored for 24h, and then the
>> pg_archivecleanup could do its job and delete the files..
>>
>>
>> *You cannot do that, but you can change the wal_keep_segments
>> <https://www.postgresql.org/docs/9.4/static/runtime-config-replication.html#GUC-WAL-KEEP-SEGMENTS>
>> on the master and reload the postgresql.conf.*
>> *https://www.postgresql.org/docs/9.4/static/runtime-config-replication.html#GUC-WAL-KEEP-SEGMENTS
>> <https://www.postgresql.org/docs/9.4/static/runtime-config-replication.html#GUC-WAL-KEEP-SEGMENTS>*
>>
>
> ok.. my current wal_keep_segments is:
>
> wal_keep_segments = 256
> That means there will be at least 256 files before postgres delete them?
>>
>> Please, in the future, remember to state your *PostgreSQL version and O/S*
>> as options can change.
>>
>>
> Ok.. my mistake.. I'm running PostgreSQL 9.2 in a Centos 6.7 64 bits.

FYI PostgreSQL 9.4 and later provide "replication slots", which will ensure that all WAL
files are kept until no longer required by standbys:

   https://www.postgresql.org/docs/current/static/warm-standby.html#STREAMING-REPLICATION-SLOTS

This removes the need for guesswork on how much WAL to retain, though you do then need to be
careful that all standbys are actually consuming WAL otherwise files will be retained for ever
(or until disk space runs out, whichever comes first).

Regards

Ian Barwick


--
  Ian Barwick                   http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services


В списке pgsql-general по дате отправления:

Предыдущее
От: Patrick B
Дата:
Сообщение: Re: pg_archivecleanup - Increase time files are deleted
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: pg_archivecleanup - Increase time files are deleted