Re: Highly academic: local etcd & Patroni Cluster for testing on asingle host
От | Ian Barwick |
---|---|
Тема | Re: Highly academic: local etcd & Patroni Cluster for testing on asingle host |
Дата | |
Msg-id | 363f4a79-d0f6-e43f-3555-4bd18913e332@2ndquadrant.com обсуждение исходный текст |
Ответ на | Re: Highly academic: local etcd & Patroni Cluster for testing on asingle host (Paul Förster <paul.foerster@gmail.com>) |
Ответы |
Re: Highly academic: local etcd & Patroni Cluster for testing on asingle host
|
Список | pgsql-general |
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 configurationfile and an empty PGDATA. It then will copy the whole master's PGDATA as is, launch the replica database clusterand 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 someconfiguration changes and launch it again. You can of course only make changes to things which don't get replicated allover again or are managed by Patroni itself. This is, how I set up individual archive destinations for each replicationmember because the initial archive destination of course is replicated, and thus identical, when Patroni buildsthe replica database cluster. > > Tablespace mapping just creates the links to the directories in ${PGDATA}/pg_tblspc to a different location. And sincepg_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
В списке pgsql-general по дате отправления: