Converting Restored Standalone Instance to Cluster
When you restore a Linux-based PostgreSQL instance that belongs to a Patroni high-availability cluster, Veeam Explorer for PostgreSQL restores it as a standalone instance. The restore operation removes the existing patroni.dynamic.json file from the instance and other existing cluster metadata in the PostgreSQL directory.
To convert the restored standalone instance to a cluster, do the following:
- Stop the Patroni service.
- Update the Patroni configuration file of the instance (for example, /etc/patroni/patroni.yml). Configure the global settings, DCS backend, bootstrap settings and so on. For more information, see the Patroni documentation.
- Set ownership and permissions on the PostgreSQL data directory:
sudo chown -R postgres:postgres /var/lib/postgresql/<version>/main |
where <version> is the major version of PostgreSQL.
- Remove stale state files:
sudo -u postgres rm -f /var/lib/postgresql/<version>/main/postmaster.pid |
- Start the Patroni service. For the restored data to be preserved, the instance must become the cluster leader — otherwise, the instance joins as a replica and is re-cloned from the current leader.