<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 1, 2017 at 7:24 AM, Dylan Luong <span dir="ltr">&lt;<a href="mailto:Dylan.Luong@unisa.edu.au" target="_blank">Dylan.Luong@unisa.edu.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div class="gmail-m_2016662411734012024WordSection1">
<p class="MsoNormal">Hi<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am trying to follow the concept from <a href="https://www.itenlight.com/blog/2016/05/21/PostgreSQL+HA+with+pgpool-II+-+Part+5" target="_blank">
https://www.itenlight.com/<wbr>blog/2016/05/21/PostgreSQL+HA+<wbr>with+pgpool-II+-+Part+5</a><u></u><u></u></p>
<p class="MsoNormal">To stop the old-primary <span id="gmail-c40428e3-f1cd-49e2-ab18-f9bbf0234818" class="gmail-GINGER_SOFTWARE_mark">postgres</span> after promoting the slave.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In the his scripts, he SSH to the “demote_node” passed in from the initial failover<span id="gmail-031f8d34-c09c-4cd0-914d-5a52ceddf6e3" class="gmail-GINGER_SOFTWARE_mark">.</span>sh <span id="ee70714c-08ab-4144-afbb-7510424b140f" class="gmail-GINGER_SOFTWARE_mark GINGER_SOFTWARE_mark">script but</span> this is a <span id="gmail-67a1f0d5-e6f7-42f1-ae21-629d2eaee428" class="gmail-GINGER_SOFTWARE_mark">nodeID</span> so the ssh command fails.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span id="gmail-40e42010-0a66-48ae-a370-6b1c6e58f7d6" class="gmail-GINGER_SOFTWARE_mark">Ie</span>:<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51);border:1pt none windowtext;padding:0cm"># Disabling <span id="gmail-3c3ac02b-a5aa-40c2-a031-d3cc60ad3178" class="gmail-GINGER_SOFTWARE_mark">postgresql</span> on demote host (if specified):</span><span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51);border:1pt none windowtext;padding:0cm"><span id="gmail-4d53febf-990d-4ad2-b8fb-e36fb5fc7a0e" class="gmail-GINGER_SOFTWARE_mark">if</span></span><span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"> <span style="border:1pt none windowtext;padding:0cm"><span id="gmail-12e50de2-271a-4bfc-862d-af1c88a038a2" class="gmail-GINGER_SOFTWARE_mark">[ </span>&quot;$demote_host&quot;</span><span style="border:1pt none windowtext;padding:0cm">!</span> <span style="border:1pt none windowtext;padding:0cm">= &quot;&quot;</span><span style="border:1pt none windowtext;padding:0cm">]</span><span style="border:1pt none windowtext;padding:0cm">;</span> <span style="border:1pt none windowtext;padding:0cm"> <wbr>then</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"> <u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51);border:1pt none windowtext;padding:0cm">    <span id="gmail-62dc07bc-8e35-4a0f-8732-8ae7881622d2" class="gmail-GINGER_SOFTWARE_mark">echo</span></span><span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"> <span style="border:1pt none windowtext;padding:0cm">&quot;INFO: Trying
 to disable <span id="gmail-310196d1-8d06-4f01-b0e4-15d28529669b" class="gmail-GINGER_SOFTWARE_mark">postgresql</span> at $<span id="e58288ce-5fe8-4a87-ae07-c26ce1f7399b" class="gmail-GINGER_SOFTWARE_mark GINGER_SOFTWARE_mark">{</span>demote_host}...&quot;</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51);border:1pt none windowtext;padding:0cm">    ssh</span><span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"> <span style="border:1pt none windowtext;padding:0cm">-T postgres@$demote_host /etc/<wbr>postgresql/9.5/main/<wbr>replscripts/disable_<wbr>postgresql.sh
 -t $trigger_file -s $standby_file &amp;&amp; success=true</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"> <u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51);border:1pt none windowtext;padding:0cm">    <span id="gmail-b9c3f736-86b1-4d91-a410-b4e057f9c8da" class="gmail-GINGER_SOFTWARE_mark">if</span></span><span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"><span style="border:1pt none windowtext;padding:0cm">!</span> <span style="border:1pt none windowtext;padding:0cm"> $success<span id="gmail-c1bef414-3e8c-47ad-95f3-76ff30aa5871" class="gmail-GINGER_SOFTWARE_mark"> ;</span> then</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51);border:1pt none windowtext;padding:0cm">        <span id="ed7e08dd-f423-4878-ad49-be425e4227a9" class="gmail-GINGER_SOFTWARE_mark GINGER_SOFTWARE_mark">echo</span></span><span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"> <span style="border:1pt none windowtext;padding:0cm">&quot;WARNING:
 Failed to execute &#39;disable_postgresql<span id="gmail-1821d470-8950-446f-9e60-76e43675062f" class="gmail-GINGER_SOFTWARE_mark">.</span>sh&#39; at demoted host.&quot;</span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51);border:1pt none windowtext;padding:0cm">    <span id="gmail-c085f1d8-dc98-4b4f-bf3a-d2cae9be95d1" class="gmail-GINGER_SOFTWARE_mark">fi</span></span><span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51);border:1pt none windowtext;padding:0cm">    </span><span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"> <u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:36pt;line-height:15pt;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51);border:1pt none windowtext;padding:0cm"><span id="gmail-7620c247-8f7e-4697-a303-23acbf07d66c" class="gmail-GINGER_SOFTWARE_mark">fi</span></span><span style="font-size:10.5pt;font-family:consolas;color:rgb(51,51,51)"><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">From the <span id="gmail-43f7e3b5-acb8-487c-8501-62e03bc805ae" class="gmail-GINGER_SOFTWARE_mark">pgpool</span><span id="gmail-dae07f06-0d14-4a9f-9f54-a7a96d748f90" class="gmail-GINGER_SOFTWARE_mark">.</span><span id="gmail-cb97fb5e-70bc-43e2-97e5-901a64a3ed5a" class="gmail-GINGER_SOFTWARE_mark">conf</span>, the special values for the failover_command does not include the hostname/IP of the <span id="e4fe50c4-9f1f-4e07-80cd-bb7a66693dc5" class="gmail-GINGER_SOFTWARE_mark GINGER_SOFTWARE_mark">oldprimary</span>.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Is there a way to retrieve the IP of the <span id="gmail-04694d75-8aa8-4696-8b82-6f520c4edaab" class="gmail-GINGER_SOFTWARE_mark">oldprimary</span> from within the failover<span id="gmail-224bc368-51ee-45ed-92a7-77061efb4ab6" class="gmail-GINGER_SOFTWARE_mark">.</span>sh with the <span id="gmail-8367df86-c235-4d87-a1d1-20d540d97dc5" class="gmail-GINGER_SOFTWARE_mark">oldprimary</span> node ID?</p></div></div></blockquote><div><br></div><div class="gmail_quote"><br></div>You can use <b>%h</b> to pass the hostname/IP of the failed/detached node to the failover script.</div><div class="gmail_quote"><br>See the list of all the values that can be passed to failover_command. <a href="http://www.pgpool.net/docs/pgpool-II-3.6.1/doc/en/html/runtime-config-failover.html">http://www.pgpool.net/docs/pgpool-II-3.6.1/doc/en/html/runtime-config-failover.html</a><br><br>Thanks<br>Best regards<br>Muhammad Usama<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_2016662411734012024WordSection1"><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regards<span class="gmail-HOEnZb"><font color="#888888"><u></u><u></u></font></span></p><span class="gmail-HOEnZb"><font color="#888888">
<p class="MsoNormal">Dylan<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</font></span></div>
</div>

<br>______________________________<wbr>_________________<br>
<span id="gmail-8e32f9d2-657b-4442-a68b-34297964aea6" class="gmail-GINGER_SOFTWARE_mark">pgpool</span>-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-general</a><br>
<br></blockquote></div><br></div></div>