No subject


Fri Jan 30 20:15:43 JST 2015


show pool_nodes;

o/p:

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)


Please help me in Fixing this Issue.Provide me the working failover
script if any.


Thanks for your time.




Thanks & Regards,
G V Gurunadh.

--047d7b874e5e78bf02050ff7bc6b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br clear=3D"all"><div><div class=3D"gmail_signature"><div=
 dir=3D"ltr">Dear All,</div><div dir=3D"ltr"><br></div><div dir=3D"ltr"><br=
></div><div dir=3D"ltr">I have setup the load balancing and failover for Av=
ailability in pgpool. I have used the Master-slave replication(stream mode)=
 for replication.</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">The foll=
owing is my failover_command =3D&#39;<span style=3D"color:rgb(0,0,0);white-=
space:pre-wrap">/usr/local/etc/failover.sh %d %P %H %R</span>&#39;</div><di=
v dir=3D"ltr"><br></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">Followi=
ng is the failover script.</div><div dir=3D"ltr"><br></div><div dir=3D"ltr"=
><pre style=3D"white-space:pre-wrap;word-wrap:break-word"><font color=3D"#0=
00000">#!/bin/bash -x
FALLING_NODE=3D$1         # %d
OLDPRIMARY_NODE=3D$2      # %P
NEW_PRIMARY=3D$3          # %H
PGDATA=3D$4               # %R

if [ $FALLING_NODE =3D $OLDPRIMARY_NODE ]; then
    if [ $UID -eq 0 ]
    then
        su postgres -c &quot;ssh -T enterprisedb@$NEW_PRIMARY touch $PGDATA=
/trigger&quot;
    else
        ssh -T enterprisedb@$NEW_PRIMARY touch $PGDATA/trigger
    fi
    exit 0;
fi;
exit 0;<br></font></pre><pre style=3D"white-space:pre-wrap;word-wrap:break-=
word"><br></pre><pre style=3D"white-space:pre-wrap;word-wrap:break-word">To=
 check the  failover scenario i have stopped the master database server.Acc=
ording to the script the present salve will take over the role of master. B=
ut the same was not happening in my case.</pre><pre style=3D"white-space:pr=
e-wrap;word-wrap:break-word">From pgpool end</pre><pre style=3D"white-space=
:pre-wrap;word-wrap:break-word">show pool_nodes;</pre><pre style=3D"white-s=
pace:pre-wrap;word-wrap:break-word">o/p:</pre><pre style=3D"word-wrap:break=
-word"><span style=3D"white-space:pre-wrap">edb=3D# 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=3D"word-wrap:break-word"><br></pre><pre sty=
le=3D"word-wrap:break-word">Please help me in Fixing this Issue.Provide me =
the working failover script if any.</pre><pre style=3D"word-wrap:break-word=
"><br></pre><pre style=3D"word-wrap:break-word">Thanks for your time.</pre>=
<pre style=3D"white-space:pre-wrap;word-wrap:break-word"><br></pre><br><br>=
Thanks &amp; Regards,<br>G V Gurunadh.</div></div></div>
<img width=3D"1" height=3D"1" src=3D"http://s.bl-1.com/hGZv9pt.gif"></div>

--047d7b874e5e78bf02050ff7bc6b--


More information about the pgpool-general mailing list