查看集群版本

使用pdbcli version查看集群版本信息。

执行以下命令,查看当前路径下安装的集群版本信息:

pdbcli version

返回示例如下:

Using config file: ./config.yaml
Client Version: cmd.Version{Version:"v0.2.0", GitCommit:"5e5e0d0da55ce9298d8f5c1fda59e0aa5ef39c83", BuildDate:"2020-09-09T02:39:11Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}

您可以执行pdbcli help versionpdbcli version --help获取相关使用说明:

Using config file: ./config.yaml
Print the version information for the current context

Usage:
 pdbcli version [flags]

Flags:
 -h, --help  help for version  # 获取关于version命令的帮助信息

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

您可增加-a参数查看集群组件版本信息:

pdbcli version -a
说明

仅当高可用组件(Cluster_Manager)正常运行时,可查看各个组件的版本信息。

返回示例如下:

Using config file: polardb2.yaml
{
        "backup_agent": [
                {
                        "endpoint": "10.x.x.x:817",
                        "version": "v2.2.2-20220224142036-xxxxxxxx"
                },
                {
                        "endpoint": "10.x.x.x:817",
                        "version": "v2.2.2-20220224142036-xxxxxxxx"
                },
                {
                        "endpoint": "10.x.x.x:817",
                        "version": "v2.2.2-20220224142036-xxxxxxxx"
                },
                {
                        "endpoint": "10.x.x.x:817",
                        "version": "v2.2.2-20220224142036-xxxxxxxx"
                }
        ],
        "node_driver": [
                {
                        "endpoint": "10.x.x.x:12355",
                        "version": "v2.2.1-20211207054315-xxxxxxxx"
                },
                {
                        "endpoint": "10.x.x.x:12355",
                        "version": "v2.2.1-20211207054315-xxxxxxxx"
                },
                {
                        "endpoint": "10.x.x.x:12355",
                        "version": "v2.2.1-20211207054315-xxxxxxxx"
                },
                {
                        "endpoint": "10.x.x.x:12355",
                        "version": "v2.2.1-20211207054315-xxxxxxxx"
                }
        ],
        "pdbcli": {
                "name": "pdbcli",
                "version": "v2.2.2.2-20220420105840-xxxxxxxx"
        },
        "plugins": [
                {
                        "name": "golang-manager",
                        "version": "v2.2.0-20220420183810-xxxxxxxx"
                }
        ],
        "universe_explorer": [
                {
                        "endpoint": "10.x.x.x:819",
                        "version": "map[Buildtime:2021-12-15T07:51:11Z GitBranch:POLARDB_O_GAWR_POLARFLEX_2_2_0_RELEASE GitCommitID:xxxxxxxx RpmName:t-polardb-o-universe-polarflex RpmRelease:20211215155054.alios7 RpmVersion:1.0.0]"
                },
                {
                        "endpoint": "10.x.x.x:819",
                        "version": "map[Buildtime:2021-12-15T07:51:11Z GitBranch:POLARDB_O_GAWR_POLARFLEX_2_2_0_RELEASE GitCommitID:xxxxxxxxRpmName:t-polardb-o-universe-polarflex RpmRelease:20211215155054.alios7 RpmVersion:1.0.0]"
                },
                {
                        "endpoint": "10.x.x.x:819",
                        "version": "map[Buildtime:2021-12-15T07:51:11Z GitBranch:POLARDB_O_GAWR_POLARFLEX_2_2_0_RELEASE GitCommitID:xxxxxxxx RpmName:t-polardb-o-universe-polarflex RpmRelease:20211215155054.alios7 RpmVersion:1.0.0]"
                },
                {
                        "endpoint": "10.x.x.x:819",
                        "version": "map[Buildtime:2021-12-15T07:51:11Z GitBranch:POLARDB_O_GAWR_POLARFLEX_2_2_0_RELEASE GitCommitID:xxxxxxxx RpmName:t-polardb-o-universe-polarflex RpmRelease:20211215155054.alios7 RpmVersion:1.0.0]"
                }
        ],
        "version": "v2.2.0-20220420183810-xxxxxxxx"
}