You can use the replication manager tool suite and the PostgreSQL interactive terminal to check the replication status of individual nodes in a database high availability cluster.

Procedure

  1. Log in or SSH as root to the OS of any of the running nodes in the cluster.
  2. Change the user to postgres.
    sudo -i -u postgres
  3. Check the replication status of the node.
    /opt/vmware/vpostgres/current/bin/repmgr -f /opt/vmware/vpostgres/current/etc/repmgr.conf node status

    The system output provides information on the node, PostgreSQL version, and replication details.

  4. (Optional) For more detailed information, use the PostgreSQL interactive terminal to check the replication status of the nodes.
    The PostgreSQL interactive terminal can provide information regarding whether any of the received log records of the standby nodes are lagging behind the logs sent by the primary.
    1. Connect to the psql terminal
      /opt/vmware/vpostgres/current/bin/psql
    2. To expand the display and make query results easier to read, run the set \x command.
    3. Run a replication status query depending on the role of the node.
      Option Action

      Run a query on the primary node.

      /opt/vmware/vpostgres/current/bin/psql

      Run a query on a standby node.

      select * from pg_stat_wal_receiver;