Re-Sync Stand By Server

From: Adam Cornett <adam(dot)cornett(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re-Sync Stand By Server
Date: 2012-03-07 18:28:28
Message-ID: CAB5sPxbNq25Ta4Hs3E8RLMRy=j7wGuwJ=Pb4-bRJC9bhHjKZZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have 2 identical machines, (Ubuntu 10.04 LTS running 9.1.2 from Martin
Pitt's PPA) setup with streaming asynchronous replication.
Recently I had to take the standby down for some extended maintenance, and
when it came back up it was waiting for a WAL segment that had since been
removed from the primary. I then shutdown the server, took a new base
backup of the primary and copied it over (as per the directions in the
streaming wiki) and cleared out the wal segments in the
pg_xlog directory of the standby and tried to start it again, but now its
not accepting connections and is looking for that wal file in the startup
process:

postgres 10090 10089 0 12:38 ? 00:00:00 postgres: startup process
waiting for 0000000100000052000000E9

However, segment 52000000E9 is no longer on the primary, which is about a
week ahead:

postgres(at)pg1:~$ psql -c "SELECT pg_current_xlog_location()"
pg_current_xlog_location
--------------------------
58/8E1B8D98

So, how do I get the standby to catch up to "catch up" to the primary?

-Adam Cornett

Browse pgsql-sql by date

  From Date Subject
Next Message Carlos Mennens 2012-03-07 18:42:16 Type Ahead Issue
Previous Message rverghese 2012-03-06 21:00:32 map row in one table with random row in another table