Re: [GENERAL] How to check streaming replication status - Mailing list pgsql-general

From Condor
Subject Re: [GENERAL] How to check streaming replication status
Date
Msg-id 2747e3990cdb1528182b5507f84d0e0d@stz-bg.com
Whole thread Raw
In response to Re: [GENERAL] How to check streaming replication status  (Glyn Astill <glynastill@yahoo.co.uk>)
List pgsql-general
On 31-08-2017 12:14, Glyn Astill wrote:
>> From: Condor <condor@stz-bg.com>
>> To: Glyn Astill <glynastill@yahoo.co.uk>
>> Cc: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>;
> "pgsql-general-owner@postgresql.org"
> <pgsql-general-owner@postgresql.org>
>> Sent: Thursday, 31 August 2017, 09:42:17 GMT+1
>> Subject: Re: [GENERAL] How to check streaming replication status
>
>>>> My question is: How I can check the replication status when the
>>> slave
>>>> does not accept connections ?
>>>
>>> That's right for a server in recovery you need to call
>>> pg_last_xlog_receive_location() or pg_last_xlog_replay_location()
> to
>>> get the current xlog position.
>>
>>
>> Yes,
>> but my question is how to call them when Im unable to connect with
> slave
>> even when
>> replication is over. How I can ask the slave server: Are you in
> recovery
>> mode ?
>>
>
> Define "unable to connect", in your previous example you appeared to
> be connected to the slave and attempting to call
> pg_current_xlog_location() ...
>
> If you want to know if postgres is in recovery call
> pg_is_in_recovery()
>
> https://www.postgresql.org/docs/current/static/functions-admin.html
>
>>
>> What is the last wal file send from master, which file you processing
>> now ?
>> How far behind you ?
>>
>> As I ask:  My question is: How I can check the replication status
> when
>> the slave does not accept connections ?
>
> Again I think you need to define "the slave does not accept
> connections".
>
> If you've not configured the slave to be a hot standby, then try
> setting hot_standby=on in postgresql.conf on the slave.  If you don't
> want to do that you can run the pg_controldata executable on the slave
> to see the cluster state.
>
> You should also be able to see streaming replication slave lag on the
> master by looking at pg_stat_replication and using
> pg_xlog_location_diff()
>
> hth


Yes,
it's seems my mistake. I did not change the first part of ip address and
trying to query test slave server which is connected to different master
server.
It's will be wondering if it work ...

Sorry


pgsql-general by date:

Previous
From: hamann.w@t-online.de
Date:
Subject: Re: [GENERAL] Table create time
Next
From: basti
Date:
Subject: [GENERAL] Try pglogical with postgres 9.6