[pgpool-general: 5872] failover command

chris chrisk at pgsqlrocket.com
Fri Jan 19 06:02:32 JST 2018


I have a pgpool running on server3, master on server1 and hotstandby on 
server2. Pgpool is set up reach out to both server1 and 2. pgpool starts 
fine and seems to be doing its job, but if the master dies, pgpool breaks.

I am using a failover command in pgpool.conf that runs:

backend0 :


'/home/postgres/pool_heartbeat/bin/failover.sh %H %R'

the script failover.sh runs:

NEW_PRIMARY=$1          # %H
PGDATA=$2               # %R

echo "NEW_PRIMARY [$NEW_PRIMARY] [$1]" > /home/postgres/failover.log
echo "PGDATA [$PGDATA] [$2]" >> /home/postgres/failover.log
echo "ssh -T postgres@${NEW_PRIMARY} /usr/pgsql-9.6/bin/pg_ctl -D 
$PGDATA promote" >> /home/postgres/failover.log
ssh -T postgres@${NEW_PRIMARY} /usr/pgsql-9.6/bin/pg_ctl -D $PGDATA promote

the log shows it putting out:

PGDATA [/var/lib/pgsql/9.6/data] [/var/lib/pgsql/9.6/data]
ssh -T postgres at /usr/pgsql-9.5/bin/pg_ctl -D 
/var/lib/pgsql/9.6/data promote

I don't understand why it is being passed the master IP as well as it 
somehow changes my /usr/pgsql-9.6/bin/pg_ctl to 
/usr/pgsql-9.5/bin/pg_ctl. Any thoughts to why it doesn't this on failover?



More information about the pgpool-general mailing list