Re: Turning slave into a master - PostgreSQL 9.2
От | David G. Johnston |
---|---|
Тема | Re: Turning slave into a master - PostgreSQL 9.2 |
Дата | |
Msg-id | CAKFQuwbRd8nzG=AYBDj073v7XRFMj0-N5cAinPgsaB9kJ2tAoQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Turning slave into a master - PostgreSQL 9.2 (Patrick B <patrickbakerbr@gmail.com>) |
Ответы |
Re: Turning slave into a master - PostgreSQL 9.2
|
Список | pgsql-general |
Hi guys,I got a test server, let's call it test01.The test01 has a basebackup from the master.I want to turn test01 into a master. It doesn't need to catch up with the wal_files, because I don't need it to be up-to-date.So what I did is:- Replaced /var/lib/pgsql/9.2/data/ with the basebackup- Created recovery.conf:- touch /tmp/pg_failover_triggerrestore_command = 'cp /var/lib/pgsql/wal_archive/%f %p'recovery_target_timeline = 'latest'standby_mode = offtrigger_file = '/tmp/pg_failover_trigger'- service postgresql startAnd then postgres starts recovering the wal_files. But I don't want that.. as I don't need a up-to-dateIs the wal_files required anyway?
"...has a basebackup from the master" - the answer to your question depends greatly on the detail behind that sentence.
IIRC, unless you know that the data directory is consistent - because the database was offline at the time of the backup - at least some WAL will probably be required to bring the inconsistent backup data directory to a known good state (i.e., post-checkpoint).
David J.
В списке pgsql-general по дате отправления: