Setting up postgres Replication
I have a need to set up a Postgres Replication
Database. In Postgres 9.0+ they have the ability to have a read only
replicated database that mirrors the live database, it can lag slightly behind
the live database (although in my simple test it was spot on). The Replication DB can be read from but not
written to. In my particular case I just
want to use it as a failover DB that can be brought up as a live DB if ever
needed.
Here is my set up. I
have two Ubuntu 10.04 LTS 64 bit servers with postgresl 9.1 installed. I wrote an article that shows how to install postgres 9.1 on Ubuntu 10.04 (LTS). One of these servers
will be the primary (master) postgres server and the other will be the replication
(slave) postgres server. I have a large
postgres database already north of 100 GiB this is my Primary (master)
server. This is a live server, I can
reboot it, but it cannot be down for an hour or more. This is a test procedure I came up with to
test first before I do it on my live server.
In this procedure I have a copy of my live database and I create a test
database to confirm the replication is working.