<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<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&acute;s Wiki.</div>

<div>https://github.com/t-matsuo/resource-agents/wiki/Resource-Agent-for-PostgreSQL-9.1-streaming-replication</div>

<div>&nbsp;</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>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>&nbsp;</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>&nbsp;Mittwoch, 27. M&auml;rz 2013 um 14:37 Uhr<br/>
<b>Von:</b>&nbsp;&quot;Steven Bambling&quot; &lt;smbambling@arin.net&gt;<br/>
<b>An:</b>&nbsp;&quot;The Pacemaker cluster resource manager&quot; &lt;pacemaker@oss.clusterlabs.org&gt;<br/>
<b>Betreff:</b>&nbsp;Re: [Pacemaker] PGSQL resource promotion issue</div>

<div name="quoted-content">
<div>In talking with andreask from IRC, I &nbsp;miss understood the need to include the op monitor. &nbsp;I figured it was pulled from the resource script by default.
<div>&nbsp;</div>

<div>I used pcs to add the new attributes and one was then promoted to master&nbsp;</div>

<div>&nbsp;</div>

<div>pcs resource add_operation PGSQL monitor interval=5s role=Master</div>

<div>pcs resource add_operation PGSQL monitor interval=7s</div>

<div>&nbsp;</div>

<div>v/r</div>

<div>&nbsp;</div>

<div>STEVE</div>

<div>&nbsp;</div>

<div>On Mar 27, 2013, at 7:08 AM, Steven Bambling &lt;<a href="smbambling@arin.net" target="_parent">smbambling@arin.net</a>&gt; wrote:</div>

<div>
<div>&nbsp;
<blockquote>
<div>
<div>&nbsp;</div>
I&#39;ve built and installed the lastest resource-agents from github on Centos 6 and configured two resources&nbsp;

<div>
<div>&nbsp;</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>&nbsp;</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. &nbsp;I think removed the synchronous_standby_name from my postgresql.conf and stop all postgres services on all nodes</div>

<div>&nbsp;</div>

<div>1 master/slave PGSQL: -- I&#39;ve the resource to use sync replication. &nbsp;Also I am using PGSQL 9.2.3</div>

<div>&nbsp;</div>

<div>pcs resource create PGSQL ocf:heartbeat:pgsql params pgctl=&quot;/usr/pgsql-9.2/bin/pg_ctl&quot; pgdata=&quot;/var/lib/pgsql/9.2/data&quot; config=&quot;/var/lib/pgsql/9.2/data/postgresql.conf&quot; stop_escalate=&quot;5&quot;<b> rep_mode=&quot;sync&quot; </b>node_list=&quot;<a href="http://p1.example.com/" target="_blank">p1.example.com</a> p2.<a href="http://example.com/" target="_blank">example.com</a>&nbsp;p3.<a href="http://example.com/" target="_blank">example.com</a>&quot; restore_command=&#39;cp /var/lib/pgsql/9.2/archive/%f &quot;%p&quot;&#39; master_ip=&quot;10.1.22.48&quot; repuser=&quot;postgres&quot; restart_on_promote=&quot;true&quot; tmpdir=&quot;/var/lib/pgsql/9.2/tmpdir&quot; xlog_check_count=&quot;3&quot; crm_attr_timeout=&quot;5&quot; check_wal_receiver=&quot;true&quot; --master</div>

<div>&nbsp;</div>

<div>I&#39;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. &nbsp;The one thing I don&#39;t understand is why none of the slaves is taking over the master role.</div>
</div>

<div>&nbsp;</div>

<div>Also how would I go about force promoting one of the slaves into the master role via the PCS command line utility.&nbsp;</div>

<div>&nbsp;</div>

<div>v/r</div>

<div>&nbsp;</div>

<div>STEVE</div>
</div>
_______________________________________________<br/>
Pacemaker mailing list: <a href="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: http://www.clusterlabs.org<br/>
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf<br/>
Bugs: http://bugs.clusterlabs.org</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>