[pgpool-general: 4878] Re: Need some explanation about recovery

Daniel Huhardeaux tech at tootai.net
Sun Aug 7 01:51:06 JST 2016


Le 05/08/2016 à 15:33, Tatsuo Ishii a écrit :
[...]
>>
>> So far so good, running this script does the job, replication and load
>> balancing are working as expected.
>>
>> My questions now are:
>>
>> - how pgpool knows that standby database is no more synchronized with
>> - master one ?
>
> Pgpool-II checks replication delay every sr_check_period second by
> calling pg_last_xlog_replay_location() on primary and
> pg_last_xlog_replay_location() on standby, and compares the results.

Is it a way from a pcp command or other to get this status ?

>
>> - can I put my script in recovery_1st_stage_command =
>> - '/usr/local/bin/<myscript>' and recovery_2nd_stage_command = 'bash -c
>> - "exit 0"' from standby host (see attached gppool.conf) for the
>> - recovery?
>
> First, you can leave recovery_2nd_stage_command as default. You don't
> need it in streaming replication mode.
>
> Probably your script works as a recovery_1st_stage_command. However I
> recommend you to get primary server address etc. from the arguments
> passed by pgpool-II when the script is invoked by pgpool-II, rather
> than having fixed values. Otherwise recovery won't work if primary
> server is changed.

Done, thanks for the tip.

[...]

Daniel

-- 
TOOTAi Networks


More information about the pgpool-general mailing list