<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br>
<div>
<div>On Mar 28, 2013, at 8:13 AM, Rainer Brestan <<a href="mailto:rainer.brestan@gmx.net">rainer.brestan@gmx.net</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>Hi Steve,</div>
<div>i think, you have misunderstood how ip addresses are used with this setup, PGVIP should start after promotion.</div>
<div>Take a look at Takatoshi´s Wiki.</div>
<div><a href="https://github.com/t-matsuo/resource-agents/wiki/Resource-Agent-for-PostgreSQL-9.1-streaming-replication">https://github.com/t-matsuo/resource-agents/wiki/Resource-Agent-for-PostgreSQL-9.1-streaming-replication</a></div>
</div>
</div>
</blockquote>
<div><br>
</div>
<span class="Apple-tab-span" style="white-space:pre"></span>I see that he has the master/replication VIPs with a resource order to force promotion before moving the VIPs to the new master. </div>
<div><br>
</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>I don't get how the postgres service is going to listen on those interfaces if they have not already migrated to the new master.  Even with setting the listen_addresses = "*"</div>
<div><br>
<blockquote type="cite">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div> </div>
<div>The promotion sequency is very simple.</div>
<div>When no master is existing, all slaves write their current replay xlog into the node attribute PGSQL-xlog-loc during monitor call.</div>
</div>
</div>
</blockquote>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Does this also hold true if a Master fails?  </div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>From the looks of it, if there was a Master before the failure that the master score is set from the function that grabs the data_status from the master (STREAMING|SYNC, STREAMING|ASYNC, STREAMING|POTENTIAL,
 etc ).  </div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>The reason I ask is if the master fails and the slaves don't then compare their xlog location, there is a potential for data loss if the incorrect slave is promoted.</div>
<div><br>
</div>
<br>
<blockquote type="cite">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>You can see all them with crm_mon -A1f.</div>
<div>Each slave gets these attributes from all node configured in parameter node_list (hopefully your node names in Pacemaker are the same as in node_list) and compares them to get the highest.</div>
<div>
<div>If the highest is this list is the own one, it sets the master-score to 1000, on other nodes to 100.</div>
<div>Pacemaker then selects the node with the highest master score and promote this.</div>
<div> </div>
<div>Rainer</div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Mittwoch, 27. März 2013 um 14:37 Uhr<br>
<b>Von:</b> "Steven Bambling" <<a href="mailto:smbambling@arin.net">smbambling@arin.net</a>><br>
<b>An:</b> "The Pacemaker cluster resource manager" <<a href="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</a>><br>
<b>Betreff:</b> Re: [Pacemaker] PGSQL resource promotion issue</div>
<div name="quoted-content">
<div>In talking with andreask from IRC, I  miss understood the need to include the op monitor.  I figured it was pulled from the resource script by default.
<div> </div>
<div>I used pcs to add the new attributes and one was then promoted to master </div>
<div> </div>
<div>pcs resource add_operation PGSQL monitor interval=5s role=Master</div>
<div>pcs resource add_operation PGSQL monitor interval=7s</div>
<div> </div>
<div>v/r</div>
<div> </div>
<div>STEVE</div>
<div> </div>
<div>On Mar 27, 2013, at 7:08 AM, Steven Bambling <<a href="x-msg://124/smbambling@arin.net" target="_parent">smbambling@arin.net</a>> wrote:</div>
<div>
<div> 
<blockquote>
<div>
<div> </div>
I've built and installed the lastest resource-agents from github on Centos 6 and configured two resources 
<div>
<div> </div>
<div>1 primitive PGVIP:</div>
<div>pcs resource create PGVIP ocf:heartbeat:IPaddr2 ip=10.1.22.48 cidr_netmask=25 op monitor interval=1</div>
<div> </div>
<div>Before setting up the PGSQL resource I manually configured sync/streaming replication on the three nodes with
<a href="http://p1.example.com/" target="_blank">p1.example.com</a> as the master and verified that replication was working.  I think removed the synchronous_standby_name from my postgresql.conf and stop all postgres services on all nodes</div>
<div> </div>
<div>1 master/slave PGSQL: -- I've the resource to use sync replication.  Also I am using PGSQL 9.2.3</div>
<div> </div>
<div>pcs resource create PGSQL ocf:heartbeat:pgsql params pgctl="/usr/pgsql-9.2/bin/pg_ctl" pgdata="/var/lib/pgsql/9.2/data" config="/var/lib/pgsql/9.2/data/postgresql.conf" stop_escalate="5"<b> rep_mode="sync"
</b>node_list="<a href="http://p1.example.com/" target="_blank">p1.example.com</a> p2.<a href="http://example.com/" target="_blank">example.com</a> p3.<a href="http://example.com/" target="_blank">example.com</a>" restore_command='cp /var/lib/pgsql/9.2/archive/%f
 "%p"' master_ip="10.1.22.48" repuser="postgres" restart_on_promote="true" tmpdir="/var/lib/pgsql/9.2/tmpdir" xlog_check_count="3" crm_attr_timeout="5" check_wal_receiver="true" --master</div>
<div> </div>
<div>I'm able to successfully get all the nodes in the cluster started and the PGVIP resource starts on the 1st node and the PGSQL:[012] resource start on each node in the cluster.  The one thing I don't understand is why none of the slaves is taking over the
 master role.</div>
</div>
<div> </div>
<div>Also how would I go about force promoting one of the slaves into the master role via the PCS command line utility. </div>
<div> </div>
<div>v/r</div>
<div> </div>
<div>STEVE</div>
</div>
_______________________________________________<br>
Pacemaker mailing list: <a href="x-msg://124/Pacemaker@oss.clusterlabs.org" target="_parent">
Pacemaker@oss.clusterlabs.org</a><br>
<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf">
http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://bugs.clusterlabs.org">http://bugs.clusterlabs.org</a></blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><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>
</body>
</html>