Re: Syncing DBs prior to RServ replication - Mailing list pgsql-admin

From Andrew Sullivan
Subject Re: Syncing DBs prior to RServ replication
Date
Msg-id 20030620163217.GC6746@libertyrms.info
Whole thread Raw
In response to Syncing DBs prior to RServ replication  (Michael A Nachbaur <mike@nachbaur.com>)
List pgsql-admin
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


pgsql-admin by date:

Previous
From: "Mel Jamero"
Date:
Subject: Re: pgsql function doesn't work
Next
From: Michael A Nachbaur
Date:
Subject: Re: Syncing DBs prior to RServ replication