From 003cb6009a0cf4e4b503369d29700bda8ba58187 Mon Sep 17 00:00:00 2001 From: vimiix Date: Tue, 7 Jun 2022 23:47:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(ptk):=E5=AE=8C=E5=96=84PTK=E6=96=87?= =?UTF-8?q?=E6=A1=A3=EF=BC=8C=E6=9B=B4=E6=96=B0=E5=AD=90=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=92=8C=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- product/zh/docs-ptk/v0.1/command.md | 721 ++++++++++++++---------- product/zh/docs-ptk/v0.1/overview.md | 6 +- product/zh/docs-ptk/v0.1/quick-start.md | 12 +- product/zh/docs-ptk/v0.1/usage.md | 4 +- 4 files changed, 434 insertions(+), 309 deletions(-) diff --git a/product/zh/docs-ptk/v0.1/command.md b/product/zh/docs-ptk/v0.1/command.md index b27c1537..13fa5f26 100644 --- a/product/zh/docs-ptk/v0.1/command.md +++ b/product/zh/docs-ptk/v0.1/command.md @@ -5,30 +5,137 @@ author: Yao Qian date: 2022-05-30 --- -## PTK 所有子命令 - -### Content - -* [ptk checkos](#ptk-checkos) - Check cluster servers os dependencies -* [ptk completion](#ptk-completion) - Generate the autocompletion script for the specified shell -* [ptk encrypt](#ptk-encrypt) - Provides a convenient way to encrypt your text/password -* [ptk env](#ptk-env) - Print ptk environment information -* [ptk gen-xml](#ptk-gen-xml) - Generate an XML file -* [ptk install](#ptk-install) - Install the MogDB database cluter based on topology configuration -* [ptk ls](#ptk-ls) - List MogDB clusters -* [ptk restart](#ptk-restart) - Restart db instance or cluster -* [ptk self](#ptk-self) - Modify the ptk installation -* [ptk start](#ptk-start) - Start db instance or cluster -* [ptk status](#ptk-status) - Show status of db instance or cluster -* [ptk stop](#ptk-stop) - Stop db instance or cluster -* [ptk template](#ptk-template) - Print template of configuration -* [ptk uninstall](#ptk-uninstall) - Uninstall a MogDB database cluster +## ptk + +### 介绍 + +PTK是一款部署和管理MogDB数据库集群的命令行工具 + +``` +ptk [flags] [args...] +``` + +### 参数 + +``` + -f, --file string 指定集群配置文件 + -h, --help 打印PTK帮助信息 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 +``` + +### 更多请参考 + +* [ptk candidate](#ptk-candidate) - 打印 PTK 支持的软件版本列表 +* [ptk checkos](#ptk-checkos) - 检查集群服务器系统依赖是否满足安装数据库需求 +* [ptk completion](#ptk-completion) - 为指定的 shell 生成自动补全脚本 +* [ptk encrypt](#ptk-encrypt) - 提供一个便捷的方式来加密您的文本或密码 +* [ptk env](#ptk-env) - 打印 PTK 环境变量信息 +* [ptk gen-om-xml](#ptk-gen-om-xml) - 生成 gs_om 的 XML 配置文件 +* [ptk install](#ptk-install) - 基于给定的拓扑配置部署MogDB数据库集群 +* [ptk ls](#ptk-ls) - 列出所有MogDB集群列表 +* [ptk restart](#ptk-restart) - 重启数据库实例或集群 +* [ptk self](#ptk-self) - 操作 PTK 自身安装包 +* [ptk start](#ptk-start) - 重启数据库实例或集群 +* [ptk status](#ptk-status) - 显示集群或实例的状态信息 +* [ptk stop](#ptk-stop) - 停止数据库实例或集群 +* [ptk template](#ptk-template) - 打印配置模板 +* [ptk uninstall](#ptk-uninstall) - 卸载 MogDB 数据库集群 +* [ptk version](#ptk-version) - 打印 PTK 版本 + +## ptk candidate mogdb-server + +列出支持安装的 MogDB 数据库版本列表 + +``` +ptk candidate mogdb-server [flags] +``` + +### 参数 + +``` + -h, --help help for mogdb-server +``` + +### 继承自父命令的参数 + +``` + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 +``` + +### 更多请参考 + +* [ptk candidate](#ptk-candidate) - 打印 PTK 支持的软件版本列表 + +## ptk candidate os + +列出支持安装 MogDB 的操作系统 + +``` +ptk candidate os [flags] +``` + +### 参数 + +``` + -h, --help help for os +``` + +### 继承自父命令的参数 + +``` + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 +``` + +### 更多请参考 + +* [ptk candidate](#ptk-candidate) - 打印 PTK 支持的软件版本列表 + +## ptk candidate + +打印 PTK 支持的软件版本列表 + +``` +ptk candidate [flags] +``` + +### 参数 + +``` + -h, --help help for candidate +``` + +### 继承自父命令的参数 + +``` + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 +``` + +### 更多请参考 + +* [ptk](#ptk) - +* [ptk candidate mogdb-server](#ptk-candidate-mogdb-server) - 列出支持安装的 MogDB 数据库版本列表 +* [ptk candidate os](#ptk-candidate-os) - 列出支持安装 MogDB 的操作系统 ## ptk checkos -Check cluster servers os dependencies +检查集群服务器系统依赖是否满足安装数据库需求 -### Synopsis +### 介绍 Check cluster servers os dependencies. To check all items, enter "-i A". @@ -54,157 +161,160 @@ Item number description: ptk checkos [flags] ``` -### Options +### 参数 ``` - --detail Print detail message of every check item + --detail 打印每个检查项的详细信息 -h, --help help for checkos - -i, --item string Specify item number, multiple items are separated by commas (default "A") - -o, --output string Specify a output path if needed + -i, --item string 指定检查项编号,多个编号间使用英文逗号分隔 (default "A") + -o, --output string 指定结果输出文件路径 ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk](#ptk) +* [ptk](#ptk) - ## ptk encrypt -Provides a convenient way to encrypt your text/password +提供一个便捷的方式来加密您的文本或密码 ``` ptk encrypt TEXT1 [TEXT2 TEXT3...] [flags] ``` -### Options +### 参数 ``` -h, --help help for encrypt ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk](#ptk) +* [ptk](#ptk) - ## ptk template create -Create config template by interaction +交互式创建配置模板 ``` ptk template create [flags] ``` -### Options +### 参数 ``` -h, --help help for create - -o, --output string Specify an output filename to store template (default "config.yaml") + -o, --output string 指定用于存储模板的文件路径 (default "config.yaml") ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk template](#ptk-template) - Print template of configuration +* [ptk template](#ptk-template) - 打印配置模板 ## ptk template -Print template of configuration +打印配置模板 ``` ptk template [flags] ``` -### Options +### 参数 ``` - -h, --help help for template + -h, --help help for template + -l, --local 生成安装本地数据库的配置 ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk](#ptk) -* [ptk template create](#ptk-template-create) - Create config template by interaction +* [ptk](#ptk) - +* [ptk template create](#ptk-template-create) - 交互式创建配置模板 ## ptk install -Install the MogDB database cluter based on topology configuration +基于给定的拓扑配置部署MogDB数据库集群 ``` ptk install [flags] ``` -### Options +### 参数 ``` - -y, --assumeyes Automatically answer yes for all questions - --db-version string Specify the database package version if use online package (default "2.1.1") - -e, --env strings Environment variable will be append to os user profile + -y, --assumeyes 自动对所有提问回复Yes + --db-version string 指定数据库安装包的版本(仅限在线安装) + 可通过 'ptk candidate mogdb-server' 查看支持的 Mogdb Server 版本列表 (default "2.1.1") + -e, --env strings 环境变量将被添加到系统用户的配置文件中 -h, --help help for install - --launch-db-timeout duration Timeout for launch db (default 5m0s) - -p, --pkg string Specify the database package path or url - --post-run string The bash script will be run on every node after deploy - --pre-run string The bash script will be run on every node before deploy - --skip-check-distro Skip check distro, install directly - --skip-create-user Skip creating system user - --skip-launch-db Skip launching db after initdb - --skip-rollback Skip rollback when deploy failure + --launch-db-timeout duration 启动数据库超时时间 (default 1m0s) + -p, --pkg string 指定数据库安装包的文件路径或URL + --post-run string 指定 Bash 脚本路径,将在部署成功后分发到每个服务器上运行 + --pre-run string 指定 Bash 脚本路径,将在执行部署数据库之前分发到每个服务器上运行 + --skip-check-distro 跳过系统发行版检查,直接安装 + --skip-check-os 跳过系统环境检查,直接安装 + --skip-create-user 跳过创建系统用户 + --skip-launch-db 跳过启动数据库 + --skip-rollback 安装失败时跳过回滚操作 ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 * [ptk](#ptk) - ## ptk uninstall -Uninstall a MogDB database cluster +卸载 MogDB 数据库集群 ``` ptk uninstall [flags] @@ -223,559 +333,564 @@ If both topo.yaml and name are specified, ptk will prefer to use topo.yaml. ``` -### Options +### 参数 ``` -h, --help help for uninstall - --name string Specify the cluster name to be uninstalled + --name string 指定要卸载的集群名称 ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 * [ptk](#ptk) - ## ptk ls -List MogDB clusters +列出所有MogDB集群列表 ``` ptk ls [flags] ``` -### Options +### 参数 ``` -h, --help help for ls - -n, --only-name Only list cluster names + -n, --only-name 仅列出集群名称 ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 * [ptk](#ptk) - ## ptk start -Start db instance or cluster +重启数据库实例或集群 ``` ptk start [flags] ``` -### Options +### 参数 ``` -h, --help help for start -H, --host string IP of host to be operated --name string Cluster name - --security-mode string Whether start database with security mode - options: on/off - --time-out duration Maximum waiting time on starting (default 2m0s) + --security-mode string 是否使用安全模式启动数据库 + 参数: on/off + --time-out duration 启动超时时间 (default 2m0s) ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk](#ptk) +* [ptk](#ptk) - ## ptk stop -Stop db instance or cluster +停止数据库实例或集群 ``` ptk stop [flags] ``` -### Options +### 参数 ``` -h, --help help for stop -H, --host string IP of host to be operated - --mode string Shutdown mode + --mode string 关闭模式 f: fast, i: immediate --name string Cluster name - --time-out duration Maximum waiting time on stopping (default 2m0s) + --time-out duration 停止超时时间 (default 2m0s) ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk](#ptk) +* [ptk](#ptk) - ## ptk restart -Restart db instance or cluster +重启数据库实例或集群 ``` ptk restart [flags] ``` -### Options +### 参数 ``` --azname string Name of available zone -h, --help help for restart -H, --host string IP of host to be operated - --mode string Shutdown mode + --mode string 关闭模式 f: fast, i: immediate --name string Cluster name - --security-mode string Whether start database with security mode - options: on/off - --time-out duration Maximum waiting time on starting (default 2m0s) + --security-mode string 是否使用安全模式启动数据库 + 参数: on/off + --time-out duration 启动超时时间 (default 2m0s) ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk](#ptk) +* [ptk](#ptk) - ## ptk status -Show status of db instance or cluster +显示集群或实例的状态信息 ``` ptk status [flags] ``` -### Options +### 参数 ``` - --detail Show detail status information + --detail 显示状态的详细信息 -h, --help help for status -H, --host string IP of host to be operated --name string Cluster name ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk](#ptk) +* [ptk](#ptk) - ## ptk env -Print ptk environment information +打印 PTK 环境变量信息 ``` ptk env [key1 key2 ... keyN] [flags] ``` -### Options +### 参数 ``` -h, --help help for env ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk](#ptk) +* [ptk](#ptk) - -## ptk gen-xml +## ptk gen-om-xml -Generate an XML file +生成 gs_om 的 XML 配置文件 ``` -ptk gen-xml [flags] +ptk gen-om-xml [flags] ``` -### Options +### 参数 ``` - -h, --help help for gen-xml - -o, --output string Specify a output path if needed + -h, --help help for gen-om-xml + -o, --output string 指定结果输出文件路径 ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk](#ptk) +* [ptk](#ptk) - ## ptk self upgrade -Download and install updates to ptk +下载并自动安装PTK ``` ptk self upgrade [flags] ``` -### Options +### 参数 ``` -h, --help help for upgrade ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk self](#ptk-self) - Modify the ptk installation +* [ptk self](#ptk-self) - 操作 PTK 自身安装包 ## ptk self -Modify the ptk installation +操作 PTK 自身安装包 -### Options +### 参数 ``` -h, --help help for self ``` -### Options inherited from parent commands +### 继承自父命令的参数 + +``` + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 +``` + +### 更多请参考 + +* [ptk](#ptk) - +* [ptk self upgrade](#ptk-self-upgrade) - 下载并自动安装PTK + +## ptk version + +打印 PTK 版本 + +``` +ptk version [flags] +``` + +### 参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -h, --help help for version ``` -### SEE ALSO +### 继承自父命令的参数 + +``` + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 +``` + +### 更多请参考 * [ptk](#ptk) - -* [ptk self upgrade](#ptk-self-upgrade) - Download and install updates to ptk ## ptk completion bash Generate the autocompletion script for bash -### Synopsis +### 介绍 -Generate the autocompletion script for the bash shell. +为 bash shell生成自动补全脚本。 -This script depends on the 'bash-completion' package. -If it is not installed already, you can install it via your OS's package manager. +这个脚本依赖于'bash-completion'包。 +如果还没有安装,您可以通过操作系统的包管理器安装它。 -To load completions in your current shell session: +在当前的 shell 会话中加载: -``` +```shell source <(ptk completion bash) ``` -To load completions for every new session, execute once: +要使得每个新会话都生效,需执行一次: #### Linux -``` +```shell ptk completion bash > /etc/bash_completion.d/ptk ``` #### macOS -``` +```shell ptk completion bash > /usr/local/etc/bash_completion.d/ptk ``` -You will need to start a new shell for this setup to take effect. +您需要启动一个新的shell才能使这个设置生效。 ``` ptk completion bash ``` -### Options +### 参数 ``` -h, --help help for bash --no-descriptions disable completion descriptions ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk completion](#ptk-completion) - Generate the autocompletion script for the specified shell +* [ptk completion](#ptk-completion) - 为指定的 shell 生成自动补全脚本 ## ptk completion zsh -Generate the autocompletion script for zsh +为 zsh 生成自动补全脚本 -### Synopsis +### 介绍 -Generate the autocompletion script for the zsh shell. +为 zsh 生成自动补全脚本。 -If shell completion is not already enabled in your environment you will need -to enable it. You can execute the following once: +如果您的环境中还没有启用shell补全功能,那么您将需要使能它。可以执行以下操作: ``` echo "autoload -U compinit; compinit" >> ~/.zshrc ``` -To load completions in your current shell session: +在当前的 shell 会话中生效: -``` +```shell source <(ptk completion zsh); compdef _ptk ptk ``` -To load completions for every new session, execute once: +要为每个新会话都生效,执行一次: #### Linux -``` +```shell ptk completion zsh > "${fpath[1]}/_ptk" ``` #### macOS -``` +```shell ptk completion zsh > /usr/local/share/zsh/site-functions/_ptk ``` -You will need to start a new shell for this setup to take effect. +您需要启动一个新的shell才能使这个设置生效。 ``` ptk completion zsh [flags] ``` -### Options +### 参数 ``` -h, --help help for zsh --no-descriptions disable completion descriptions ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk completion](#ptk-completion) - Generate the autocompletion script for the specified shell +* [ptk completion](#ptk-completion) - 为指定的 shell 生成自动补全脚本 ## ptk completion fish -Generate the autocompletion script for fish +为 fish shell 生成自动补全脚本 -### Synopsis +### 介绍 -Generate the autocompletion script for the fish shell. +为 fish shell 生成自动补全脚本。 -To load completions in your current shell session: +要使得在当前会话中生效, 需执行: ``` ptk completion fish | source ``` -To load completions for every new session, execute once: +要使得每个新会话生效,需执行一次: ``` ptk completion fish > ~/.config/fish/completions/ptk.fish ``` -You will need to start a new shell for this setup to take effect. +您需要启动一个新的shell才能使这个设置生效。 ``` ptk completion fish [flags] ``` -### Options +### 参数 ``` -h, --help help for fish --no-descriptions disable completion descriptions ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk completion](#ptk-completion) - Generate the autocompletion script for the specified shell +* [ptk completion](#ptk-completion) - 为指定的 shell 生成自动补全脚本 ## ptk completion powershell -Generate the autocompletion script for powershell +为 powershell 生成自动补全脚本 -### Synopsis +### 介绍 -Generate the autocompletion script for powershell. +为 powershell 生成自动补全脚本 -To load completions in your current shell session: +要在当前的 shell 会话中生效: -``` +```powershell ptk completion powershell | Out-String | Invoke-Expression ``` -To load completions for every new session, add the output of the above command -to your powershell profile. +要为每个新会话都生效,需添加上述命令的输出到你的 powershell profile 中。 ``` ptk completion powershell [flags] ``` -### Options +### 参数 ``` -h, --help help for powershell --no-descriptions disable completion descriptions ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 -* [ptk completion](#ptk-completion) - Generate the autocompletion script for the specified shell +* [ptk completion](#ptk-completion) - 为指定的 shell 生成自动补全脚本 ## ptk completion -Generate the autocompletion script for the specified shell +为指定的 shell 生成自动补全脚本 -### Synopsis +### 介绍 -Generate the autocompletion script for ptk for the specified shell. -See each sub-command's help for details on how to use the generated script. +为指定的 shell 生成 ptk 的自动补全脚本。 -### Options +有关如何使用生成的脚本的详细信息,请参阅每个子命令的帮助。 + +### 参数 ``` -h, --help help for completion ``` -### Options inherited from parent commands +### 继承自父命令的参数 ``` - -f, --file string Specify a configuration file of cluster - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk + -f, --file string 指定集群配置文件 + --log-file string 指定运行日志文件路径 + --log-format string 指定运行日志的输出格式, 可选项: [text, json] (default "text") + --log-level string 指定运行日志级别, 可选项: [debug, info, warning, error, panic] (default "info") + -v, --version 打印 PTK 版本 ``` -### SEE ALSO +### 更多请参考 * [ptk](#ptk) - * [ptk completion bash](#ptk-completion-bash) - Generate the autocompletion script for bash * [ptk completion fish](#ptk-completion-fish) - Generate the autocompletion script for fish * [ptk completion powershell](#ptk-completion-powershell) - Generate the autocompletion script for powershell * [ptk completion zsh](#ptk-completion-zsh) - Generate the autocompletion script for zsh - -## ptk - -### Synopsis - -ptk is a command-line management tool that can help you to -deploy or manage MogDB clusters. - -``` -ptk [flags] [args...] -``` - -### Options - -``` - -f, --file string Specify a configuration file of cluster - -h, --help Help for ptk - --log-file string Specify a log output file - --log-format string Specify the log message format. Options: [text, json] (default "text") - --log-level string Specify the log level. Options: [debug, info, warning, error, panic] (default "info") - -v, --version Print version of ptk -``` diff --git a/product/zh/docs-ptk/v0.1/overview.md b/product/zh/docs-ptk/v0.1/overview.md index 9f5631fd..9d0c0b4b 100644 --- a/product/zh/docs-ptk/v0.1/overview.md +++ b/product/zh/docs-ptk/v0.1/overview.md @@ -24,8 +24,10 @@ PTK (Provisioning Toolkit)是一款针对 MogDB 数据库开发的软件安装 | ----------- | -------------- | | CentOS 7 | x86_64 | | RedHat 7 | x86_64 | -| openEuler | x86_64/arm | -| Kylin | x86_64/arm | +| CentOS 8 | x86_64/arm | +| EulerOS 2 | x86_64/arm | +| openEuler 20/22 | x86_64/arm | +| Kylin v10 | x86_64/arm | | UOS V20-D/E | x86_64/arm | | SUSE 12SP5 | x86_64 | | Ubuntu 18.04 | x86_64 | diff --git a/product/zh/docs-ptk/v0.1/quick-start.md b/product/zh/docs-ptk/v0.1/quick-start.md index 8912deb7..1a0d1575 100644 --- a/product/zh/docs-ptk/v0.1/quick-start.md +++ b/product/zh/docs-ptk/v0.1/quick-start.md @@ -105,15 +105,21 @@ ptk checkos -f config.yaml ptk install -f config.yaml ``` -安装过程中会提示用户输入数据库初始用户的密码,请用户自行记录并安全保存。PTK 自动完成所有安装操作后,会启动数据库实例。 +默认会安装当前已经正式发布的 MogDB 最新版本,版本号可以在 MogDB 官网下载页面查询。安装过程中会提示用户输入数据库初始用户的密码,请用户自行记录并安全保存。PTK 自动完成所有安装操作后,会启动数据库实例。 + +PTK 也支持自定义安装包,可以通过手工下载安装包,指定安装。比如执行以下命令,将使用当前目录下的该安装包进行数据库安装。 + +```shell +ptk install -f config.yaml --pkg ./MogDB-3.0.0-openEuler-arm64.tar.gz +``` 安装成功后,可以通过 `ptk ls` 来查看安装的实例信息。 ### 3. 访问数据库 ``` -$ su - omm -$ gsql -d postgres -p 26000 +su - omm +gsql -d postgres -p 26000 ``` ## 探索更多 diff --git a/product/zh/docs-ptk/v0.1/usage.md b/product/zh/docs-ptk/v0.1/usage.md index 31fa2e4b..794e21bd 100644 --- a/product/zh/docs-ptk/v0.1/usage.md +++ b/product/zh/docs-ptk/v0.1/usage.md @@ -56,6 +56,7 @@ Use "ptk [command] --help" for more information about a command. | 命令 | 用途 | | ----------- | -------------------------------------------- | | `checkos` | 检查要安装的服务器环境是否满足安装需求 | +| `candidate` | PTK 支持的不同软件版本 | | `template` | 安装配置模板,支持交互式创建模块 | | `encrypt` | 加密给定字符串(用于加密密码后写入配置文件) | | `install` | 安装数据库集群 | @@ -66,7 +67,7 @@ Use "ptk [command] --help" for more information about a command. | `restart` | 重启数据库集群或指定实例 | | `status` | 显示数据库集群或指定实例的运行状态 | | `env` | 显示 PTK 支持的环境变量列表 | -| `gen-xml` | 兼容从 PTK 配置文件直接生成适用于 gs_om 的 XML 文件 | +| `gen-om-xml` | 生成适用于 gs_om 的 XML 配置文件 | | `self` | PTK 自身操作 | | `completion` | 生成不同 SHELL 的自动补全脚本 | @@ -158,6 +159,7 @@ PTK 安装指令提供了 `--db-version` 参数,来允许用户指定要安装 - `--launch-db-timeout`: 启动数据库超时时间,默认 5 分钟。 - `--pre-run`: 支持添加安装前的一个钩子 shell 脚本路径,在集群安装前,自动在集群内所有机器上执行指定的脚本 - `--post-run`: 支持添加安装后的一个钩子 shell 脚本路径,在集群安装成功后,自动在集群内所有机器上执行指定的脚本 +- `--skip-check-os`: 跳过系统检查 - `--skip-check-distro` : 跳过系统发行版检查,直接安装 - `--skip-create-user`: PTK 默认会自动创建用户,指定该参数可以跳过创建用户,当指定该参数时,服务器上用户必须已经存在 - `--skip-launch-db`: 安装完成后不启动数据库 -- Gitee