From: Dimitri Gritsenko <dev789@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Wal standbies switchover
Date: Thu, 2 Aug 2007 12:26:47 +0400
Message-ID: <79eb93740708020126i5ac550bdw7a42cec1930793e7@mail.gmail.com> (raw)
Goal - having 1 master and 2 standbies - make switchover in the way , that
except minimal downtime - there was always 1 running master and 2 warm
standbies.
Lets say i have 3 hosts (1,2,3) , 1 master and 2 warm standbies . ( M1 SB2
SB3)
Each SB gets (Master rsyncs from his side to SB) archived wal files from
master and recovers in continues way untill triggered to start as master.,
also it gets incomplete wals from pg_xlog dir .
Switchover looks for me like this.
1. M1 stops , all sync crons stopped.
2. Do last rsync of archived wals and pg_xlog to SB2 , SB3
3. SB2 triggered to start , it recovers last incomplete wals from pg_xlog
and starts (becomes M2), and starts cron rsync to SB3
4. SB3 does nothing , it continues get recover wal archives which now it
gets from M2. (Question - is it ok ? It looks like new archived wal files
from M2 should be valid without any changes)
5. What happens on host 1 (former master) is a question. It needs to become
a SB1 . Do i need to make large rsync of whole db from M2 (like during SB
install) or i can just keep old data and start db in recovery mode , getting
new wal files?
There is a difference between SB2 and new SB1. SB2 had data_dir -
corresponding to last recovered ARCHIVED file , and SB1 - to last INCOMPLETE
WAL files , so its not the same.
So , 2 questions on points 4 and 5.
Any comments?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: dev789@gmail.com
Subject: Re: Wal standbies switchover
In-Reply-To: <79eb93740708020126i5ac550bdw7a42cec1930793e7@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox