Re: Syncing DBs prior to RServ replication

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Syncing DBs prior to RServ replication
Дата
Msg-id 20030620163217.GC6746@libertyrms.info
обсуждение исходный текст
Ответ на Syncing DBs prior to RServ replication  (Michael A Nachbaur <mike@nachbaur.com>)
Список 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 по дате отправления:

Предыдущее
От: "Mel Jamero"
Дата:
Сообщение: Re: pgsql function doesn't work
Следующее
От: Michael A Nachbaur
Дата:
Сообщение: Re: Syncing DBs prior to RServ replication