[pgpool-general: 3554] Re: Reg Failover Script in pgpool

Mark Kirkwood mark.kirkwood at catalyst.net.nz
Fri Mar 20 06:26:50 JST 2015


On 19/03/15 23:22, Gurunadh Venkata wrote:
> Hi all,
> 
> I have setup the pgpool for streaming replication failover in PostgreSQL.
> 
> I have two PostgreSQL servers 10.0.0.80(master) & 10.0.0.81(slave) and
> pgpool running on 10.0.0.81 with port 9999.
> 
> Now i want to write a failover script where if my master pg server fails
> then slave server should take the role of Master server.
> 
> Please help me in creating a failover script. I have already tried with
> different failover scripts but none of them are working fine .
> 
> Please find the attached pgpoog.conf, pgpool logs failover script files and
> please let me Know if any changes required.
> 
> Thanks for your time..
> 

Your script failover.sh has a syntax error at line 22:


if [$failed_node_id = $old_primary_node_id ];then       # master failed

should be:

if [ $failed_node_id = $old_primary_node_id ];then       # master failed

note the space! Shell is touchy about that sort of thing!

Cheers

Mark


More information about the pgpool-general mailing list