Re: wal copies for high availability - Mailing list pgsql-general

From Heinrich Streit
Subject Re: wal copies for high availability
Date
Msg-id 20060208195154.73622.qmail@web37809.mail.mud.yahoo.com
Whole thread Raw
In response to Re: wal copies for high availability  (Philippe Ferreira <phil.f@worldonline.fr>)
List pgsql-general
Slony is a good choice... but the ERP owner will charge us a lot to include primary keys or unique not null columns all over the system.
 
Philippe Ferreira <phil.f@worldonline.fr> escreveu:
Hi,

> Another cheap alternative is diarly (00:00) stop the master database
> and make a copy of the $PGDATA directory to the slave and during the
> day make regularly (5 x 5 minutes) copies of the current wal file to
> the slave too.
>
> To recover the system we need only to apply all the logs created
> during the day to the slave and sta rt it up.
>
> Will it work?

It will work, but :
You must *not* stop any database or service diarly (00:00), but instead
activate
the "hot backup mode" to be able to copy your $PGDATA directory "on the
fly" tothe slave. If you do this way, you will get a recoverable copy of your
server.
To activate the slave, you will only have to start it in "recovery
mode", and all your
WAL files of the day will be replayed in a second !

> Is there any risk to make it in this way?

If you take care of your WAL files, everything should be ok !

>
> What will happen if during the wal copy operation the database writes
> something in too?

This is a good question ! I don't know the exact consequences...
Maybe the best solution is to put your pg_xlog directory on a "snapshot
capable" file system,
and send a snapshot of the current WAL every 5 minutes...

> Will the wal file copied usefull in those situations?

Of course, yes !
The filled WAL files (WAL archives) are automatically copied by the
postmaster process,
but you need to copy yourself the current one to be able to recover the
last stuff !

> ; What other alternatives do we have?

Slony ?

Philippe Ferreira.


Yahoo! Search
Dê uma espiadinha e saiba tudo sobre o Big Brother Brasil.

pgsql-general by date:

Previous
From: Philippe Ferreira
Date:
Subject: Re: wal copies for high availability
Next
From: Rick Gigger
Date:
Subject: Re: wal copies for high availability