0

Hi we are using PostgreSQL 16 on Ubuntu 22 LTS and have built a cluster using initdb. I'm wondering if it's possible to rebuild a standby using pg_createcluster instead to take advantage of various admin tools and join it to the cluster so that we can eventually failover (we use repmgr), and then remove the old nodes and rebuild them using pg_createcluster as well.

As I understand it pg_createcluster is essentially a wrapper around initdb. Unfortunately being in production, simply rebuilding the entire cluster is a no-go, so our choice is to either live with it having been built using initdb, or add/remove nodes until the entire cluster is rebuilt with pg_createcluster.

Di Si
  • 3
  • 2

1 Answers1

0

pg_createcluster is a script around initdb. initdb creates a new database cluster, but that is not what you need for streaming replication: you need a copy of the primary cluster. So you need pg_basebackup or some other file system backup technique to create the standby as copy of the primary.

Laurenz Albe
  • 61,070
  • 4
  • 55
  • 90