Re: Master-slave failover question

From: "gurunadh(dot)venkata(at)gmail(dot)com" <gurunadh(dot)venkata(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Master-slave failover question
Date: 2015-03-11 09:23:48
Message-ID: 1426065828314-5841392.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi all,

I have setup the load balancing and failover for High Availability in
pgpool. I
have used the Master-slave replication(stream mode).

DB version PPAS 9.4AS(EnterpriseDB)

pgpool version 3.3.4

The following is my failover command in pgpool.conf

failover_command ='/usr/local/etc/failover.sh %d %P %H
%R'

Following is the failover script.

#!/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 enterprisedb -c "ssh -T enterprisedb(at)$NEW_PRIMARY touch
$PGDATA/trigger"
else
ssh -T enterprisedb(at)$NEW_PRIMARY touch $PGDATA/trigger
fi
exit 0;
fi;
exit 0;

To check the failover scenario i have stopped(kill -9) the master db
server process.According to the script the present salve will take over the
role of master. But the same was not happening in my case.

From pgpool end

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 failover script which is
working correctly.

Thanks for your time.

--
View this message in context: http://postgresql.nabble.com/Master-slave-failover-question-tp5785199p5841392.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Gurunadh Venkata 2015-03-11 09:30:34 Reg Failover Script in Pgpool
Previous Message Hans Ginzel 2015-03-11 09:00:41 psql -L log errors