recovery.conf and archive files

Started by Ritaover 3 years ago5 messagesgeneral
Jump to latest
#1Rita
rmorgan466@gmail.com

I have primary and standby replication setup.

On my primary the archive directory is rather large (30GB) and growing. On
my standby I have recovery.conf which has
archive_cleanup_command = 'pg_archivecleanup -d
/var/lib/pgsql/11/data/archive %r'

I was under the impression this line would remove data from my primary AND
standby. Is that not the case?

-- 
--- Get your facts first, then you can distort them as you please.--
#2Guillaume Lelarge
guillaume@lelarge.info
In reply to: Rita (#1)
Re: recovery.conf and archive files

Hi,

Le dim. 9 oct. 2022 à 13:54, Rita <rmorgan466@gmail.com> a écrit :

I have primary and standby replication setup.

On my primary the archive directory is rather large (30GB) and growing. On
my standby I have recovery.conf which has
archive_cleanup_command = 'pg_archivecleanup -d
/var/lib/pgsql/11/data/archive %r'

I was under the impression this line would remove data from my primary AND
standby. Is that not the case?

pg_archivecleanup will clean up the *local* directory. It won't clean up
the archive directory if it's stored on the primary.

If I misunderstood your issue, it would be great to send us the
postgresql.conf file from your primary.

--
Guillaume.

#3Rita
rmorgan466@gmail.com
In reply to: Guillaume Lelarge (#2)
Re: recovery.conf and archive files

The primary's recovery.conf looks like this

listen_address='*'
wal_level=replica
synchronous_commit=local
archive_move = on
archive_command = 'cp %p /var/lib/pgsql/11/data/archive/%f'
max_wal_senders = 10
wal_keep_segments=10
synchronous_standby_names='standby0'
wal_log_hints=on

On Sun, Oct 9, 2022 at 8:45 AM Guillaume Lelarge <guillaume@lelarge.info>
wrote:

Hi,

Le dim. 9 oct. 2022 à 13:54, Rita <rmorgan466@gmail.com> a écrit :

I have primary and standby replication setup.

On my primary the archive directory is rather large (30GB) and growing.
On my standby I have recovery.conf which has
archive_cleanup_command = 'pg_archivecleanup -d
/var/lib/pgsql/11/data/archive %r'

I was under the impression this line would remove data from my primary
AND standby. Is that not the case?

pg_archivecleanup will clean up the *local* directory. It won't clean up
the archive directory if it's stored on the primary.

If I misunderstood your issue, it would be great to send us the
postgresql.conf file from your primary.

--
Guillaume.

-- 
--- Get your facts first, then you can distort them as you please.--
#4Guillaume Lelarge
guillaume@lelarge.info
In reply to: Rita (#3)
Re: recovery.conf and archive files

Le jeu. 13 oct. 2022 à 12:42, Rita <rmorgan466@gmail.com> a écrit :

The primary's recovery.conf looks like this

listen_address='*'
wal_level=replica
synchronous_commit=local
archive_move = on
archive_command = 'cp %p /var/lib/pgsql/11/data/archive/%f'
max_wal_senders = 10
wal_keep_segments=10
synchronous_standby_names='standby0'
wal_log_hints=on

The archive command stores the WAL in a local directory. That's what I said
earlier.

On Sun, Oct 9, 2022 at 8:45 AM Guillaume Lelarge <guillaume@lelarge.info>
wrote:

Hi,

Le dim. 9 oct. 2022 à 13:54, Rita <rmorgan466@gmail.com> a écrit :

I have primary and standby replication setup.

On my primary the archive directory is rather large (30GB) and growing.
On my standby I have recovery.conf which has
archive_cleanup_command = 'pg_archivecleanup -d
/var/lib/pgsql/11/data/archive %r'

I was under the impression this line would remove data from my primary
AND standby. Is that not the case?

pg_archivecleanup will clean up the *local* directory. It won't clean up
the archive directory if it's stored on the primary.

If I misunderstood your issue, it would be great to send us the
postgresql.conf file from your primary.

--
Guillaume.

--
--- Get your facts first, then you can distort them as you please.--

--
Guillaume.

#5Rita
rmorgan466@gmail.com
In reply to: Guillaume Lelarge (#4)
Re: recovery.conf and archive files

is the archive command even needed? I can see my standby fully synced.

On Fri, Oct 14, 2022 at 5:27 AM Guillaume Lelarge <guillaume@lelarge.info>
wrote:

Le jeu. 13 oct. 2022 à 12:42, Rita <rmorgan466@gmail.com> a écrit :

The primary's recovery.conf looks like this

listen_address='*'
wal_level=replica
synchronous_commit=local
archive_move = on
archive_command = 'cp %p /var/lib/pgsql/11/data/archive/%f'
max_wal_senders = 10
wal_keep_segments=10
synchronous_standby_names='standby0'
wal_log_hints=on

The archive command stores the WAL in a local directory. That's what I
said earlier.

On Sun, Oct 9, 2022 at 8:45 AM Guillaume Lelarge <guillaume@lelarge.info>
wrote:

Hi,

Le dim. 9 oct. 2022 à 13:54, Rita <rmorgan466@gmail.com> a écrit :

I have primary and standby replication setup.

On my primary the archive directory is rather large (30GB) and growing.
On my standby I have recovery.conf which has
archive_cleanup_command = 'pg_archivecleanup -d
/var/lib/pgsql/11/data/archive %r'

I was under the impression this line would remove data from my primary
AND standby. Is that not the case?

pg_archivecleanup will clean up the *local* directory. It won't clean up
the archive directory if it's stored on the primary.

If I misunderstood your issue, it would be great to send us the
postgresql.conf file from your primary.

--
Guillaume.

--
--- Get your facts first, then you can distort them as you please.--

--
Guillaume.

-- 
--- Get your facts first, then you can distort them as you please.--