[pgpool-general: 3487] Reg Failover script in Pgpool

Gurunadh Venkata gurunadh.venkata at gmail.com
Thu Feb 26 15:19:36 JST 2015


Dear All,


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

The following is my 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 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;


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.


More information about the pgpool-general mailing list