Use pdbcli cm to manage the status of the high availability (HA) component, Cluster Manager, on a target node.
The config.yaml file specifies the hosts where the HA component is installed. You can use pdbcli cm to perform operations on the HA component on a target node, such as starting, stopping, restarting, and querying its status.
To start the HA component on a target node:
pdbcli cm --start --targets='HOSTNAME'To stop the HA component on a target node:
pdbcli cm --stop --targets='HOSTNAME'To restart the HA component on a target node:
pdbcli cm --restart --targets='HOSTNAME'To view the status of the HA component on a target node:
pdbcli cm --status --targets='HOSTNAME'
HOSTNAME is the hostname of the target host. You can find it in the configuration file.
To specify multiple target hosts, separate the hostnames with a comma. For example:
pdbcli cm --restart --targets='host01,host02'.
Run pdbcli help cm or pdbcli cm --help to view the descriptions of the HA component commands:
Using config file: ./config.yaml
Control PolarDB Cluster Manager operation.
For example:
pdbcli cm --restart --targets='host01,host02'
Usage:
pdbcli cm [flags]
Flags:
-h, --help help for cm # Get help for the cm command.
--restart Restart PolarDB Cluster Manager Service, this operation will
perform rolling restart operation.
--start Start PolarDB Cluster Manager Service.
--status Show PolarDB Cluster Manager Service status.
--stop Stop PolarDB Cluster Manager Service.
--targets string Specify operation target host(s) (HOSTNAME with comma(,) separated with NO SPACE). # Specify the target host(s) for the cm command. For multiple hosts, separate the HOSTNAMEs with a comma.
Global Flags:
--config string Specify Config file. (default "./config.yaml") # Specify the configuration file. The default is ./config.yaml.
--debug Enable additional output for debugging. # Show additional output for debugging.