Search Postgresql Archives

Re: wal copies for high availability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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" to the 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux