pcp_node_info

Name

pcp_node_info --  displays the information on the given node ID

Synopsis

pcp_node_info [option...] [node_id]

Description

pcp_node_info displays the information on the given node ID.

Options

-n node_id
--node-id=node_id

The index of backend node to get information of.

Other options

See pcp_common_options.

Example

Here is an example output:

    $ pcp_node_info -h localhost -U postgres 1
    /tmp 11003 2 0.500000 up standby 0 streaming async 2019-04-23 13:58:40
   

The result is in the following order:

    1. hostname
    2. port number
    3. status
    4. load balance weight
    5. status name
    6. backend role
    7. replication delay
    8. replication state (taken from pg_stat_replication, if PostgreSQL is 9.1 or later)
    9. sync replication state (taken from pg_stat_replication, if PostgreSQL is 9.2 or later)
    10. last status change time
   

Status is represented by a digit from [0 to 3]. To correctly 7, 8, 9 are displayed, sr_check_period must not be 0. 8, 9 will not be displayed if sr_check_user is not PostgreSQL super user nor it's not in "pg_monitor" group.

Note: To make sr_check_user in pg_monitor group, execute following SQL command by PostgreSQL super user (replace "sr_check_user" with the setting of sr_check_user):

	  GRANT pg_monitor TO sr_check_user;
	 

For PostgreSQL 9.6, there's no pg_monitor group and sr_check_user must be PostgreSQL super user.

The load balance weight is displayed in normalized format.

The --verbose option can help understand the output. For example:

   $ pcp_node_info --verbose -h localhost -U postgres 1
   Hostname               : /tmp
   Port                   : 11003
   Status                 : 2
   Weight                 : 0.500000
   Status Name            : up
   Role                   : standby
   Replication Delay      : 0
   Replication State      : streaming
   Replication Sync State : async
   Last Status Change     : 2019-04-23 13:58:40