Re: PostgreSQL Replication with read-only access to standby DB

From: "Jonathan Bond-Caron" <jbondc(at)gmail(dot)com>
To: "'Keaton Adams'" <kadams(at)mxlogic(dot)com>, "'Richard Broersma'" <richard(dot)broersma(at)gmail(dot)com>, "'salman'" <salmanb(at)quietcaresystems(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL Replication with read-only access to standby DB
Date: 2008-03-26 03:19:42
Message-ID: 021901c88ef0$3cb3f120$b61bd360$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

I'm in the same boat, looking for master-slave replication for 1 master & 2
'standby' read-only servers (one would get promoted to master in case of
failure).

I recently read about WAL here:
http://developer.postgresql.org/pgdocs/postgres/warm-standby.html

The standby server is not available for access, since it is continually
performing recovery processing.

PostgreSQL does not provide the system software required to identify a
failure on the primary and notify the standby system and then the standby
database server. Many such tools exist and are well integrated with other
aspects required for successful failover, such as IP address migration.

In short there's not much automation magic at the moment and doesn't seem
like what you're looking for.
Pgpool-II might be the best alternative.

I know very little about postgreSQL internals but it would be great if:
- WAL files could be applied while the standby server is operational / allow
read-only queries
- Allow master server to send WAL files to standby servers / * WAL traffic
to be streamed to another server
- Allow master server to send list of all known standby servers
- Allow standby server to check if master server is alive and promote itself
as master (would need to ask / make sure other standby servers do not try
promote themselves at the same time)

Then in my ways, you can use a pool to query the read-only standby servers.

As I was writing this out, I thought this would make a great SOC project,
but then found it already exists!
http://code.google.com/soc/2007/postgres/appinfo.html?csaid=6545828A8197EBC6

Great news, I'd be happy to pitch in any time to help design a solution like
this :)

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Keaton Adams
Sent: March 25, 2008 4:29 PM
To: Richard Broersma; salman
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] PostgreSQL Replication with read-only access to
standby DB

But will that stand-by replication provide for a read-only slave?

On 3/25/08 2:26 PM, "Richard Broersma" <richard(dot)broersma(at)gmail(dot)com> wrote:

> On Tue, Mar 25, 2008 at 1:17 PM, salman <salmanb(at)quietcaresystems(dot)com>
wrote:
>> IIRC, it was mentioned previously in one posting that this a TODO for a
>> future version of postgres but not something that's expected soon.
>>
>> Someone please correct me if I'm wrong.
>
> This is what I saw on the TODO list:
> Write-Ahead Log
> * Allow WAL traffic to be streamed to another server for stand-by
> replication
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shane Ambler 2008-03-26 03:25:57 Re: Make MS Access "UPDATE" PostGre SQL Table
Previous Message Shane Ambler 2008-03-26 03:00:29 Re: How to "use" database?

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2008-03-26 04:40:32 Re: Script binaries renaming
Previous Message Bruce Momjian 2008-03-26 02:51:53 Re: Script binaries renaming