[pgpool-general: 3490] Re: Reg Failover script in Pgpool
Alex Toth
atoth at gravity.com
Fri Feb 27 07:38:09 JST 2015
There's a lot to look at. For starters, make sure your recovery.conf
has $PGDATA/trigger as the trigger file and not some other path. Also
check the pgpool.log to see if pgpool even tried to elect a new master.
The best thing you can do after that is to su to the user pgpool runs as
on your pgpool node and run "sh -x /usr/local/etc/failover.sh . . . "
with the arguments you expect pgpool would have run and see what it
does. It could be something as simple as having to accept an ssh host
key (for which I suggest adding "-o StrictHostKeyChecking=no" to your
script's ssh command so you don't have that problem).
alex
On 2/25/15 22:19, Gurunadh Venkata wrote:
>
> 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.
> 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 working failover script if any.
> Thanks for your time.
>
>
> Thanks & Regards,
> G V Gurunadh.
>
>
> _______________________________________________
> 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.pgpool.net/pipermail/pgpool-general/attachments/20150226/e181a815/attachment.htm>
More information about the pgpool-general
mailing list