pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Dave Johansen <davejohansen@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Setting up streaming replication with new server as master?
Date: Fri, 5 Feb 2016 16:09:28 -0500
Message-ID: <20160205210928.GB3331@tamriel.snowman.net> (raw)
In-Reply-To: <CAAcYxUe7zkKz6DSeqW88mPv4BasJnWwO2APnbU8=S20sSyTDMw@mail.gmail.com>
References: <CAAcYxUdTYWFdUOhiNzBv290YmeYgAv4iqh4gyiyBW3XgcCmjSw@mail.gmail.com>
	<20160205202729.GZ3331@tamriel.snowman.net>
	<CAAcYxUcPNa_c_dQd_-2Ez6HmntLkqOmNohag_EbKVDgV372SzA@mail.gmail.com>
	<20160205205456.GA3331@tamriel.snowman.net>
	<CAAcYxUe7zkKz6DSeqW88mPv4BasJnWwO2APnbU8=S20sSyTDMw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

* Dave Johansen (davejohansen@gmail.com) wrote:
> On Fri, Feb 5, 2016 at 1:54 PM, Stephen Frost <sfrost@snowman.net> wrote:
> > * Dave Johansen (davejohansen@gmail.com) wrote:
> > > So will pg_basebackup keep copying the new data that is added over the
> > > weekend until I tell it to stop? If so, then on Monday, can I close
> > things
> > > down, wait for the WAL to finish, swap the roles of the 2 server and then
> > > restart?
> >
> > No, pg_basebackup will take a snapshot of the current system,
> > essentially.  You can set up the new system to connect to the current
> > system, using recovery.conf, to pull the WAL records and apply them to
> > the new server.
> >
> 
> So do I set that up before running pg_basebackup?
> 
> Or in other words, pg_basebackup will get all of the existing data and then
> the setup using recovery.conf will get the new data?

Right.  Note that to use pg_basebackup or to have a replica connect to
the existing system, you need to have archive_mode set to archive or
higher (and you should at least do hot_standby, really), and have
max_wal_senders set higher than 0 (I tend to set it to about 3, just
because it uses little in the way of resources, etc).  If you have a
high transaction rate, you might also want to set wal_keep_segments up a
bit.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (19+ messages)  latest in thread

Message-ID: <20160205210928.GB3331@tamriel.snowman.net>
Permalink:  ../20160205210928.GB3331@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20160205210928.GB3331@tamriel.snowman.net

 · 

reply

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: sfrost@snowman.net, davejohansen@gmail.com
  Subject: Re: Setting up streaming replication with new server as master?
  In-Reply-To: <20160205210928.GB3331@tamriel.snowman.net>

* 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