Reg Failover Script in Pgpool

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Reg Failover Script in Pgpool
Hi list,

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

 DB version PPAS 9.4

 pgpool   version 3.3.4

 Os         Rhel 6.4 64bit

 The following is my failover command in pgpool.conf

 failover_command ='/usr/local/etc/ %d %P %H

 Following is the failover script.

 #!/bin/bash -x
 FALLING_NODE=$1         # %d
 NEW_PRIMARY=$3          # %H
 PGDATA=$4               # %R

     if [ $UID -eq 0 ]
         su enterprisedb -c "ssh -T enterprisedb@$NEW_PRIMARY touch
         ssh -T enterprisedb@$NEW_PRIMARY touch $PGDATA/trigger
     exit 0;
 exit 0;
  And also i have configured the ssh for password less login.

 To check the  failover scenario i have stopped(kill -9) the master db
 server process.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;


 edb=# show pool_nodes;
  node_id |  hostname  | port | status | lb_weight |  role
  0       | | 5444 | 3      | 0.500000  | standby
  1       | | 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.