Highly academic: local etcd & Patroni Cluster for testing on a singlehost - Mailing list pgsql-general

From Paul Förster
Subject Highly academic: local etcd & Patroni Cluster for testing on a singlehost
Date
Msg-id 51854B87-A964-4F64-8EC4-8ABF51A0716E@gmail.com
Whole thread Raw
Responses Re: Highly academic: local etcd & Patroni Cluster for testing on asingle host  (Ian Barwick <ian.barwick@2ndquadrant.com>)
List pgsql-general
Hi,

I have set up an etcd & Patroni cluster on a single machine for testing purposes as follows:

/data/pg01a/db as data directory for the first "node"
/data/pg01b/db as data directory for the second "node"

I have set up Patroni to make each PostgreSQL database cluster archive to its own destination, so they won't interfere
witheach other. All is well and working fine so far. Failover/Switchover works, they are syncing properly, etc. 

Now:

Inside /data/pg01a and /data/pg01b I also have a directory ts, i.e. /data/pg01a/ts and /data/pg01b/ts to simulate
differentfilesystems. 

If I do a 'create tablespace' and specify its location, I must of course specify either /data/pg01a/ts or
/data/pg01b/ts.

Files with Tables get created as usual, but since it's a replication (sync, by the way), the other tablespace directory
willnot hold any files, but instead, the replica uses the same files as does the master. 

Is there any way around that, i.e. make the replica use its own files? I found a way to make each archive destination
individualdespite Patroni, but I can't seem to find a way to do something similar to the tablespaces. Even correcting
thesymlinks in ${PGDATA}/pg_tblspc manually (and then restart) does not work. 

The explanation is simple: the location is stored inside the database cluster information and is per definition the
sameacross all nodes. So, if 'a' is master and I do "create tablespace test location '/data/pg01a/ts'" it creates files
therewith the replica 'b' using the *same* destination. 

Still, is there a way to make each node store that information individually? I know, this is highly academic but I only
havea single host to do etcd & Patroni cluster experiments on. 

Cheers,
Paul


pgsql-general by date:

Previous
From: Miles Elam
Date:
Subject: Re: a proposal for a new functionality: "SELECT * [EXCEPT col1 [,col2]]
Next
From: Adrian Klaver
Date:
Subject: Re: LDAP with TLS is taking more time in Postgresql 11.5