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

Muhammad Usama m.usama at gmail.com
Thu Feb 2 22:52:15 JST 2017


On Wed, Feb 1, 2017 at 7:24 AM, Dylan Luong <Dylan.Luong at unisa.edu.au>
wrote:

> 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?
>


You can use *%h* to pass the hostname/IP of the failed/detached node to the
failover script.

See the list of all the values that can be passed to failover_command.
http://www.pgpool.net/docs/pgpool-II-3.6.1/doc/en/html/runtime-config-failover.html

Thanks
Best regards
Muhammad Usama
>
>
>
> Regards
>
> Dylan
>
>
>
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20170202/19e76209/attachment.html>


More information about the pgpool-general mailing list