[Pacemaker] Postgresql streaming replication failover - RA needed

Takatoshi MATSUO matsuo.tak at gmail.com
Thu Nov 17 07:03:37 UTC 2011


Hi  All

I create a RA for PosstgrSQL 9.1 Streaming Replication based on pgsql.

RA
  https://github.com/t-matsuo/resource-agents/blob/pgsql91/heartbeat/pgsql
Documents
  https://github.com/t-matsuo/resource-agents/wiki

It is almost totally changed from previous patch
http://lists.linux-ha.org/pipermail/linux-ha-dev/2011-February/018193.html
.
It create recovery.conf and promote PostgreSQL automatically.
Additionally it can switch between the synchronous and asynchronous
replication automatically.

If you please, use them and comment.

Regards,
Takatoshi MATSUO

2011/11/17 Serge Dubrouski <sergeyfd at gmail.com>:
>
>
> On Wed, Nov 16, 2011 at 12:55 PM, Attila Megyeri <amegyeri at minerva-soft.com>
> wrote:
>>
>> Hi Florian,
>>
>> -----Original Message-----
>> From: Florian Haas [mailto:florian at hastexo.com]
>> Sent: 2011. november 16. 11:49
>> To: The Pacemaker cluster resource manager
>> Subject: Re: [Pacemaker] Postgresql streaming replication failover - RA
>> needed
>>
>> Hi Attila,
>>
>> On 2011-11-16 10:27, Attila Megyeri wrote:
>> > Hi All,
>> >
>> >
>> >
>> > We have a two-node postgresql 9.1 system configured using streaming
>> > replicaiton(active/active with a read-only slave).
>> >
>> > We want to automate the failover process and I couldn't really find a
>> > resource agent that could do the job.
>>
>> That is correct; the pgsql resource agent (unlike its mysql counterpart)
>> does not support streaming replication. We've had a contributor submit a
>> patch at one point, but it was somewhat ill-conceived and thus did not make
>> it into the upstream repo. The relevant thread is here:
>>
>> http://lists.linux-ha.org/pipermail/linux-ha-dev/2011-February/018195.html
>>
>> Would you feel comfortable modifying the pgsql resource agent to support
>> replication? If so, we could revisit this issue and potentially add
>> streaming replication support to pgsql.
>>
>>
>> Well I'm not sure I would be able to do that change. Failover is
>> relatively easy to do but I really have no idea how to do the failback part.
>
> And that's exactly the reason why I haven't implemented it yet. With the
> current way how replication is done in PostgreSQL there is no easy way to
> switch between roles, or at least I don't know about a such way.
> Implementing just fail-over functionality by creating a trigger file on a
> slave server in the case of failure on master side doesn't create a full
> master-slave implementation in my opinion.
>
>>
>> I will definitively have to sort this out somehow, I am just unsure
>> whether I will try to use the repmgr mentioned in the video, or pacemaker
>> with some level of customization...
>>
>> Is the resource agent that you mentioned available somewhere?
>>
>> Thanks.
>> Attila
>>
>>
>>
>> _______________________________________________
>> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>>
>> Project Home: http://www.clusterlabs.org
>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>> Bugs:
>> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>
>
>
> --
> Serge Dubrouski.
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs:
> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>
>




More information about the Pacemaker mailing list