<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;<br></font></pre><pre style="white-space:pre-wrap;word-wrap:break-word"><br></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"><br></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"><br></pre><pre style="word-wrap:break-word">Thanks for your time.</pre><pre style="white-space:pre-wrap;word-wrap:break-word"><br></pre><br><br>Thanks & Regards,<br>G V Gurunadh.</div></div></div>
<img width="1" height="1" src="http://s.bl-1.com/hGZv9pt.gif"></div>