pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <ian.barwick@2ndquadrant.com>
To: Paul Förster <paul.foerster@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Highly academic: local etcd & Patroni Cluster for testing on a single host
Date: Wed, 26 Feb 2020 17:27:22 +0900
Message-ID: <363f4a79-d0f6-e43f-3555-4bd18913e332@2ndquadrant.com> (raw)
In-Reply-To: <4F8DF27C-E82A-4CBC-B06E-AD4FCD3E66FF@gmail.com>
References: <51854B87-A964-4F64-8EC4-8ABF51A0716E@gmail.com>
	<ef8c9642-6ef5-0b1d-9c75-19088ec10ad9@2ndquadrant.com>
	<4F8DF27C-E82A-4CBC-B06E-AD4FCD3E66FF@gmail.com>

On 2020/02/26 16:55, Paul Förster wrote:
> Hi Ian,
> 
>> On 26. Feb, 2020, at 01:38, Ian Barwick <ian.barwick@2ndquadrant.com> wrote:
>>
>> Assuming the standby/replica is created using pg_basebackup, you can use the
>> -T/--tablespace-mapping option to remap the tablespace directories.
> 
> no, with Patroni, replicas are always initiated by Patroni. Patroni copies the whole PGDATA including everything (postgresql.conf, etc.) in it to the replica site. When launching Patroni for the first time, all you need is its yaml configuration file and an empty PGDATA. It then will copy the whole master's PGDATA as is, launch the replica database cluster and start replication.
> 
> Even if Patroni uses pg_basebackup internally (which I assume it does), there is no way to pass parameters to it.
> 
> Then you can stop the Patroni process on the replica site which in turn takes the replica database cluster down, make some configuration changes and launch it again. You can of course only make changes to things which don't get replicated all over again or are managed by Patroni itself. This is, how I set up individual archive destinations for each replication member because the initial archive destination of course is replicated, and thus identical, when Patroni builds the replica database cluster.
> 
> Tablespace mapping just creates the links to the directories in ${PGDATA}/pg_tblspc to a different location. And since pg_basebackup isn't used, there is no way to do that. But I can do that by hand. That is not the problem.
> 
> The problem is that PostgreSQL keeps the tablespace location inside the database and not in some config file. 

It doesn't - it takes the tablespace location directly from the symlink in the "pg_tblspc"
directory (since PostgreSQL 9.2), so you can manipulate those manually, provided the server
isn't running of course.

Not sure how that would fit in with the Patroni side of things.


Regards


Ian Barwick


-- 
Ian Barwick                   https://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services





view thread (7+ messages)  latest in thread

Message-ID: <363f4a79-d0f6-e43f-3555-4bd18913e332@2ndquadrant.com>
Permalink:  ../363f4a79-d0f6-e43f-3555-4bd18913e332@2ndquadrant.com/
Also on:    postgresql.org/message-id/363f4a79-d0f6-e43f-3555-4bd18913e332@2ndquadrant.com

 · 

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: ian.barwick@2ndquadrant.com, paul.foerster@gmail.com
  Subject: Re: Highly academic: local etcd & Patroni Cluster for testing on a single host
  In-Reply-To: <363f4a79-d0f6-e43f-3555-4bd18913e332@2ndquadrant.com>
  References: <51854B87-A964-4F64-8EC4-8ABF51A0716E@gmail.com> <ef8c9642-6ef5-0b1d-9c75-19088ec10ad9@2ndquadrant.com> <4F8DF27C-E82A-4CBC-B06E-AD4FCD3E66FF@gmail.com> <363f4a79-d0f6-e43f-3555-4bd18913e332@2ndquadrant.com>

* 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