<div dir="ltr">Hello folks,<div>  I have the following setup in mind, but I need some advice and one hint on how to realize a particular function.</div><div><br></div><div>I have a N (&gt;= 2) nodes cluster, with data storage on postgresql.</div>
<div>I would like to manage postgres master-slave replication in this way: one node is the &quot;master&quot;, one is the &quot;slave&quot;, and the others are &quot;standby&quot; nodes.</div><div>If the master fails, the slave becomes the master, and one of the standby becomes the slave.</div>
<div>If the slave fails, one of the standby becomes the new slave.</div><div>If one of the &quot;standby&quot; fails, no problem :)</div><div>I can correctly manage this configuration with ms and a custom script (using </div>
<div>ocf:pacemaker:Stateful as example). If the cluster is already operational, the failover works fine.</div><div><br></div><div>My problem is about cluster start-up: in fact, only the previous running master and slave own the most updated data; so I would like that the new master should be the &quot;old master&quot; (or, even, the old slave), and the new slave should be the &quot;old slave&quot; (but this one is not mandatory). The important thing is that the new master should have up-to-date data.</div>
<div>This should happen even if the servers are booted up with some minutes of delay between them. (users are very stupid sometimes).</div><div><div><br></div><div>My idea is the following:</div><div>the MS resource is not started when the cluster comes up, but on startup there will only be one &quot;arbitrator&quot; resource (started on only one node). This resource reads from somewhere which was the previous master and the previous slave, and it wait up to 5 minutes to see if one of them comes up. In positive case, it forces the MS master resource to be run on that node (and start it); in negative case, if the wait timer expired, it start the master resource on a random node.</div>
<div><br></div><div>Is that possible? How can avoid a single resource to start on cluster boot?</div><div>Or, could you advise another way to do this setup?</div><div><br></div><div>I hope I was clear, my english is not so good :)<br>
</div><div>thank you so much,</div><div>   stefano</div><div><br></div>-- <br>Stefano Sasso<br><a href="http://stefano.dscnet.org/">http://stefano.dscnet.org/</a>
</div></div>