PCP_NODE_INFO(1)
β¨ pcp_node_info π
okay bestie, welcome to the pcp_node_info glow-up π«Ά this one lives in the pgpool-II 4.7.2 docs, it's a manual page (section 1, so it's a command you run in your shell), and it's literally just: displays the information on the given node ID. that's the whole vibe. it's the "hey what's up with node 3" command and it ate π
πΈ NAME πΈ
pcp_node_info β displays the information on the given node ID β¨
π SYNOPSIS π
pcp_node_info [option...] [node_id]
π¦ DESCRIPTION π¦
so like, pcp_node_info displays the information on the given node ID. that's it. that's the main character energy right there. you point it at a node, it tells you everything it knows about that node. periodt π
π OPTIONS π
-nnode_id,--node-id=node_idβ the index of the backend node to get information of. like, which node are we snooping on bestie π-a,--allβ display all backend nodes information. every single one. no node left behind π«Ά
Other options
- see
pcp_common_options(1). yeah, the shared options live over there, go check them out π§
π₯ EXAMPLE π₯
here's what an output looks like, iconic:
$ pcp_node_info -w -p 11001 -n 1
/tmp 11003 1 0.500000 waiting up standby standby 0 streaming async 2021-02-27 14:51:30
and the result is in the following order, don't get it twisted:
- hostname
- port number
- status
- load balance weight
- status name
- actual backend status (obtained using PQpingParams. Pgpool-II 4.3 or later)
- backend role
- actual backend role (obtained using pg_is_in_recovery. Pgpool-II 4.3 or later)
- replication delay
- replication state (taken from pg_stat_replication. Pgpool-II 4.1 or later)
- sync replication state (taken from pg_stat_replication. Pgpool-II 4.1 or later)
- last status change time
so 3 (status) is represented by a digit from [0 to 3]. yes, only four little guys:
- 0 - this state is only used during the initialization. PCP will never display it. like it's shy, it never shows up π
- 1 - node is up. no connections yet.
- 2 - node is up. connections are pooled.
- 3 - node is down. π
4 (load balance weight) is displayed in normalized format (0 - 1).
5 (status name) indicates the status of a PostgreSQL node as recognized by Pgpool-II. it corresponds to the numeric value shown in "3 (status)" and represents the node's internal state in a human-readable format maintained by Pgpool-II.
6 (actual backend status) shows the backend status in real time. the info is obtained by calling PQpingParams at the time when the command is invoked. PQpingParams is only available in PostgreSQL 9.1 or later. if Pgpool-II was built with PostgreSQL 9.0 or earlier, the column shows "unknown". also if health check is disabled, it shows "unknown". when a backend node is detached by pcp_detach_node(1), the status managed by Pgpool-II will be "down", while the actual backend status is "up". thus it is possible that 5 does not match with 6. however it should not happen that 5 is "up" while 6 is "down". (bestie, if you see that, something is deeply wrong π)
7 (backend role) indicates the role of a PostgreSQL node (primary or standby) from the perspective of Pgpool-II, based on its internally maintained information.
8 (actual backend role) shows the backend status in real time. the result will be either "primary" or "standby", and possibly "unknown" if information retrieval failed. since Pgpool-II searches backend nodes in the node id order and assumes the last found node is primary, it is possible that 7 does not match 8 when there are multiple nodes that are not standby by erroneous operations (this command is useful to find such that situation). in other than streaming replication mode, the status will be either "main" or "replica". unlike streaming replication mode pg_is_in_recovery is not called and value for 7 and 8 will be always the same.
to correctly display 9, 10 and 11, sr_check_period must not be 0. additionally, to correctly display 10 and 11, the following settings are required.
backend_application_namemust be configured.
the value set for each backend_application_nameX must match the value specified in application_name of primary_conninfo for the corresponding node.
in particular, when creating standby nodes using Pgpool-II's pcp_recovery_node(1) command and community-provided sample scripts, please ensure that the value of backend_application_nameX matches that of backend_hostnameX. for specific configuration examples, please refer to Section 8.2.7.6, "Backend Settings", in the documentation.
sr_check_usermust either be a PostgreSQL superuser or have been granted the privileges of thepg_monitorrole.
β οΈ Note to grant the privileges of thepg_monitorrole tosr_check_user, execute following SQL command by PostgreSQL super user (replace "sr_check_user" with the setting ofsr_check_user):GRANT pg_monitor TO sr_check_user;for PostgreSQL 9.6, there's nopg_monitorgroup andsr_check_usermust be PostgreSQL super user.
from Pgpool-II 4.4, 9 (replication delay) is displayed in either bytes or seconds. see delay_threshold_by_time for more details.
the -a or --all option lists all backend nodes information. look at her go π
$ pcp_node_info -w -p 11001 -a
/tmp 11002 1 0.500000 waiting up primary primary 0 none none 2021-02-27 14:51:30
/tmp 11003 1 0.500000 waiting up standby standby 0 streaming async 2021-02-27 14:51:30
the --verbose option can help understand the output. for example:
$ pcp_node_info -w -p 11001 --verbose 1
Hostname : /tmp
Port : 11003
Status : 1
Weight : 0.500000
Status Name : waiting
Backend Status Name : up
Role : standby
Backend Role : standby
Replication Delay : 0
Replication State : streaming
Replication Sync State : async
Last Status Change : 2021-02-27 14:51:30
like, --verbose really said "let me spell it out for you" π
obsessed.
β¨ that's the whole page bestie β¨ this was pgpool-II 4.7.2, dated 2023, and it lives in the PCP_NODE_INFO(1) section of the manual. go check your nodes, slay, and remember: 5 should never be "up" while 6 is "down" π«Άππ¦
π¦ where this page comes from
- ubuntu stonking: pgpool2 4.7.2-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms