Search Postgresql Archives

Initing a new replica

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've got a few questions about initing a new replica. We have a
modestly large DB cluster with a master and two replicas running with
streaming replication. We tend to switch which one is the master
fairly often, shuffling hardware, upgrading kernels, etc.  However,
every time we fail over, we have to re-init the old master as a new
replica from scratch using pg_basebackup. pg_basebackup's
documentation mentions copying the basebackup from one replica to
another, but doesn't really go into details. So I'm wondering if any
of the following would be valid ways to get the old master acting as a
replica against the new master more quickly:

 * Assuming the old master stops prior to the new master exiting
recovery, and there is no timeline divergence, simply copying the
.history file from pg_xlogs, creating a recovery.conf, and starting
postgres (this is similar to how we change the non-participating
replica to stream from the new master instead of the old master - copy
the .history file, alter recover.conf, and restart postgres)
 * Instead of using pg_basebackup, manually call pg_start_backup and
pg_stop_backup against the new master, and rsync the data over, since
presumably little has changed since a timeline divergence
 * Instead of using pg_basebackup, manually call pg_start_backup and
pg_stop_backup (against the new master? or the non-participating
slave? not necessary?), and rsync or raw copy the data over from the
non-participating slave, reducing load on the new master.

Thanks for any help,

Cody Cutrer

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux