<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
I'm guessing that you are referring to this RA <a href="https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/pgsql">https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/pgsql</a> with additions by T. Matsuo.
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>If I have misinterpreted the use case of this resource, please let me know. Also any additional hints or corrects would be much appreciated.</div>
<div><br>
</div>
<div>v/r</div>
<div><br>
</div>
<div>STEVE</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div><br>
</div>
<div>On Mar 25, 2013, at 7:01 PM, Andreas Kurz <<a href="mailto:andreas@hastexo.com">andreas@hastexo.com</a>> wrote:
<div><br class="Apple-interchange-newline">
<blockquote type="cite">Hi Steve,<br>
<br>
On 2013-03-25 18:44, Steven Bambling wrote:<br>
<blockquote type="cite">All,<br>
<br>
I'm trying to work on a OCF resource agent that uses postgresql<br>
streaming replication. I'm running into a few issues that I hope might<br>
be answered or at least some pointers given to steer me in the right<br>
direction.<br>
</blockquote>
<br>
Why are you not using the existing pgsql RA? It is capable of doing<br>
synchronous and asynchronous replication and it is known to work fine.<br>
<br>
Best regards,<br>
Andreas<br>
<br>
-- <br>
Need help with Pacemaker?<br>
<a href="http://www.hastexo.com/now">http://www.hastexo.com/now</a><br>
<br>
<br>
<blockquote type="cite"><br>
1. A quick way of obtaining a list of "Online" nodes in the cluster<br>
that a resource will be able to migrate to. I've accomplished it with<br>
some grep and see but its not pretty or fast.<br>
<br>
# time pcs status | grep Online | sed -e "s/.*\[\(.*\)\]/\1/" | sed 's/ //'<br>
p1.example.net <http://p1.example.net> p2.example.net<br>
<http://p2.example.net><br>
<br>
real0m2.797s<br>
user0m0.084s<br>
sys0m0.024s<br>
<br>
Once I get a list of active/online nodes in the cluster my thinking was<br>
to use PSQL to get the current xlog location and lag or each of the<br>
remaining nodes and compare them. If the node has a greater log<br>
position and/or less lag it will be given a greater master preference. <br>
<br>
2. How to force a monitor/probe before a promote is run on ALL nodes to<br>
make sure that the master preference is up to date before<br>
migrating/failing over the resource.<br>
- I was thinking that maybe during the promote call it could get the log<br>
location and lag from each of the nodes via an psql call ( like above)<br>
and then force the resource to a specific node. Is there a way to do<br>
this and does it sound like a sane idea ?<br>
<br>
<br>
The start of my RA is located here suggestions and comments 100%<br>
welcome https://github.com/smbambling/pgsqlsr/blob/master/pgsqlsr<br>
<br>
v/r<br>
<br>
STEVE<br>
<br>
<br>
_______________________________________________<br>
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org<br>
http://oss.clusterlabs.org/mailman/listinfo/pacemaker<br>
<br>
Project Home: http://www.clusterlabs.org<br>
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf<br>
Bugs: http://bugs.clusterlabs.org<br>
<br>
</blockquote>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org<br>
http://oss.clusterlabs.org/mailman/listinfo/pacemaker<br>
<br>
Project Home: http://www.clusterlabs.org<br>
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf<br>
Bugs: http://bugs.clusterlabs.org<br>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>