Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group