Monitoring replication
Monitoring the status and progress of your replication is essential. We'll start by looking at the server status and then query the progress of replication.
Getting ready
You'll need to start by checking the state of your server(s).
Check whether a server is up using pg_isready
or another program that uses the PQping()
application programming interface (API) call. You'll get one of the following responses:
PQPING_OK (return code 0)
: The server is running and appears to be accepting connections.PQPING_REJECT (return code 1)
: The server is running but is in a state that disallows connections (start up, shutdown, or crash recovery) or a standby that is not enabled with Hot Standby.PQPING_NO_RESPONSE (return code 2)
: The server could not be contacted. This might indicate that the server is not running, there is something wrong with the given connection parameters (for example, wrong port number), or there is a network...