<div dir="ltr"><div class="gmail_extra">Hello,<br><br></div><div class="gmail_extra">Sorry for late reply on this issue, I&#39;ve been busy with other tasks.<br><br></div><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 16, 2015 at 7:05 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
&gt; Is there a way I<br>
&gt; could overcome this issue? I thought I could update the pgpool status file<br>
&gt; in /var/log/pgpool in my scripts once a failover occurs. Would that be the<br>
&gt; way to go or there are better ways to fix this?<br>
<br>
The situation above heavily relies on how you wrote pgpool_failover.sh<br>
and pgpool_failback.sh. Also you&#39;d better present how you start<br>
pgpool. The point here is, you use -D or not.<br>
<br></blockquote><div><br>I start pgpool using the /etc/init.d/pgpool-II script:<br><br>PGPOOL2_BIN=/usr/sbin/pgpool<br>test -x $PGPOOL2_BIN || { echo &quot;$PGPOOL2_BIN not installed&quot;;<br>        if [ &quot;$1&quot; = &quot;stop&quot; ]; then exit 0;<br>        else exit 5; fi; }<br><br># Check for existence of needed config file and read it<br>PGPOOL2_CONFIG=/etc/sysconfig/pgpool-II<br>test -r $PGPOOL2_CONFIG || { echo &quot;$PGPOOL2_CONFIG not existing&quot;;<br>        if [ &quot;$1&quot; = &quot;stop&quot; ]; then exit 0;<br>        else exit 6; fi; }<br><br># Read config<br>. $PGPOOL2_CONFIG<br>PGPOOL2_CONFFILE=&quot;/etc/pgpool-II/pgpool.conf&quot;<br>PGPOOL2_PID=&quot;/var/run/pgpool/pgpool.pid&quot;<br><br>...<br><br>    start)<br>        echo -n &quot;Starting pgpool &quot;<br>        ## Start daemon with startproc(8). If this fails<br>        ## the return value is set appropriately by startproc.<br>        /sbin/startproc -u pgpool -g pgpool $PGPOOL2_BIN<br><br>        # Remember status and be verbose<br>        rc_status -v<br>        sleep 1<br><br><br>and this is my failover script:<br><br>#!/bin/sh<br><br>crt_date=`date`<br>echo &quot;$crt_date : old master id=$1 new master id=$2 new master host=$3&quot; &gt;&gt; ${log_file}<br><br>old_master_id=$1<br>new_master_id=$2<br>new_master_host=$3<br><br>if [ ${old_master_id} -ne ${new_master_id} ]<br>then<br>        ssh root@${new_master_host} &quot;/cbnDBscripts/DBCluster/dbcluster_promote_as_primary.sh&quot; &gt; /cbnDBscripts/log/pgpool_failover_${new_master_host}.log<br>else<br>        ssh root@${new_master_host} &quot;/cbnDBscripts/DBCluster/dbcluster_standby_failed.sh&quot; &gt; /cbnDBscripts/log/pgpool_failover_slave_${new_master_host}.log<br>fi<br><br></div><div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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>
</blockquote></div><br><br></div><div class="gmail_extra">Thanks a lot for your help,<br></div><div class="gmail_extra">Ioana<br></div></div>