[pgpool-general: 5287] retrieve IP of OLDPRIMARY node ID

Dylan Luong Dylan.Luong at unisa.edu.au
Wed Feb 1 11:24:18 JST 2017


Hi

I am trying to follow the concept from https://www.itenlight.com/blog/2016/05/21/PostgreSQL+HA+with+pgpool-II+-+Part+5
To stop the old-primary postgres after promoting the slave.

In the his scripts, he SSH to the "demote_node" passed in from the initial failover.sh script but this is a nodeID so the ssh command fails.

Ie:
# Disabling postgresql on demote host (if specified):
if [ "$demote_host" != "" ]; then

    echo "INFO: Trying to disable postgresql at ${demote_host}..."
    ssh -T postgres@$demote_host /etc/postgresql/9.5/main/replscripts/disable_postgresql.sh -t $trigger_file -s $standby_file && success=true

    if ! $success ; then
        echo "WARNING: Failed to execute 'disable_postgresql.sh' at demoted host."
    fi

fi

>From the pgpool.conf, the special values for the failover_command does not include the hostname/IP of the oldprimary.

Is there a way to retrieve the IP of the oldprimary from within the failover.sh with the oldprimary node ID?

Regards
Dylan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20170201/04b3c1e8/attachment.html>


More information about the pgpool-general mailing list