Re: pgbackrest when data/base is symlinked to another volume

From: David Steele <david(at)pgmasters(dot)net>
To: Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pgbackrest when data/base is symlinked to another volume
Date: 2018-09-07 22:22:43
Message-ID: 3db7c0dc-b5e8-fab6-3521-bc60e2c1375b@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2018-09-07 22:32:47 Re: unaccent(text) fails depending on search_path (WAS: pg_upgrade fails saying function unaccent(text) doesn't exist)
Previous Message Andrew Staller 2018-09-07 19:08:18 Re: A Timeseries Case Study: InfluxDB VS PostgreSQL