pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedpgbackrest when data/base is symlinked to another volume
5+ messages / 2 participants
[nested] [flat]
* pgbackrest when data/base is symlinked to another volume
@ 2018-09-07 06:21 Ron <ronljohnsonjr@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Ron @ 2018-09-07 06:21 UTC (permalink / raw)
To: pgsql-general
Hi,
Will pgbackrest properly backup and restore the cluster if data/base,
data/pg_xlog and data/pg_log are symlinks?
PGDATA=/var/lib/pgsql/9.6/data
$PGDATA/base -> /Database/9.6/base
$PGDATA/pg_log -> /Database/9.6/pg_log
$PGDATA/pg_xlog -> /Database/9.6/pg_xlog
(I'm not just defining data_directory because the DBAs are used to looking
in $PGDATA and seeing all the relevant files.)
Thanks
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgbackrest when data/base is symlinked to another volume
@ 2018-09-07 22:22 David Steele <david@pgmasters.net>
parent: Ron <ronljohnsonjr@gmail.com>
0 siblings, 2 replies; 5+ messages in thread
From: David Steele @ 2018-09-07 22:22 UTC (permalink / raw)
To: Ron <ronljohnsonjr@gmail.com>; pgsql-general
Hi Ron,
On 9/6/18 11:21 PM, Ron wrote:
>
> Will pgbackrest properly backup and restore the cluster if data/base,
> data/pg_xlog and data/pg_log are symlinks?
>
> PGDATA=/var/lib/pgsql/9.6/data
> $PGDATA/base -> /Database/9.6/base
> $PGDATA/pg_log -> /Database/9.6/pg_log
> $PGDATA/pg_xlog -> /Database/9.6/pg_xlog
Yes, this will work. Note that restore does not recreate symlinks by
default so you'll need to specify --link-all to enable symlink creation.
See
https://pgbackrest.org/configuration.html#section-restore/option-link-all
for details.
Using symlinks in this way will make management of your clusters more
difficult, mostly because systems need more provisioning before restores
can be performed. In general I'd recommend against it unless there are
performance considerations.
Also, you might consider using log_directory to relocate log files
rather than a symlink. This will exclude log files from your backup
which is usually preferable -- primary logs restored to a standby are
out of context and can cause confusion.
Regards,
--
-David
david@pgmasters.net
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgbackrest when data/base is symlinked to another volume
@ 2018-09-08 02:15 Ron <ronljohnsonjr@gmail.com>
parent: David Steele <david@pgmasters.net>
1 sibling, 0 replies; 5+ messages in thread
From: Ron @ 2018-09-08 02:15 UTC (permalink / raw)
To: pgsql-general
On 09/07/2018 05:22 PM, David Steele wrote:
> Hi Ron,
>
> On 9/6/18 11:21 PM, Ron wrote:
>>
>> Will pgbackrest properly backup and restore the cluster if data/base,
>> data/pg_xlog and data/pg_log are symlinks?
>>
>> PGDATA=/var/lib/pgsql/9.6/data
>> $PGDATA/base -> /Database/9.6/base
>> $PGDATA/pg_log -> /Database/9.6/pg_log
>> $PGDATA/pg_xlog -> /Database/9.6/pg_xlog
>
> Yes, this will work. Note that restore does not recreate symlinks by
> default so you'll need to specify --link-all to enable symlink creation.
>
> See
> https://pgbackrest.org/configuration.html#section-restore/option-link-all
> for details.
>
> Using symlinks in this way will make management of your clusters more
> difficult, mostly because systems need more provisioning before restores
> can be performed. In general I'd recommend against it unless there are
> performance considerations.
>
> Also, you might consider using log_directory to relocate log files rather
> than a symlink. This will exclude log files from your backup which is
> usually preferable -- primary logs restored to a standby are out of
> context and can cause confusion.
Thanks for the tips. I'll probably implement that on our new systems.
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgbackrest when data/base is symlinked to another volume
@ 2018-09-08 03:47 Ron <ronljohnsonjr@gmail.com>
parent: David Steele <david@pgmasters.net>
1 sibling, 1 reply; 5+ messages in thread
From: Ron @ 2018-09-08 03:47 UTC (permalink / raw)
To: pgsql-general
On 09/07/2018 05:22 PM, David Steele wrote:
> Hi Ron,
>
> On 9/6/18 11:21 PM, Ron wrote:
>>
>> Will pgbackrest properly backup and restore the cluster if data/base,
>> data/pg_xlog and data/pg_log are symlinks?
>>
>> PGDATA=/var/lib/pgsql/9.6/data
>> $PGDATA/base -> /Database/9.6/base
>> $PGDATA/pg_log -> /Database/9.6/pg_log
>> $PGDATA/pg_xlog -> /Database/9.6/pg_xlog
>
> Yes, this will work. Note that restore does not recreate symlinks by
> default so you'll need to specify --link-all to enable symlink creation.
>
> See
> https://pgbackrest.org/configuration.html#section-restore/option-link-all
> for details.
>
> Using symlinks in this way will make management of your clusters more
> difficult, mostly because systems need more provisioning before restores
> can be performed. In general I'd recommend against it unless there are
> performance considerations.
Now that I'm thinking more about what you wrote... "data" isn't on it's own
partition. data/*base* has it's own partition.
What's the recommended method for putting *base**/* on a partition different
from data/? Or is that not recommended?
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: pgbackrest when data/base is symlinked to another volume
@ 2018-09-08 20:07 David Steele <david@pgmasters.net>
parent: Ron <ronljohnsonjr@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: David Steele @ 2018-09-08 20:07 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org; Ron <ronljohnsonjr@gmail.com>
On 9/7/18 8:47 PM, Ron wrote:
> On 09/07/2018 05:22 PM, David Steele wrote:
>>
>> On 9/6/18 11:21 PM, Ron wrote:
>>>
>>> Will pgbackrest properly backup and restore the cluster if data/base,
>>> data/pg_xlog and data/pg_log are symlinks?
>>>
>>> PGDATA=/var/lib/pgsql/9.6/data
>>> $PGDATA/base -> /Database/9.6/base
>>> $PGDATA/pg_log -> /Database/9.6/pg_log
>>> $PGDATA/pg_xlog -> /Database/9.6/pg_xlog
>>
>> Yes, this will work. Note that restore does not recreate symlinks by
>> default so you'll need to specify --link-all to enable symlink creation.
>>
>> See
>> https://pgbackrest.org/configuration.html#section-restore/option-link-all
>> for details.
>>
>> Using symlinks in this way will make management of your clusters more
>> difficult, mostly because systems need more provisioning before
>> restores can be performed. In general I'd recommend against it unless
>> there are performance considerations.
>
> Now that I'm thinking more about what you wrote... "data" isn't on it's
> own partition. data/*base* has it's own partition.
>
> What's the recommended method for putting *base**/* on a partition
> different from data/? Or is that not recommended?
All the user data goes in base so there's really no need to separate it
out of data. Typically pg_wal and tablespaces are relocated onto
different devices for performance (or to get more space). If the
partitions are on the same device then there's no performance benefit,
just admin hassle.
--
-David
david@pgmasters.net
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2018-09-08 20:07 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 06:21 pgbackrest when data/base is symlinked to another volume Ron <ronljohnsonjr@gmail.com>
2018-09-07 22:22 ` David Steele <david@pgmasters.net>
2018-09-08 02:15 ` Ron <ronljohnsonjr@gmail.com>
2018-09-08 03:47 ` Ron <ronljohnsonjr@gmail.com>
2018-09-08 20:07 ` David Steele <david@pgmasters.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox