Re: initdb when data/ folder has mount points

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: initdb when data/ folder has mount points
Date: 2018-02-22 00:18:15
Message-ID: 7e242a07-5d25-b669-f69e-349dd8ce50b2@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/21/2018 06:01 PM, Tom Lane wrote:
> Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)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.
>
> 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.
>
> 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.
>
> 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.
>
> 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.

I'm replicating the structure in our existing systems.  Is there an (up to
date) Best Practices document for these kinds of issues?

--
Money Angular momentum makes the world go 'round.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-02-22 00:47:16 Re: initdb when data/ folder has mount points
Previous Message Tom Lane 2018-02-22 00:14:36 Re: Understanding query planner cpu usage