WD_CLI(1)

✨ NAME ✨

okay so bestie, meet wd_cli πŸ’– β€” the Watchdog Command Line Interface (CLI) utility for the external health-check system integration. that's her whole deal, and she slays it. 🐢✨


🌸 SYNOPSIS 🌸

wd_cli [operation...] [node search option...] [option...]

operation first, then how you wanna hunt down your node, then any extra options you're feeling. iconic order, no notes. 🫢


πŸ’… DESCRIPTION πŸ’…

wd_cli gives you a convenient and easy to use interface to interact with watchdog and to perform health check related node operations. it's giving "I got you, bestie, lemme handle the watchdog stuff." πŸ‘‘


πŸŽ€ OPERATIONS πŸŽ€

pick your move, main character:

  • -i, --info β€” get the node status for node(s), based on whatever node search criteria you gave her πŸ”
  • -I NEW_STATUS, --inform=NEW_STATUS β€” update the watchdog node status. the allowed values are DEAD and ALIVE, and those are the only two, don't try to freestyle it πŸ’€

πŸ”Ž NODE SEARCH OPTIONS πŸ”Ž

how do we find the node?? so many ways, pick one:

  • -a, --all β€” select all the nodes. heads up tho: this one is only available with the --info operation 🚨
  • -n WATCHDOG_NODE_ID, --node-id=WATCHDOG_NODE_ID β€” select the watchdog node by its node_id
  • -N NODE_NAME, --node-name=NODE_NAME β€” select the watchdog node by its name
  • -H HOSTNAME, --node-host=HOSTNAME β€” select the watchdog node by hostname
  • -P PORT_NO, --node-port=PORT_NO β€” select the watchdog node by port number

βš™οΈ OPTIONS βš™οΈ

the whole menu, bestie, nothing skipped πŸ“

  • -k KEY, --auth-key=KEY β€” the watchdog auth key. if you specify auth-key, it overrides the pgpool.conf->wd_authkey value πŸ”‘
  • -f CONFIG_FILE, --config-file=CONFIG_FILE β€” specifies the pgpool.conf file
  • -s SOCKET_DIR, --socket-dir=SOCKET_DIR β€” path to the watchdog IPC socket directory. specifying socket-dir overrides the pgpool.conf->wd_ipc_socket_dir value 🧦
  • -p PORT_NO, --ipc-port=PORT_NO β€” port number of the watchdog IPC socket. specifying ipc-port overrides the pgpool.conf->wd_port value
  • -m message_string, --message=message_string β€” an optional message string, passed along to Pgpool-II together with the node status πŸ’Œ
  • -v, --verbose β€” enable verbose messages, for when you wanna see everything
  • -V, --version β€” prints version information
  • -d, --debug β€” enable debug output πŸ›
  • -h, --help β€” prints the help for wd_cli
not me reminding you that -p/--ipc-port and -P/--node-port are two completely different queens. lowercase = IPC socket port. uppercase = node search port. do not confuse them, i'm begging πŸ™ˆ

πŸ§ͺ EXAMPLE πŸ§ͺ

so here's the scenario: some external health-check system is set up to monitor the health of your Pgpool-II cluster, and it detects a node failure. that's when wd_cli steps in β€” you use this utility to pass that info over to the Pgpool-II cluster so it can take the appropriate actions. teamwork, fr fr 🀝

#inform Pgpool-II about node named RN-110 failure
wd_cli --inform DEAD -N 'RN-110' -p 9001 -m 'Pgpool node with name RN-110 is not reachable'

#inform Pgpool-II about node-id 10 failure
wd_cli --inform DEAD -n 10 -m 'Pgpool node with ID 10 is not responding'

and similarly, to inform Pgpool-II that the node is alive again 🌱

#inform Pgpool-II about node-id 10 re-joining
wd_cli --inform ALIVE -n 10 -m 'Pgpool node with ID 10 is reachable again'

wd_cli can also be used to get the current status of cluster nodes πŸ‘€

wd_cli -f simple_conf/watchdog/pgpool_wd1.conf --info -v --all

and she's gonna serve you something like this:

 Total Watchdog nodes configured for lifecheck:  2
 *****************
 Node ID:           0
 Node Status code   4
 Node Status:       LEADER
 Node Name:         localhost:9991 Linux localhost.localdomain
 Node Host:         localhost
 Node WD Port:      9001
 Node Pgpool Port:  9991

 Node ID:           1
 Node Status code   7
 Node Status:       STANDBY
 Node Name:         localhost:9992 Linux localhost.localdomain
 Node Host:         localhost
 Node WD Port:      9002
 Node Pgpool Port:  9992

and that's the whole page!! πŸ¦‹ this is WD_CLI(1), part of the pgpool-II 4.7.2 docs, dated 2023 β€” go forth and watchdog, bestie, you're literally so good at this πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from