管理高可用组件

使用pdbcli cm管理目标节点高可用组件(Cluster Manager)运行状态。

在配置文件config.yaml中,定义了高可用组件安装在哪些主机上。使用pdbcli cm管理目标节点高可用组件运行状态,包括该组件的启动、停止、重启及状态查询操作。

  • 启动目标节点的高可用组件:

    pdbcli cm --start --targets='HOSTNAME'
  • 停止目标节点的高可用组件:

    pdbcli cm --stop --targets='HOSTNAME'
  • 重启目标节点的高可用组件:

    pdbcli cm --restart --targets='HOSTNAME'
  • 查看目标节点的高可用组件状态:

    pdbcli cm --status --targets='HOSTNAME'
说明
  • HOSTNAME为目标主机的主机名,可通过查看配置文件获取。

  • 若存在多个目标主机,使用英文逗号分隔多个HOSTNAME,例如:pdbcli cm --restart --targets='host01,host02'

您可执行pdbcli help cmpdbcli cm --help命令获取高可用组件相关命令说明:

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  # 获取关于cm命令的帮助信息
   --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). # 指定要进行cm命令的目标主机。若有多个目标主机,则使用英文逗号分隔多个HOSTNAME。

Global Flags:
   --config string  Specify Config file. (default "./config.yaml") # 指定配置文件,默认为./config.yaml
   --debug      Enable additional output for debugging. # 显示更多输出信息,用于调试