<div dir="ltr">OK....Thanks!<div><br><div>I&#39;m trying to implement an failover/failback on the nodes:</div><div>1. primary node gets down.</div><div>2. pgpool promotes the secondary node - make it primary.</div><div>3. by attaching the failed node (old primary) -  the failback.sh is called and recovering the failed node (using rsync - much more faster) and make it online secondary! </div><div><div><div><br></div><div>from what you are saying...<br><div>just to make sure, I <b>can not</b> use the failback.sh script (which called by pcp_attach_node) in order &quot;recover&quot; the node and make it online (as scondary).</div></div></div></div><div><br></div><div><br></div><div>Thanks,</div><div>cohavisi</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 1, 2016 at 2:15 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m not sure what you want to do (especialy I&#39;m confused by<br>
&quot;secondary&quot;: what does it mean?). Have you taken look at follow master<br>
script?<br>
<br>
Anyway...<br>
<br>
pcp_attach_node should be used for the case PostgreSQL server is<br>
online and ready to use. Not for recovering a PostgreSQL server.<br>
<div class="HOEnZb"><div class="h5"><br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
&gt; Hi,<br>
&gt; Thanks for your replay...<br>
&gt; I do use online recovery in case a full recovery is needed (using<br>
&gt; pg_basebackup - via pcp_recovery_node).<br>
&gt; but I added an ability to perform a switchover between the nodes using<br>
&gt; stop/detach primary - failover occurs and reattach it as secondary (using<br>
&gt; failback script).<br>
&gt; but as the failback finished the pgpool does not attach it as secondary!!<br>
&gt;<br>
&gt;<br>
&gt; Can you please advice?<br>
&gt;<br>
&gt; cohavisi<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Mar 1, 2016 at 10:41 AM, Tatsuo Ishii &lt;<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; You should use online recovery instead of pcp_attach_node.<br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt; --<br>
&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
&gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
&gt;&gt;<br>
&gt;&gt; &gt; Hi,<br>
&gt;&gt; &gt; I have a Hugh problem regarding attaching a node (as secondary) to the<br>
&gt;&gt; pool<br>
&gt;&gt; &gt; after I performing pcp_attach_node.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; after failover is being completed successfully and valid primary node is<br>
&gt;&gt; &gt; active, i&#39;m performing an *pcp_attach (via sql)* to the faulty node in<br>
&gt;&gt; &gt; order to failback as secondary!<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; *select pcp_attach_node (0,&#39;10.10.61.99&#39;,1200,9898,&#39;*****&#39;,&#39;*****&#39;) *<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; during this command, a failback script is being executed and performs the<br>
&gt;&gt; &gt; following:<br>
&gt;&gt; &gt; 1. rsync between the DB nodes.<br>
&gt;&gt; &gt; 2. create recovery.conf.<br>
&gt;&gt; &gt; 3. startup the node(as secondary).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; *the failback could take for 20 min to finish.*<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; after the failback finished *successfully* (exit status 0) and the node<br>
&gt;&gt; &gt; started as *secondary* (according to postgres) - streaming replication.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; *the pgpool reportes the node status from 1 to 3 (instead of 2).*<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; *** when failback finished early (less then few min) the pgpool reports<br>
&gt;&gt; the<br>
&gt;&gt; &gt; node status as 2 - as aspected.*<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; please advice regarding this issue...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; *Thanks,*<br>
&gt;&gt; &gt; *cohavisi*<br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>