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() 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 (startup, 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 ...

Get PostgreSQL 9 Administration Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.