pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Steele <david@pgmasters.net>
To: Ron Johnson <ron.l.johnson@cox.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: initdb when data/ folder has mount points
Date: Wed, 21 Feb 2018 19:56:38 -0500
Message-ID: <cf80b0f7-b845-ce9c-b2d6-63ebbb979455@pgmasters.net> (raw)
In-Reply-To: <2762.1519257684@sss.pgh.pa.us>
References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net>
	<2762.1519257684@sss.pgh.pa.us>

On 2/21/18 7:01 PM, Tom Lane wrote:
> Ron Johnson <ron.l.johnson@cox.net> writes:
>> Apparently, initdb assumes that data/ is one big mount point. However, we
>> have four mount points:
>> /var/lib/pgsql/9.6/data/backup
>> /var/lib/pgsql/9.6/data/base
>> /var/lib/pgsql/9.6/data/pg_log
>> /var/lib/pgsql/9.6/data/pg_xlog
> 
> Don't do that.

Agreed.

> There's no reason for backup storage to be under the data directory (and
> lots of good reasons for it not to be).  Just put it somewhere else.

Yes -- in this configuration your backups would be backed up with every 
backup.  It's pretty obvious where that would go.

> The supported way to put pg_xlog on a separate volume is to put that
> mount point somewhere else, and make $PGDATA/pg_xlog be a symlink to
> it.  IIRC, there's an initdb option to help with that, though you can
> also make it so manually after initdb.

initdb supports linking pg_xlog/pg_wal with the --xlogdir/--waldir option.

> For pg_log, just put it somewhere else and set the appropriate
> configuration option to say where to write the postmaster log files.
> Or you could use a symlink, like the solution for pg_xlog, but
> I don't see any advantage there.

Symlinking pg_log is not ideal because the logs end up in the backup. 
It gets pretty weird when those logs get restored to a standby and 
somebody starts reading them.

> I don't see any point in making base/ be its own mount point.  Once
> you get rid of those other subdirectories there's not going to be
> enough "global" storage left to justify its own volume.

Agreed.

-- 
-David
david@pgmasters.net




view thread (9+ messages)  latest in thread

Message-ID: <cf80b0f7-b845-ce9c-b2d6-63ebbb979455@pgmasters.net>
Permalink:  ../cf80b0f7-b845-ce9c-b2d6-63ebbb979455@pgmasters.net/
Also on:    postgresql.org/message-id/cf80b0f7-b845-ce9c-b2d6-63ebbb979455@pgmasters.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: david@pgmasters.net, ron.l.johnson@cox.net, tgl@sss.pgh.pa.us
  Subject: Re: initdb when data/ folder has mount points
  In-Reply-To: <cf80b0f7-b845-ce9c-b2d6-63ebbb979455@pgmasters.net>
  References: <3eb5e598-e31d-83dd-e3f3-b1ca8c03117d@cox.net> <2762.1519257684@sss.pgh.pa.us> <cf80b0f7-b845-ce9c-b2d6-63ebbb979455@pgmasters.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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