Re: Syncing DBs prior to RServ replication

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Syncing DBs prior to RServ replication
Date: 2003-06-20 16:32:17
Message-ID: 20030620163217.GC6746@libertyrms.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)libertyrms(dot)info> M2P 2A8
+1 416 646 3304 x110

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Michael A Nachbaur 2003-06-20 18:07:47 Re: Syncing DBs prior to RServ replication
Previous Message Mel Jamero 2003-06-20 16:12:10 Re: pgsql function doesn't work