<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">There's a lot to look at.  For
      starters, make sure your recovery.conf has $PGDATA/trigger as the
      trigger file and not some other path.  Also check the pgpool.log
      to see if pgpool even tried to elect a new master.<br>
      <br>
      The best thing you can do after that is to su to the user pgpool
      runs as on your pgpool node and run "sh -x <span
        style="color:rgb(0,0,0);white-space:pre-wrap">/usr/local/etc/failover.sh
        . . . " with the arguments you expect pgpool would have run and
        see what it does. It could be something as simple as having to
        accept an ssh host key (for which I suggest adding "-o
        StrictHostKeyChecking=no" to your script's ssh command so you
        don't have that problem).<br>
        <br>
        <br>
        alex<br>
      </span><br>
      <br>
      On 2/25/15 22:19, Gurunadh Venkata wrote:<br>
    </div>
    <blockquote
cite="mid:CAJAdScZ=Ly3d_PbZRSoWRGGY6eMsSNPUNC+NJ_ez_XKEGpMxYg@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br clear="all">
        <div>
          <div class="gmail_signature">
            <div dir="ltr">Dear All,</div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr">I have setup the load balancing and failover
              for Availability in pgpool. I have used the Master-slave
              replication(stream mode) for replication.</div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr">The following is my failover_command ='<span
                style="color:rgb(0,0,0);white-space:pre-wrap">/usr/local/etc/failover.sh
                %d %P %H %R</span>'</div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr">Following is the failover script.</div>
            <div dir="ltr"><br>
            </div>
            <div dir="ltr">
              <pre style="white-space:pre-wrap;word-wrap:break-word"><font color="#000000">#!/bin/bash -x
FALLING_NODE=$1         # %d
OLDPRIMARY_NODE=$2      # %P
NEW_PRIMARY=$3          # %H
PGDATA=$4               # %R

if [ $FALLING_NODE = $OLDPRIMARY_NODE ]; then
    if [ $UID -eq 0 ]
    then
        su postgres -c "ssh -T enterprisedb@$NEW_PRIMARY touch $PGDATA/trigger"
    else
        ssh -T enterprisedb@$NEW_PRIMARY touch $PGDATA/trigger
    fi
    exit 0;
fi;
exit 0;
</font></pre>
              <pre style="white-space:pre-wrap;word-wrap:break-word">
</pre>
              <pre style="white-space:pre-wrap;word-wrap:break-word">To check the  failover scenario i have stopped the master database server.According to the script the present salve will take over the role of master. But the same was not happening in my case.</pre>
              <pre style="white-space:pre-wrap;word-wrap:break-word">From pgpool end</pre>
              <pre style="white-space:pre-wrap;word-wrap:break-word">show pool_nodes;</pre>
              <pre style="white-space:pre-wrap;word-wrap:break-word">o/p:</pre>
              <pre style="word-wrap:break-word"><span style="white-space:pre-wrap">edb=# show pool_nodes;
 node_id |  hostname  | port | status | lb_weight |  role
---------+------------+------+--------+-----------+---------
 0       | 10.0.0.149 | 5444 | 3      | 0.500000  | standby
 1       | 10.0.0.158 | 5444 | 2      | 0.500000  | standby
(2 rows)</span></pre>
              <pre style="word-wrap:break-word">
</pre>
              <pre style="word-wrap:break-word">Please help me in Fixing this Issue.Provide me the working failover script if any.</pre>
              <pre style="word-wrap:break-word">
</pre>
              <pre style="word-wrap:break-word">Thanks for your time.</pre>
              <pre style="white-space:pre-wrap;word-wrap:break-word">
</pre>
              <br>
              <br>
              Thanks &amp; Regards,<br>
              G V Gurunadh.</div>
          </div>
        </div>
        <img moz-do-not-send="true" src="http://s.bl-1.com/hGZv9pt.gif"
          height="1" width="1"></div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
pgpool-general mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a>
<a class="moz-txt-link-freetext" href="http://www.pgpool.net/mailman/listinfo/pgpool-general">http://www.pgpool.net/mailman/listinfo/pgpool-general</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>