I'm guessing that you are referring to this RA https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/pgsql with additions by T. Matsuo.
>From reading the "wiki" ( hopefully I have misinterpreted this :) ) on his >Github page it looks like this RA was written to work in a Active/Passive >senario that is really suited for 2 nodes. We are hoping to be able to have >N+1 nodes, so that if the master fails the secondary node will still have >synchronous partners to replicate with ensuring the data is written in >multiple locations. If I have misinterpreted the use case of this resource, please let me know. Also any additional hints or corrects would be much appreciated. v/r STEVE On Mar 25, 2013, at 7:01 PM, Andreas Kurz <andr...@hastexo.com<mailto:andr...@hastexo.com>> wrote: Hi Steve, On 2013-03-25 18:44, Steven Bambling wrote: All, I'm trying to work on a OCF resource agent that uses postgresql streaming replication. I'm running into a few issues that I hope might be answered or at least some pointers given to steer me in the right direction. Why are you not using the existing pgsql RA? It is capable of doing synchronous and asynchronous replication and it is known to work fine. Best regards, Andreas -- Need help with Pacemaker? http://www.hastexo.com/now 1. A quick way of obtaining a list of "Online" nodes in the cluster that a resource will be able to migrate to. I've accomplished it with some grep and see but its not pretty or fast. # time pcs status | grep Online | sed -e "s/.*\[\(.*\)\]/\1/" | sed 's/ //' p1.example.net <http://p1.example.net> p2.example.net <http://p2.example.net> real0m2.797s user0m0.084s sys0m0.024s Once I get a list of active/online nodes in the cluster my thinking was to use PSQL to get the current xlog location and lag or each of the remaining nodes and compare them. If the node has a greater log position and/or less lag it will be given a greater master preference. 2. How to force a monitor/probe before a promote is run on ALL nodes to make sure that the master preference is up to date before migrating/failing over the resource. - I was thinking that maybe during the promote call it could get the log location and lag from each of the nodes via an psql call ( like above) and then force the resource to a specific node. Is there a way to do this and does it sound like a sane idea ? The start of my RA is located here suggestions and comments 100% welcome https://github.com/smbambling/pgsqlsr/blob/master/pgsqlsr v/r STEVE _______________________________________________ Pacemaker mailing list: Pacemaker@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://bugs.clusterlabs.org _______________________________________________ Pacemaker mailing list: Pacemaker@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://bugs.clusterlabs.org
_______________________________________________ Pacemaker mailing list: Pacemaker@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://bugs.clusterlabs.org