How to check streaming replication status

From: Condor <condor(at)stz-bg(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to check streaming replication status
Date: 2017-08-31 07:35:56
Message-ID: 142f748e8e9a3883a99585af496f4008@stz-bg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hello,

I have a question about master - slave replication.
My version on both servers is : PostgreSQL 9.6.4 on
x86_64-slackware-linux-gnu, compiled by x86_64-slackware-linux-gcc (GCC)
7.2.0, 64-bit

Here is the story:

Today I create a table space and move all indexes on nvmi drives. So far
so good.

Master server is configured as replica and start sending replication wal
files to slave server,
after a hour I get error message on slave server:

LOG: restored log file "000000010000008B000000DC" from archive
LOG: restored log file "000000010000008B000000DD" from archive
cp: can get attribute '/archive/000000010000008B000000DE': No such file
or directory
LOG: started streaming WAL from primary at 8B/DD000000 on timeline 1

Question coming in my mind: Did my slave is up to date ?

I read https://wiki.postgresql.org/wiki/Streaming_Replication and know I
can check status with:

$ psql -c "select pg_last_xlog_receive_location()" -h192.168.0.20
(standby host)

and after I did it, got:

STATEMENT: SELECT pg_current_xlog_location()
ERROR: recovery is in progress
HINT: WAL control functions cannot be executed during recovery.

My question is: How I can check the replication status when the slave
does not accept connections ?
I know if there have some different in configurations slave does not
accept connections, but in my case
slave have different hardware so is normal to have differences in config
files.

Regards,
Hristo S

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Glyn Astill 2017-08-31 08:24:52 Re: How to check streaming replication status
Previous Message Achilleas Mantzios 2017-08-31 07:28:07 Re: Table create time