pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <andrew@libertyrms.info>
To: pgsql-admin@postgresql.org
Subject: Re: Syncing DBs prior to RServ replication
Date: Fri, 20 Jun 2003 12:32:17 -0400
Message-ID: <20030620163217.GC6746@libertyrms.info> (raw)
In-Reply-To: <200306091524.32045.mike@nachbaur.com>
References: <200306091524.32045.mike@nachbaur.com>

On Mon, Jun 09, 2003 at 03:24:32PM -0700, Michael A Nachbaur wrote:
> I'm looking at syncronizing two database servers with RServ (production / "hot 
> standby"), and I'm trying to figure out a way to get the initial database on 
> the slave server syncronized with the master.
> 
> Normally, I would 1) turn off all clients, 2) dump the database from the 
> master, 3) restore it into the slave, 4) turn clients back on, and 5) 
> replicate regularly.
> 
> Unfortunately I'm running the master in a production environment where 
> anything more than 5 minutes of downtime is a really "Bad Thing?".  The 
> database dump is about 5G, and so leaving the master down for that entire 
> time isn't possible.  Is there a recommended way for performing such a "sync" 
> without any lengthy downtime?

This works-ish for eRServer, and should work for rserv too:

1.  Set up replication on the master && pg_dump [master] | psql [slave]
2.  Drop master bits on new slave and install slave bits
3.  Start replicating.

Note that at (3) there is the risk of running into tuples on the
slave which are already there.  Depending on your load, you may need
manually to remove those tuples in order to get the replication to
complete.  (Solving that problem is one of the things the eRServer
version does, thanks to a patch from one of our developers some time
ago.)

> I'm guessing I could start my dump, and then immediately afterward create the 
> replication tables in the master.  Since the dump is transactional (is it?), 

You might miss something this way.

A

-- 
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110




view thread (5+ messages)  latest in thread

Message-ID: <20030620163217.GC6746@libertyrms.info>
Permalink:  ../20030620163217.GC6746@libertyrms.info/
Also on:    postgresql.org/message-id/20030620163217.GC6746@libertyrms.info

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: andrew@libertyrms.info
  Subject: Re: Syncing DBs prior to RServ replication
  In-Reply-To: <20030620163217.GC6746@libertyrms.info>
  References: <200306091524.32045.mike@nachbaur.com> <20030620163217.GC6746@libertyrms.info>

* 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