diff --git a/product/en/docs-ptk/v2.0/toc.md b/product/en/docs-ptk/v2.0/toc.md new file mode 100644 index 0000000000000000000000000000000000000000..1fdd6fa7c3982154b7f5354676d2723feff412f3 --- /dev/null +++ b/product/en/docs-ptk/v2.0/toc.md @@ -0,0 +1,159 @@ + + +# 文档 + +## PTK 文档目录 + ++ [关于PTK](./about.md) ++ 快速入门 + + [安装PTK](./quick-start/install-ptk.md) + + [部署示例数据库](./quick-start/ptk-demo.md) ++ 使用指南 + + [准备配置文件](./guide/guide-prepare-config.md) + + [检查系统环境](./guide/guide-checkos.md) + + [部署数据库集群](./guide/guide-install-cluster.md) + + 管理数据库集群 + + [查看集群列表](./guide/manage-cluster/manage-cluster-list-clusters.md) + + [查看集群状态](./guide/manage-cluster/manage-cluster-status.md) + + [启动数据库](./guide/manage-cluster/manage-cluster-start-db.md) + + [停止数据库](./guide/manage-cluster/manage-cluster-stop-db.md) + + [重启数据库](./guide/manage-cluster/manage-cluster-restart-db.md) + + [重建数据库](./guide/manage-cluster/manage-cluster-build-db.md) + + [主备倒换](./guide/manage-cluster/manage-cluster-switchover.md) + + [故障切换](./guide/manage-cluster/manage-cluster-failover.md) + + [查看数据库插件](./guide/manage-cluster/manage-cluster-list-plugins.md) + + [安装数据库插件](./guide/manage-cluster/manage-cluster-install-plugin.md) + + [升级数据库](./guide/manage-cluster/manage-cluster-upgrade.md) + + [数据库集群扩容](./guide/manage-cluster/manage-cluster-scale-out.md) + + [数据库集群缩容](./guide/manage-cluster/manage-cluster-scale-in.md) + + [查看数据库hba](./guide/manage-cluster/manage-cluster-show-hba.md) + + [新增数据库hba](./guide/manage-cluster/manage-cluster-set-hba.md) + + [查看数据库参数](./guide/manage-cluster/manage-cluster-show-guc.md) + + [设置数据库参数](./guide/manage-cluster/manage-cluster-set-guc.md) + + [查看集群拓扑配置](./guide/manage-cluster/manage-cluster-show-config.md) + + [查看集群元信息](./guide/manage-cluster/manage-cluster-inspect.md) + + [更新集群备注](./guide/manage-cluster/manage-cluster-modify-comment.md) + + [更换数据库IP](./guide/manage-cluster/manage-cluster-refresh.md) + + [变更数据库角色](./guide/manage-cluster/manage-cluster-role-change.md) + + [安装CM组件](./guide/manage-cluster/manage-cluster-install-cm.md) + + [卸载CM组件](./guide/manage-cluster/manage-cluster-uninstall-cm.md) + + [管理虚拟IP](./guide/manage-cluster/manage-cluster-vip.md) + + [安装MogHA服务](./guide/manage-cluster/manage-cluster-install-mogha.md) + + [卸载MogHA服务](./guide/manage-cluster/manage-cluster-uninstall-mogha.md) + + [集群重命名](./guide/manage-cluster/manage-cluster-rename-cluster.md) + + [创建空集群](./guide/manage-cluster/manage-cluster-init-empty-clsuter.md) + + [抛弃节点](./guide/manage-cluster/manage-cluster-throwout.md) + + [接管节点](./guide/manage-cluster/manage-cluster-takeover.md) + + [纳管数据库集群](./guide/manage-cluster/manage-cluster-manage.md) + + [卸载数据库集群](./guide/guide-uninstall-cluster.md) + + [收集运行环境信息](./guide/guide-collectos.md) + + [下载MogDB安装包](./guide/guide-download-package.md) + + [加密敏感信息](./guide/guide-encrypt.md) + + [PTK自升级](./guide/guide-self-upgrade.md) + + [PTKC工具](./guide/guide-ptkc-tool.md) ++ 使用参考 + + [环境变量](./reference/ref-environment.md) + + [元数据](./reference/ref-metadata.md) + + [配置文件](./reference/ref-topoconfig.md) + + [数据库推荐参数](./reference/ref-recommend-guc.md) + + [对MogDB版本的支持](./reference/ref-support-mogdb.md) ++ [配置文件示例](./samples/samples-index.md) + + [本地单实例](./samples/samples-local.md) + + [远程单实例](./samples/samples-remote-single.md) + + [主备集群](./samples/samples-db-cluster.md) + + [双网段](./samples/samples-double-ip.md) + + [资源池化](./samples/samples-dss-cluster.md) ++ 命令介绍 + + [ptk](./commands/ptk.md) + + [ptk completion](./commands/ptk-completion.md) + + [ptk completion powershell](./commands/ptk-completion-powershell.md) + + [ptk completion fish](./commands/ptk-completion-fish.md) + + [ptk completion zsh](./commands/ptk-completion-zsh.md) + + [ptk completion bash](./commands/ptk-completion-bash.md) + + [ptk register](./commands/ptk-register.md) + + [ptk init-cluster](./commands/ptk-init-cluster.md) + + [ptk collect](./commands/ptk-collect.md) + + [ptk rec-guc](./commands/ptk-rec-guc.md) + + [ptk cache](./commands/ptk-cache.md) + + [ptk gen-ptkc](./commands/ptk-gen-ptkc.md) + + [ptk manage](./commands/ptk-manage.md) + + [ptk demo](./commands/ptk-demo.md) + + [ptk meta](./commands/ptk-meta.md) + + [ptk meta merge](./commands/ptk-meta-merge.md) + + [ptk meta dump](./commands/ptk-meta-dump.md) + + [ptk meta prune](./commands/ptk-meta-prune.md) + + [ptk meta home](./commands/ptk-meta-home.md) + + [ptk version](./commands/ptk-version.md) + + [ptk self](./commands/ptk-self.md) + + [ptk self upgrade](./commands/ptk-self-upgrade.md) + + [ptk gen-om-xml](./commands/ptk-gen-om-xml.md) + + [ptk env](./commands/ptk-env.md) + + [ptk gen-static-config](./commands/ptk-gen-static-config.md) + + [ptk cluster](./commands/ptk-cluster.md) + + [ptk cluster rename](./commands/ptk-cluster-rename.md) + + [ptk cluster throwout](./commands/ptk-cluster-throwout.md) + + [ptk cluster takeover](./commands/ptk-cluster-takeover.md) + + [ptk cluster uninstall-cm](./commands/ptk-cluster-uninstall-cm.md) + + [ptk cluster install-cm](./commands/ptk-cluster-install-cm.md) + + [ptk cluster gen-cert-files](./commands/ptk-cluster-gen-cert-files.md) + + [ptk cluster load-cm-vip](./commands/ptk-cluster-load-cm-vip.md) + + [ptk cluster del-kerberos-auth](./commands/ptk-cluster-del-kerberos-auth.md) + + [ptk cluster add-kerberos-auth](./commands/ptk-cluster-add-kerberos-auth.md) + + [ptk cluster uninstall-kerberos-server](./commands/ptk-cluster-uninstall-kerberos-server.md) + + [ptk cluster install-kerberos-server](./commands/ptk-cluster-install-kerberos-server.md) + + [ptk cluster is-in-upgrade](./commands/ptk-cluster-is-in-upgrade.md) + + [ptk cluster upgrade-rollback](./commands/ptk-cluster-upgrade-rollback.md) + + [ptk cluster upgrade-commit](./commands/ptk-cluster-upgrade-commit.md) + + [ptk cluster upgrade](./commands/ptk-cluster-upgrade.md) + + [ptk cluster demote](./commands/ptk-cluster-demote.md) + + [ptk cluster promote](./commands/ptk-cluster-promote.md) + + [ptk cluster refresh](./commands/ptk-cluster-refresh.md) + + [ptk cluster shell](./commands/ptk-cluster-shell.md) + + [ptk cluster modify-comment](./commands/ptk-cluster-modify-comment.md) + + [ptk cluster show-config](./commands/ptk-cluster-show-config.md) + + [ptk cluster set-guc](./commands/ptk-cluster-set-guc.md) + + [ptk cluster show-guc](./commands/ptk-cluster-show-guc.md) + + [ptk cluster set-hba](./commands/ptk-cluster-set-hba.md) + + [ptk cluster show-hba](./commands/ptk-cluster-show-hba.md) + + [ptk cluster scale-out](./commands/ptk-cluster-scale-out.md) + + [ptk cluster scale-in](./commands/ptk-cluster-scale-in.md) + + [ptk cluster uninstall-mogha](./commands/ptk-cluster-uninstall-mogha.md) + + [ptk cluster install-mogha](./commands/ptk-cluster-install-mogha.md) + + [ptk cluster list-plugins](./commands/ptk-cluster-list-plugins.md) + + [ptk cluster install-plugin](./commands/ptk-cluster-install-plugin.md) + + [ptk cluster inspect](./commands/ptk-cluster-inspect.md) + + [ptk cluster failover](./commands/ptk-cluster-failover.md) + + [ptk cluster switchover](./commands/ptk-cluster-switchover.md) + + [ptk cluster build](./commands/ptk-cluster-build.md) + + [ptk cluster status](./commands/ptk-cluster-status.md) + + [ptk cluster restart](./commands/ptk-cluster-restart.md) + + [ptk cluster stop](./commands/ptk-cluster-stop.md) + + [ptk cluster start](./commands/ptk-cluster-start.md) + + [ptk uninstall](./commands/ptk-uninstall.md) + + [ptk ls](./commands/ptk-ls.md) + + [ptk install](./commands/ptk-install.md) + + [ptk exec](./commands/ptk-exec.md) + + [ptk template](./commands/ptk-template.md) + + [ptk template scale-out](./commands/ptk-template-scale-out.md) + + [ptk template mogha](./commands/ptk-template-mogha.md) + + [ptk template create](./commands/ptk-template-create.md) + + [ptk encrypt](./commands/ptk-encrypt.md) + + [ptk checkos](./commands/ptk-checkos.md) + + [ptk download](./commands/ptk-download.md) + + [ptk candidate](./commands/ptk-candidate.md) + + [ptk candidate plugin](./commands/ptk-candidate-plugin.md) + + [ptk candidate cpu](./commands/ptk-candidate-cpu.md) + + [ptk candidate os](./commands/ptk-candidate-os.md) + + [ptk candidate db](./commands/ptk-candidate-db.md) ++ [故障排查](./debug.md) ++ [FAQ](./faq.md) ++ [发布记录](./release-notes/release.md) + + [v1.5](./release-notes/release-15x.md) + + [v1.4](./release-notes/release-14x.md) + + [v1.3](./release-notes/release-13x.md) + + [v1.2](./release-notes/release-12x.md) + + [v1.1](./release-notes/release-11x.md) + + [v1.0](./release-notes/release-10x.md) + + [v0.x](./release-notes/release-0xx.md) ++ [社区](https://www.modb.pro/search?query=ptk) ++ [附录:YAML语法](./appendix/yaml-grammar.md) \ No newline at end of file diff --git a/product/zh/docs-ptk/v1.1/install.md b/product/zh/docs-ptk/v1.1/install.md index c82e3a8e3318acc749f00f746c3a53065e5a4ce2..ed88d267a13da52943cf7345936e11bd519d8c01 100644 --- a/product/zh/docs-ptk/v1.1/install.md +++ b/product/zh/docs-ptk/v1.1/install.md @@ -43,7 +43,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install. ``` mkdir -p $HOME/.ptk/bin/ -tar -xvf -c $HOME/.ptk/bin/ +tar -xvf -C $HOME/.ptk/bin/ echo 'export PATH=$HOME/.ptk/bin:$PATH' >> ~/.bashrc source ~/.bashrc ``` diff --git a/product/zh/docs-ptk/v2.0/appendix/yaml-grammar.md b/product/zh/docs-ptk/v2.0/appendix/yaml-grammar.md new file mode 100644 index 0000000000000000000000000000000000000000..489d1e7dfc440b8a54542c343751d716f1b9d38b --- /dev/null +++ b/product/zh/docs-ptk/v2.0/appendix/yaml-grammar.md @@ -0,0 +1,231 @@ +--- +title: 附录:YAML语法 +summary: 详细描述了YAML规范以及如何应用于PTK +author: Yao Qian +date: 2022-09-16 +--- + +# 附录:YAML语法 + +PTK 采用 YAML 格式的配置文件,主要是因为语法简洁直观,数据结构方面的表达能力强,并且便于搭配注释进行描述。 + +> 注意:YAML 特点是使用空格来表达层次结构,所以在编写配置时需要注意缩进层次 + +本文就主要介绍 YAML 的语法,来帮助用户可以更好的理解 PTK 的配置文件格式。 + +## 标量和集合 + +根据 [YAML 规范](https://yaml.org/spec/1.2/spec.html),有两种集合类型和很多标量类型。 + +两种集合类型是 map (字典)和 sequence (列表): + +```yaml +map: + one: 1 + two: 2 + three: 3 + +sequence: + - one + - two + - three +``` + +标量值是单个值,(与集合相反) + +## YAML中的标量类型 + +如果整型或浮点型数字没有引号,通常被视为数字类型: + +```yaml +count: 1 +size: 2.34 +``` + +但是如果被引号引起来,会被当做字符串: + +```yaml +count: "1" # <-- string, not int +size: '2.34' # <-- string, not float +``` + +布尔函数也是如此: + +```yaml +isGood: true # bool +answer: "true" # string +``` + +空字符串是 `null` (不是 `nil`)。 + +注意 `port: "80"`是合法的YAML,可以通过模板引擎和YAML解释器传值,但是如果PTK希望`port`是整型,就会失败。 + +在一些场景中,可以使用YAML节点标签强制推断特定类型: + +```yaml +coffee: "yes, please" +age: !!str 21 +port: !!int "80" +``` + +如上所示,`!!str`告诉解释器`age`是一个字符串,即使它看起来像是整型。即使`port`被引号括起来,也会被视为int。 + +## YAML中的字符串 + +YAML中的大多数数据都是字符串。YAML有多种表示字符串的方法。本节解释这些方法并演示如何使用其中一些方法。 + +有三种单行方式声明一个字符串: + +```yaml +way1: bare words +way2: "double-quoted strings" +way3: 'single-quoted strings' +``` + +单行样式必须在一行: + +- 裸字没有引号,也没有转义,因此,必须小心使用字符。 +- 双引号字符串可以使用`\`转义指定字符。比如,`"\"Hello\", she said"`。可以使用`\n`转义换行。 +- 单引号字符串是字面意义的字符串,不用`\`转义,只有单引号`''`需要转义,转成单个`'`。 + +除了单行字符串,可以声明多行字符串: + +```yaml +coffee: | + Latte + Cappuccino + Espresso +``` + +上述会被当作`coffee`的字符串值,等同于`Latte\nCappuccino\nEspresso\n`。 + +注意在第一行`|`后面必须正确缩进。可以这样破坏上述示例: + +```yaml +coffee: | + Latte + Cappuccino + Espresso + +``` + +由于`Latte`没有正确缩进,会遇到这样的错误: + +```shell +Error parsing file: error converting YAML to JSON: yaml: line 7: did not find expected key +``` + +模板中,有时候为了避免上述错误,在多行文本中添加一个假的“第一行”会更加安全: + +```yaml +coffee: | + # Commented first line + Latte + Cappuccino + Espresso + +``` + +注意无论第一行是什么,都会保存在字符串的输出中。比如你要这样把文件内容注入到配置映射中,注释应该是读取该条目需要的类型。 + +### 控制多行字符串中的空格 + +在上述示例中,使用了 `|` 来表示多行字符串。但是注意字符串后面有一个尾随的`\n`。如果需要YAML处理器去掉末尾的换行符,在`|` +后面添加`-`: + +```yaml +coffee: |- + Latte + Cappuccino + Espresso +``` + +现在 `coffee`的值变成了: `Latte\nCappuccino\nEspresso` (没有末尾的`\n`)。 + +其他时候,可能希望保留尾随空格。可以使用 `|+`符号: + +```yaml +coffee: |+ + Latte + Cappuccino + Espresso + + +another: value +``` + +现在`coffee`的值是 `Latte\nCappuccino\nEspresso\n\n\n`。 + +文本块中的缩进会被保留,也会保留换行符: + +```yaml +coffee: |- + Latte + 12 oz + 16 oz + Cappuccino + Espresso +``` + +上述示例中,`coffee`会变成 `Latte\n 12 oz\n 16 oz\nCappuccino\nEspresso`。 + +### 折叠多行字符串 + +有时您想在 YAML 中用多行表示一个字符串,但希望在解释时将其视为一个长行。这被称为"折叠"。要声明一个折叠块,使用 `>` 代替 `|`: + +```yaml +coffee: > + Latte + Cappuccino + Espresso + + +``` + +上面`coffee`的值是: `Latte Cappuccino Espresso\n`。 注意,除了最后一个换行符之外,所有的换行符都将转换成空格。 +可以组合空格控制符和折叠字符标记 `>-` 来替换或取消所有的新行。 + +注意在折叠语法中,缩进文本将导致保留行。 + +```yaml +coffee: >- + Latte + 12 oz + 16 oz + Cappuccino + Espresso +``` + +上述结果为:`Latte\n 12 oz\n 16 oz\nCappuccino Espresso`。注意空格和换行都保存下来了。 + +## YAML是JSON的超集 + +由于YAML是一个JSON的超集,任何合法的JSON文档 _都应该_ 是合法的YAML。 + +```json +{ + "coffee": "yes, please", + "coffees": [ + "Latte", "Cappuccino", "Espresso" + ] +} +``` + +上述json的另一种表述方式是: + +```yaml +coffee: yes, please +coffees: +- Latte +- Cappuccino +- Espresso +``` + +而且两种可以混合(要小心): + +```yaml +coffee: "yes, please" +coffees: [ "Latte", "Cappuccino", "Espresso"] +``` + +所有这三个都应该解析为相同的内部表示形式。 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cache.md b/product/zh/docs-ptk/v2.0/commands/ptk-cache.md new file mode 100644 index 0000000000000000000000000000000000000000..27aaedebe2d582faffb1152a90b8762eee144c4a --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cache.md @@ -0,0 +1,98 @@ +--- +title: dist/docs/commands/ptk-cache.md +summary: dist/docs/commands/ptk-cache.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cache + +列出缓存文件 + +## 语法 + +```bash +ptk cache [flags] +``` + +## 示例 + +```bash +# 打印缓存文件列表 +ptk cache + +# 清楚所有缓存文件 +ptk cache --clear +``` + +## 选项 + +### --clear + +* 说明: 清除所有缓存文件 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.0.0 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-candidate-cpu.md b/product/zh/docs-ptk/v2.0/commands/ptk-candidate-cpu.md new file mode 100644 index 0000000000000000000000000000000000000000..80333f7e6d8810537183c281631846de140b9532 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-candidate-cpu.md @@ -0,0 +1,86 @@ +--- +title: dist/docs/commands/ptk-candidate-cpu.md +summary: dist/docs/commands/ptk-candidate-cpu.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk candidate cpu + +列出支持的 CPU 列表 + +## 语法 + +```bash +ptk candidate cpu [flags] +``` + +## 示例 + +```bash +ptk candidate cpu +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk candidate](./ptk-candidate.md) - 打印 PTK 支持的软件版本列表 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-candidate-db.md b/product/zh/docs-ptk/v2.0/commands/ptk-candidate-db.md new file mode 100644 index 0000000000000000000000000000000000000000..b32de00f536c7e01fb63afcf97976f72330f630e --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-candidate-db.md @@ -0,0 +1,86 @@ +--- +title: dist/docs/commands/ptk-candidate-db.md +summary: dist/docs/commands/ptk-candidate-db.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk candidate db + +列出支持的数据库版本 + +## 语法 + +```bash +ptk candidate db [flags] +``` + +## 示例 + +```bash +ptk candidate db +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk candidate](./ptk-candidate.md) - 打印 PTK 支持的软件版本列表 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-candidate-os.md b/product/zh/docs-ptk/v2.0/commands/ptk-candidate-os.md new file mode 100644 index 0000000000000000000000000000000000000000..0290e4a196b983ce5f30436132238947cf5ff198 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-candidate-os.md @@ -0,0 +1,100 @@ +--- +title: dist/docs/commands/ptk-candidate-os.md +summary: dist/docs/commands/ptk-candidate-os.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk candidate os + +列出支持安装 MogDB 的操作系统 + +## 语法 + +```bash +ptk candidate os [flags] +``` + +## 示例 + +```bash +ptk candidate os [--arm64] [--x86_64] +``` + +## 选项 + +### --arm64 + +* 说明: Only print arm64 OS list +* 数据类型: bool +* 默认值: false + +### --x86_64 + +* 说明: Only print x86_64 OS list +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk candidate](./ptk-candidate.md) - 打印 PTK 支持的软件版本列表 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-candidate-plugin.md b/product/zh/docs-ptk/v2.0/commands/ptk-candidate-plugin.md new file mode 100644 index 0000000000000000000000000000000000000000..9ba22f800ce57dc2fae7a40fa23b41c08d236714 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-candidate-plugin.md @@ -0,0 +1,101 @@ +--- +title: dist/docs/commands/ptk-candidate-plugin.md +summary: dist/docs/commands/ptk-candidate-plugin.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk candidate plugin + +列出 MogDB 支持的插件 + +## 语法 + +```bash +ptk candidate plugin [flags] +``` + +## 示例 + +```bash +ptk candidate plugin [-t] +``` + +## 选项 + +### --db-version string + +* 说明: Query plugins of a fixed version +This flag only support MogDB +* 数据类型: string +* 默认值: "" + +### -t, --transpose + +* 说明: 转置列表 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.0.0 + +## 另请参阅 + +* [ptk candidate](./ptk-candidate.md) - 打印 PTK 支持的软件版本列表 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-candidate.md b/product/zh/docs-ptk/v2.0/commands/ptk-candidate.md new file mode 100644 index 0000000000000000000000000000000000000000..96c5be012e0472491c5d43b6506cb59a1388d641 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-candidate.md @@ -0,0 +1,84 @@ +--- +title: dist/docs/commands/ptk-candidate.md +summary: dist/docs/commands/ptk-candidate.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk candidate + +打印 PTK 支持的软件版本列表 + +## 语法 + +```bash +ptk candidate [flags] +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB +* [ptk candidate cpu](./ptk-candidate-cpu.md) - 列出支持的 CPU 列表 +* [ptk candidate db](./ptk-candidate-db.md) - 列出支持的数据库版本 +* [ptk candidate os](./ptk-candidate-os.md) - 列出支持安装 MogDB 的操作系统 +* [ptk candidate plugin](./ptk-candidate-plugin.md) - 列出 MogDB 支持的插件 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-checkos.md b/product/zh/docs-ptk/v2.0/commands/ptk-checkos.md new file mode 100644 index 0000000000000000000000000000000000000000..bd9eb50134a645016e1ec27fe4dd09bde816e626 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-checkos.md @@ -0,0 +1,160 @@ +--- +title: dist/docs/commands/ptk-checkos.md +summary: dist/docs/commands/ptk-checkos.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk checkos + +检查集群服务器系统依赖是否满足安装数据库需求 + +## 说明 + +Check cluster servers os dependencies. +To check all items, enter "-i A". +To check multiple status, enter the items in the following format: "-i A1,A2,A3". +Item number description: + 'A1':[ OS version status ] + 'A2':[ Kernel version status ] + 'A3':[ Unicode status ] + 'A4':[ Time zone status ] + 'A5':[ Swap memory status ] + 'A6':[ System control parameters ] + 'A7':[ File system configuration status ] + 'A8':[ Disk configuration status ] + 'A9':[ Pre-read block size status ] + 'A10':[ IO scheduler status ] + 'A11':[ Network card status ] + 'A12':[ Time consistency status ] + 'A13':[ Firewall service status ] + 'A14':[ THP service status ] + 'A15':[ System dependency packages ] + 'A16':[ CPU Instruction Set ] + 'A17':[ Port status ] + 'A18':[ Selinux status ] + 'A19':[ User ulimit config ] + +## 语法 + +```bash +ptk checkos [flags] +``` + +## 示例 + +```bash +# 检查当前主机 +ptk checkos + +# 检查特定的项目,并展示详细信息 +ptk checkos -i A1,A2,A3 --detail + +# 通过指定 config.yaml 来检查集群的机器,并且仅显示 abormal 的详细信息 +ptk checkos -f config.yaml --only-abnormal-detail + +# 通过指定 config.yaml 来检查集群的机器,同时在生成修复命令时包含 warning 级别的修复命令 +ptk checkos -f config.yaml --gen-warning-fix +``` + +## 选项 + +### --detail + +* 说明: 打印每个检查项的详细信息 +* 数据类型: bool +* 默认值: false + +### -f, --file string + +* 说明: 指定集群配置文件 +* 数据类型: string +* 默认值: "" + +### --gen-warning-fix + +* 说明: 输出 abnormal 和 warning 项目的修复语句,默认仅输出 abnormal 的项目修复语句 +* 数据类型: bool +* 默认值: false + +### -i, --item string + +* 说明: 指定检查项编号, 多个编号间使用英文逗号分隔 +* 数据类型: string +* 默认值: "A" + +### --only-abnormal-detail + +* 说明: 仅显示 Abnormal 级别的信息 +* 数据类型: bool +* 默认值: false + +### -o, --output string + +* 说明: 指定输出文件名 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.1 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-add-kerberos-auth.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-add-kerberos-auth.md new file mode 100644 index 0000000000000000000000000000000000000000..6ab8124732229317f6505b4e94040137fd6e91f4 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-add-kerberos-auth.md @@ -0,0 +1,118 @@ +--- +title: dist/docs/commands/ptk-cluster-add-kerberos-auth.md +summary: dist/docs/commands/ptk-cluster-add-kerberos-auth.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster add-kerberos-auth + +添加 kerberos 认证 + +## 语法 + +```bash +ptk cluster add-kerberos-auth [flags] +``` + +## 示例 + +```bash +ptk cluster -n add-kerberos-auth --keytab 192.168.1.100:/path/to/keytab -H [-H ] +``` + +## 选项 + +### -H, --host stringArray + +* 说明: 数据库实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 数据库实例 ID +* 数据类型: ints +* 默认值: [] + +### --keytab string + +* 说明: Keytab 路径, 支持远程文件路径, 如: --keytab 10.0.0.1:/home/omm/keytab +* 数据类型: string +* 默认值: "" + +### --skip-rollback + +* 说明: 当错误或进程中断时,跳过回滚 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.0.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-build.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-build.md new file mode 100644 index 0000000000000000000000000000000000000000..664e70e6b62eea1ddf16742692c32e7151d9ffb5 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-build.md @@ -0,0 +1,120 @@ +--- +title: dist/docs/commands/ptk-cluster-build.md +summary: dist/docs/commands/ptk-cluster-build.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster build + +重建数据库数据 + +## 语法 + +```bash +ptk cluster build [flags] +``` + +## 示例 + +```bash +# 通过 IP 重建指定实例 +ptk cluster -n build -H + +# 通过 ID 重建指定实例 +ptk cluster -n build -i + +# 指定从集群内哪个实例来重建目标实例的数据 +# 数据源实例可以是集群中的任何实例 +ptk cluster -n build -H --build-from +``` + +## 选项 + +### --build-from string + +* 说明: 用于构建的上游数据库实例的 IP +* 数据类型: string +* 默认值: "" + +### -H, --host stringArray + +* 说明: 数据库实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 数据库实例 ID +* 数据类型: ints +* 默认值: [] + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.6 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-del-kerberos-auth.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-del-kerberos-auth.md new file mode 100644 index 0000000000000000000000000000000000000000..fab66d30bf12a0f3c105be5d8ef53ba5f2f69603 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-del-kerberos-auth.md @@ -0,0 +1,106 @@ +--- +title: dist/docs/commands/ptk-cluster-del-kerberos-auth.md +summary: dist/docs/commands/ptk-cluster-del-kerberos-auth.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster del-kerberos-auth + +删除 kerberos 认证 + +## 语法 + +```bash +ptk cluster del-kerberos-auth [flags] +``` + +## 示例 + +```bash +ptk cluster -n del-kerberos-auth -H [-H ] +``` + +## 选项 + +### -H, --host stringArray + +* 说明: 数据库实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 数据库实例 ID +* 数据类型: ints +* 默认值: [] + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.0.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-demote.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-demote.md new file mode 100644 index 0000000000000000000000000000000000000000..283f47244fe9682925f294777b8d7ce10ca1f202 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-demote.md @@ -0,0 +1,117 @@ +--- +title: dist/docs/commands/ptk-cluster-demote.md +summary: dist/docs/commands/ptk-cluster-demote.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster demote + +将数据库角色从 Primary 降级为 Standby,或从 Standby 降级为 Cascade Standby + +## 语法 + +```bash +ptk cluster demote [flags] +``` + +## 示例 + +```bash +ptk cluster -n demote -H +ptk cluster -n demote -i + +# 如果指定的实例原本是个备库,其降级后会成为级联备 +# 那么还必须通过 '--upstream' 参数指定上游备库的 IP +ptk cluster -n demote --upstream +``` + +## 选项 + +### -H, --host string + +* 说明: 要降级的数据库实例的 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 要降级的数据库实例的 ID +* 数据类型: int +* 默认值: 0 + +### --upstream string + +* 说明: 上游数据库 IP +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.7 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-failover.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-failover.md new file mode 100644 index 0000000000000000000000000000000000000000..aa84079aeeffc4a2b642c55264174d4c9eeffb12 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-failover.md @@ -0,0 +1,107 @@ +--- +title: dist/docs/commands/ptk-cluster-failover.md +summary: dist/docs/commands/ptk-cluster-failover.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster failover + +提升一个备库为主库 + +## 语法 + +```bash +ptk cluster failover [flags] +``` + +## 示例 + +```bash +ptk cluster -n failover -H +ptk cluster -n failover -i +``` + +## 选项 + +### -H, --host string + +* 说明: 要进行故障转移的数据库实例的 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 要进行故障转移的数据库实例的 ID +* 数据类型: int +* 默认值: 0 + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-gen-cert-files.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-gen-cert-files.md new file mode 100644 index 0000000000000000000000000000000000000000..973866aeaee6318971487e44c34c82413470366b --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-gen-cert-files.md @@ -0,0 +1,92 @@ +--- +title: dist/docs/commands/ptk-cluster-gen-cert-files.md +summary: dist/docs/commands/ptk-cluster-gen-cert-files.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster gen-cert-files + +生成ssl证书文件 + +## 语法 + +```bash +ptk cluster gen-cert-files [flags] +``` + +## 示例 + +```bash +ptk cluster -n gen-cert-files +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.3.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-inspect.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-inspect.md new file mode 100644 index 0000000000000000000000000000000000000000..60a9e5483f20a6e1beac81aa687ca112540d2ab4 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-inspect.md @@ -0,0 +1,92 @@ +--- +title: dist/docs/commands/ptk-cluster-inspect.md +summary: dist/docs/commands/ptk-cluster-inspect.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster inspect + +返回关于集群的内部信息 + +## 语法 + +```bash +ptk cluster inspect [flags] +``` + +## 示例 + +```bash +ptk cluster -n insepect +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.8 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-cm.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-cm.md new file mode 100644 index 0000000000000000000000000000000000000000..b9f561032437b2d0368e5193375c6668ae7b8610 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-cm.md @@ -0,0 +1,156 @@ +--- +title: dist/docs/commands/ptk-cluster-install-cm.md +summary: dist/docs/commands/ptk-cluster-install-cm.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster install-cm + +安装 CM 组件 + +## 语法 + +```bash +ptk cluster install-cm [flags] +``` + +## 示例 + +```bash +ptk cluster -n install-cm [-p ] [--cmdir ] [--db-service-vip ] [-P ] [-s KEY=VALUE ...] [-a KEY=VALUE ...] +``` + +## 选项 + +### -a, --agent-conf strings + +* 说明: 自定义 cm_agent 配置 +格式: '-a KEY=VALUE' +* 数据类型: strings +* 默认值: [] + +### --cmdir string + +* 说明: 指定 CM 的安装目录 +* 数据类型: string +* 默认值: "" + +### --db-service-vip string + +* 说明: 指定虚拟IP +* 数据类型: string +* 默认值: "" + +### --not-limit-cm-nodes + +* 说明: 不限制CM节点的数量必须是奇数 +* 数据类型: bool +* 默认值: false + +### -p, --pkg string + +* 说明: 指定 CM 的安装包文件路径 +* 数据类型: string +* 默认值: "" + +### -P, --port int + +* 说明: 指定 CM server 进程的监听端口 +* 数据类型: int +* 默认值: 15300 + +### -s, --server-conf strings + +* 说明: 自定义 cm_server 配置 +格式: '-s KEY=VALUE' +* 数据类型: strings +* 默认值: [] + +### --skip-rollback + +* 说明: 安装失败时跳过回滚 +* 数据类型: bool +* 默认值: false + +### --skip-start + +* 说明: 跳过启动 CM server 服务 +* 数据类型: bool +* 默认值: false + +### -y, --yes + +* 说明: 对所有问题自动确认 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.4.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-kerberos-server.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-kerberos-server.md new file mode 100644 index 0000000000000000000000000000000000000000..5ba8c1967992fb93bf9a0b73e63e177f4bca40d8 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-kerberos-server.md @@ -0,0 +1,119 @@ +--- +title: dist/docs/commands/ptk-cluster-install-kerberos-server.md +summary: dist/docs/commands/ptk-cluster-install-kerberos-server.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster install-kerberos-server + +安装 kerberos 服务器 + +## 语法 + +```bash +ptk cluster install-kerberos-server [flags] +``` + +## 示例 + +```bash +ptk cluster -n install-kerberos-server -H [--kdc-port 8088] +ptk cluster -n install-kerberos-server -i [--kdc-port 8088] +``` + +## 选项 + +### -H, --host string + +* 说明: 数据库实例 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 数据库实例 ID +* 数据类型: int +* 默认值: 0 + +### -P, --kdc-port int + +* 说明: Kerberos服务器 kdc 端口 +* 数据类型: int +* 默认值: 8088 + +### --skip-rollback + +* 说明: 当错误或进程中断时,跳过回滚 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.0.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-mogha.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-mogha.md new file mode 100644 index 0000000000000000000000000000000000000000..24511a0a4f82b4018f766b8719025328e2531fe7 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-mogha.md @@ -0,0 +1,154 @@ +--- +title: dist/docs/commands/ptk-cluster-install-mogha.md +summary: dist/docs/commands/ptk-cluster-install-mogha.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster install-mogha + +为 MogDB 安装 MogHA + +## 语法 + +```bash +ptk cluster install-mogha [flags] +``` + +## 示例 + +```bash +ptk cluster -n install-mogha -c node.conf [-y] [-p ] [-d ] [--service-name mogha] [--mogha-version 2.4.17] +``` + +## 选项 + +### -y, --assumeyes + +* 说明: 自动对所有提问回复 Yes +* 数据类型: bool +* 默认值: false + +### -d, --install-dir string + +* 说明: 指定 MogHA 安装目录 +* 数据类型: string +* 默认值: "" + +### -p, --mogha-pkg string + +* 说明: 指定 MogHA 安装包 +* 数据类型: string +* 默认值: "" + +### --mogha-version string + +* 说明: 指定 MogHA 的版本 +* 数据类型: string +* 默认值: "2.4.20" + +### -c, --node-conf string + +* 说明: 指定 MogHA 配置文件路径 +* 数据类型: string +* 默认值: "" + +### --service-name string + +* 说明: 指定 MogHA 的服务名称 +* 数据类型: string +* 默认值: "mogha" + +### --skip-check + +* 说明: 跳过检查 node.conf 和目标机器 +* 数据类型: bool +* 默认值: false + +### --skip-rollback + +* 说明: 安装失败时,不进行回滚操作 +* 数据类型: bool +* 默认值: false + +### --skip-start + +* 说明: 无需启动 MogHA 服务 +* 数据类型: bool +* 默认值: false + +### --sync-standby string + +* 说明: 指定集群内的同步备库 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-plugin.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-plugin.md new file mode 100644 index 0000000000000000000000000000000000000000..a07c9731af9f02d45f4045fecd426c99bff71f63 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-install-plugin.md @@ -0,0 +1,131 @@ +--- +title: dist/docs/commands/ptk-cluster-install-plugin.md +summary: dist/docs/commands/ptk-cluster-install-plugin.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster install-plugin + +安装 MogDB 插件 + +## 语法 + +```bash +ptk cluster install-plugin [flags] +``` + +## 示例 + +```bash +# 默认情况下,将从网络下载与集群相同版本的所有插件 +ptk cluster -n install-plugin [--override] + +# 如果你想安装一个特定的插件,你可以通过 '-P' 指定插件名。 +ptk cluster -p install-plugin -P postgis -P wal2json + +# 如果你的主机不能访问互联网,您可以从本地的插件包 +ptk cluster -p install-plugin -p +``` + +## 选项 + +### -H, --host strings + +* 说明: 指定待安装的主机 IP, 默认将安装到集群中的所有主机 +* 数据类型: strings +* 默认值: [] + +### --override + +* 说明: 是否覆盖现有插件文件 +* 数据类型: bool +* 默认值: false + +### -p, --pkg string + +* 说明: 指定插件包路径 +* 数据类型: string +* 默认值: "" + +### -P, --plugin strings + +* 说明: 指定要安装的插件名称, 默认会安装所有插件 +* 数据类型: strings +* 默认值: [] + +### --skip-check-version + +* 说明: 不检查数据库版本是否和插件版本匹配 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.3 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-is-in-upgrade.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-is-in-upgrade.md new file mode 100644 index 0000000000000000000000000000000000000000..2930a28401b4abea523892ee36fa013d0ebc1cf0 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-is-in-upgrade.md @@ -0,0 +1,82 @@ +--- +title: dist/docs/commands/ptk-cluster-is-in-upgrade.md +summary: dist/docs/commands/ptk-cluster-is-in-upgrade.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster is-in-upgrade + +查看集群是否处于升级过程中 + +## 语法 + +```bash +ptk cluster is-in-upgrade [flags] +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-list-plugins.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-list-plugins.md new file mode 100644 index 0000000000000000000000000000000000000000..69fb4b7eab37973a803276d3c9884f74c1b2e1a6 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-list-plugins.md @@ -0,0 +1,100 @@ +--- +title: dist/docs/commands/ptk-cluster-list-plugins.md +summary: dist/docs/commands/ptk-cluster-list-plugins.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster list-plugins + +列出集群中的插件 + +## 语法 + +```bash +ptk cluster list-plugins [flags] +``` + +## 示例 + +```bash +ptk cluster -n list-plugins [-d ] +``` + +## 选项 + +### -d, --database stringArray + +* 说明: 显示数据库插件 +* 数据类型: stringArray +* 默认值: [] + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.0.1 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-load-cm-vip.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-load-cm-vip.md new file mode 100644 index 0000000000000000000000000000000000000000..2f30460e0b40de11308b3963766c93921be28616 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-load-cm-vip.md @@ -0,0 +1,106 @@ +--- +title: dist/docs/commands/ptk-cluster-load-cm-vip.md +summary: dist/docs/commands/ptk-cluster-load-cm-vip.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster load-cm-vip + +管理 CM 的虚拟IP (仅 Mogdb v5.0.4+ 支持) + +## 语法 + +```bash +ptk cluster load-cm-vip [flags] +``` + +## 示例 + +```bash +ptk cluster -n load-cm-vip --action [--vip ] +``` + +## 选项 + +### --action string + +* 说明: 指定脚本的操作,支持: [install, uninstall, refresh] +* 数据类型: string +* 默认值: "" + +### --vip string + +* 说明: 虚拟 IP +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.2.1 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-modify-comment.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-modify-comment.md new file mode 100644 index 0000000000000000000000000000000000000000..f6a81e537ef04f966b2684e5edeb47ffb9c4a1f7 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-modify-comment.md @@ -0,0 +1,100 @@ +--- +title: dist/docs/commands/ptk-cluster-modify-comment.md +summary: dist/docs/commands/ptk-cluster-modify-comment.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster modify-comment + +修改指定集群的备注 + +## 语法 + +```bash +ptk cluster modify-comment [flags] +``` + +## 示例 + +```bash +ptk cluster -n modify-comment --comment "some comment" +``` + +## 选项 + +### --comment string + +* 说明: 新备注信息 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-promote.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-promote.md new file mode 100644 index 0000000000000000000000000000000000000000..584deefa8b01607ecf516bd64eac960772086bba --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-promote.md @@ -0,0 +1,108 @@ +--- +title: dist/docs/commands/ptk-cluster-promote.md +summary: dist/docs/commands/ptk-cluster-promote.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster promote + +将一个数据库实例从备库提升为主库, 或从级联备库提升为备库 + +## 语法 + +```bash +ptk cluster promote [flags] +``` + +## 示例 + +```bash +ptk cluster -n promote -H +ptk cluster -n promote -i +``` + +## 选项 + +### -H, --host string + +* 说明: 指定要提升的实例的 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 指定要升级的实例ID +(如果同时给出 id 和 ip, 则优先使用 id) +* 数据类型: int +* 默认值: 0 + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.7 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-refresh.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-refresh.md new file mode 100644 index 0000000000000000000000000000000000000000..ecaaec56b2de51ff30b5dc00a4cc2f36a3908134 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-refresh.md @@ -0,0 +1,109 @@ +--- +title: dist/docs/commands/ptk-cluster-refresh.md +summary: dist/docs/commands/ptk-cluster-refresh.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster refresh + +更新集群配置 + +## 说明 + +Refresh the cluster configs which include cluster_static_config, postgresql.conf, pg_hba.conf and metadata of ptk. +It is usually used when the instance IP address is changed. + +## 语法 + +```bash +ptk cluster refresh [flags] +``` + +## 示例 + +```bash +# 仅刷新 cluster_static_config 文件 +ptk cluster -n refresh + +# 替换IP +ptk cluster -n refresh --replace-ip oldIP=newIP +``` + +## 选项 + +### --replace-ip stringArray + +* 说明: 替换指定IP, 值的格式为: old_ip=new_ip +* 数据类型: stringArray +* 默认值: [] + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-rename.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-rename.md new file mode 100644 index 0000000000000000000000000000000000000000..3f4e7d1cef7b272423b241b90f09f6c4daef7856 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-rename.md @@ -0,0 +1,103 @@ +--- +title: dist/docs/commands/ptk-cluster-rename.md +summary: dist/docs/commands/ptk-cluster-rename.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster rename + +Rename cluster + +## 语法 + +```bash +ptk cluster rename [flags] +``` + +## 示例 + +```bash +ptk cluster -n rename [-N|--new ] + +# You can rename cluster +ptk cluster -n rename -N +``` + +## 选项 + +### -N, --cluster-name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.5.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-restart.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-restart.md new file mode 100644 index 0000000000000000000000000000000000000000..dfa56ec2b39ff8c7b7fb3581f812cf6961fc3b83 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-restart.md @@ -0,0 +1,139 @@ +--- +title: dist/docs/commands/ptk-cluster-restart.md +summary: dist/docs/commands/ptk-cluster-restart.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster restart + +重启数据库实例或集群 + +## 语法 + +```bash +ptk cluster restart [flags] +``` + +## 示例 + +```bash +# 重启指定集群的所有实例 +ptk cluster -n restart + +# 重启集群内特定的实例 +ptk cluster -n restart -H +ptk cluster -n restart -i + +# [!危险] 重启 PTK 管理的所有集群 +ptk cluster restart --all +``` + +## 选项 + +### -a, --all + +* 说明: 重启所有集群 +* 数据类型: bool +* 默认值: false + +### -H, --host string + +* 说明: 数据库实例 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 数据库实例 ID +* 数据类型: int +* 默认值: 0 + +### -r, --role string + +* 说明: 指定数据库角色,仅当指定特定实例时生效 +可选项: [primary, standby, cascade_standby] +* 数据类型: string +* 默认值: "" + +### --security-mode + +* 说明: 是否以安全模式启动数据库 +* 数据类型: bool +* 默认值: false + +### --time-out duration + +* 说明: 启动超时时间 +* 数据类型: duration +* 默认值: 10m0s + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.1 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-scale-in.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-scale-in.md new file mode 100644 index 0000000000000000000000000000000000000000..a5022b7384cc480d37b2f2b6f0a6eeee07bf14a2 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-scale-in.md @@ -0,0 +1,139 @@ +--- +title: dist/docs/commands/ptk-cluster-scale-in.md +summary: dist/docs/commands/ptk-cluster-scale-in.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster scale-in + +对一个MogDB集群进行缩容 + +## 语法 + +```bash +ptk cluster scale-in [flags] +``` + +## 示例 + +```bash +ptk cluster -n scale-in -H -H [-y] + +# 缩容指定的数据库实例,但不删除操作系统用户 +ptk cluster -n scale-in -H --skip-clear-user + +# 缩容指定的数据库实例,但不删除数据库的数据 +ptk cluster -n scale-in -H --skip-clear-db + +# 如果目标数据库实例不可访问,可以强制踢出集群 +ptk cluster -n scale-in -H --force +``` + +## 选项 + +### -y, --assumeyes + +* 说明: 自动对所有提问回复 Yes +* 数据类型: bool +* 默认值: false + +### --force + +* 说明: 如果无法通过 ssh 连接目标主机,强制从集群升级节点的配置中删除目标实例 +* 数据类型: bool +* 默认值: false + +### -H, --host stringArray + +* 说明: 缩容的目标主机 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 缩容目标主机 ID +* 数据类型: ints +* 默认值: [] + +### --skip-clear-db + +* 说明: 不清除目标数据库的目录 +* 数据类型: bool +* 默认值: false + +### --skip-clear-user + +* 说明: 不删除目标数据库的系统用户 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.3 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-scale-out.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-scale-out.md new file mode 100644 index 0000000000000000000000000000000000000000..633cdac2796b12a982ef801cf1cc0164336cbcba --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-scale-out.md @@ -0,0 +1,164 @@ +--- +title: dist/docs/commands/ptk-cluster-scale-out.md +summary: dist/docs/commands/ptk-cluster-scale-out.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster scale-out + +对一个MogDB集群进行扩容 + +## 语法 + +```bash +ptk cluster scale-out [flags] +``` + +## 示例 + +```bash +ptk cluster -n scale-out -c scale-out.yaml + +# 你也可以使用 '--build-from' 来指定新的数据库实例从哪个现有实例中重建数据。 +ptk cluster -n scale-out -c scale-out.yaml --build-from +``` + +## 选项 + +### -y, --assumeyes + +* 说明: 自动对所有提问回复 Yes +* 数据类型: bool +* 默认值: false + +### --build-from string + +* 说明: 指定已存在的实例 IP 用于构建新的实例 +* 数据类型: string +* 默认值: "" + +### -c, --config string + +* 说明: 扩缩容配置文件路径 +* 数据类型: string +* 默认值: "" + +### --cpu string + +* 说明: 指定CPU型号名 +可通过 'ptk candidate cpu' 来查看支持的CPU型号名列表 +* 数据类型: string +* 默认值: "" + +### --default-guc + +* 说明: 不自动优化 GUC 参数,使用数据库默认参数 +* 数据类型: bool +* 默认值: false + +### --not-limit-cm-nodes + +* 说明: 不限制CM节点的数量必须是奇数 +* 数据类型: bool +* 默认值: false + +### --skip-check-distro + +* 说明: 跳过检查系统发行版 +* 数据类型: bool +* 默认值: false + +### --skip-check-os + +* 说明: 跳过系统检查 +* 数据类型: bool +* 默认值: false + +### --skip-create-user + +* 说明: 跳过创建用户 +* 数据类型: bool +* 默认值: false + +### --skip-gen-ptkc + +* 说明: 跳过生成 ptkc 工具 +* 数据类型: bool +* 默认值: false + +### --skip-rollback + +* 说明: 安装失败时,不进行回滚操作 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.3 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-set-guc.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-set-guc.md new file mode 100644 index 0000000000000000000000000000000000000000..803bd63bf927e86a61a4d922a70b2c8781f3bd5c --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-set-guc.md @@ -0,0 +1,113 @@ +--- +title: dist/docs/commands/ptk-cluster-set-guc.md +summary: dist/docs/commands/ptk-cluster-set-guc.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster set-guc + +设置并重新加载数据库参数 + +## 语法 + +```bash +ptk cluster set-guc [flags] +``` + +## 示例 + +```bash +ptk cluster -n set-guc -H -c "password_encryption_type=1" +ptk cluster -n set-guc -i -c "password_encryption_type=1" +``` + +## 选项 + +### -H, --host stringArray + +* 说明: 数据库实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 数据库实例 ID +* 数据类型: ints +* 默认值: [] + +### -c, --kv stringArray + +* 说明: 要设置的键值对 +* 数据类型: stringArray +* 默认值: [] + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.2.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-set-hba.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-set-hba.md new file mode 100644 index 0000000000000000000000000000000000000000..fbaf6950b37dcc438999c3ac06679fcc95941aaf --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-set-hba.md @@ -0,0 +1,113 @@ +--- +title: dist/docs/commands/ptk-cluster-set-hba.md +summary: dist/docs/commands/ptk-cluster-set-hba.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster set-hba + +设置并重新加载数据库的 pg_hba.conf + +## 语法 + +```bash +ptk cluster set-hba [flags] +``` + +## 示例 + +```bash +ptk cluster -n set-hba -H -v "host all all 192.168.1.100/32 sha256" +ptk cluster -n set-hba -i -v "host all all 192.168.1.100/32 sha256" +``` + +## 选项 + +### -H, --host stringArray + +* 说明: 数据库实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 数据库实例 ID +* 数据类型: ints +* 默认值: [] + +### -v, --value string + +* 说明: 要在pg_hba.conf中设置的值 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.2.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-shell.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-shell.md new file mode 100644 index 0000000000000000000000000000000000000000..6859c1c2dc166ebc8bd0079f57f66a50b5d5ea45 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-shell.md @@ -0,0 +1,118 @@ +--- +title: dist/docs/commands/ptk-cluster-shell.md +summary: dist/docs/commands/ptk-cluster-shell.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster shell + +执行 shell 命令或脚本 + +## 语法 + +```bash +ptk cluster shell [flags] +``` + +## 示例 + +```bash +ptk cluster -n shell +``` + +## 选项 + +### -c, --command string + +* 说明: 要执行的 shell 指令 +* 数据类型: string +* 默认值: "" + +### -H, --host stringArray + +* 说明: 数据库实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 数据库实例 ID +* 数据类型: ints +* 默认值: [] + +### -s, --script string + +* 说明: 要执行的shell脚本路径 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-show-config.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-show-config.md new file mode 100644 index 0000000000000000000000000000000000000000..04459942d14ff91525481f2e5c27a2fb7e46d07c --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-show-config.md @@ -0,0 +1,92 @@ +--- +title: dist/docs/commands/ptk-cluster-show-config.md +summary: dist/docs/commands/ptk-cluster-show-config.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster show-config + +打印集群拓扑配置文件 + +## 语法 + +```bash +ptk cluster show-config [flags] +``` + +## 示例 + +```bash +ptk cluster -n show-config +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-show-guc.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-show-guc.md new file mode 100644 index 0000000000000000000000000000000000000000..758046adb5804d49097afcbf37759f55f7cd96a5 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-show-guc.md @@ -0,0 +1,100 @@ +--- +title: dist/docs/commands/ptk-cluster-show-guc.md +summary: dist/docs/commands/ptk-cluster-show-guc.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster show-guc + +打印数据库参数 + +## 语法 + +```bash +ptk cluster show-guc [flags] +``` + +## 示例 + +```bash +ptk cluster -n show-guc -k password_encryption_type +``` + +## 选项 + +### -k, --key strings + +* 说明: 数据库参数名 +* 数据类型: strings +* 默认值: [] + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-show-hba.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-show-hba.md new file mode 100644 index 0000000000000000000000000000000000000000..4168d37c49cb0d652de75e0db117679d959bef89 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-show-hba.md @@ -0,0 +1,112 @@ +--- +title: dist/docs/commands/ptk-cluster-show-hba.md +summary: dist/docs/commands/ptk-cluster-show-hba.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster show-hba + +打印数据库 pg_hba.conf 内容 + +## 语法 + +```bash +ptk cluster show-hba [flags] +``` + +## 示例 + +```bash +# 如果没有指定任何实例的话,默认将打印主库的 hba 内容 +ptk cluster -n show-hba + +# 你也可以查看一个固定的实例的 hba 内容 +ptk cluster -n show-hba -H +ptk cluster -n show-hba -i +``` + +## 选项 + +### -H, --host string + +* 说明: 数据库实例 IP +(默认读取主库的 pg_hba.conf) +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 数据库实例 ID +* 数据类型: int +* 默认值: 0 + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-start.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-start.md new file mode 100644 index 0000000000000000000000000000000000000000..2d85dcd116ff968d89a0bda34fb59ad867bdadf6 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-start.md @@ -0,0 +1,139 @@ +--- +title: dist/docs/commands/ptk-cluster-start.md +summary: dist/docs/commands/ptk-cluster-start.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster start + +启动数据库实例或集群 + +## 语法 + +```bash +ptk cluster start [flags] +``` + +## 示例 + +```bash +# 启动指定集群的所有实例 +ptk cluster -n start + +# 启动指定集群的特定实例 +ptk cluster -n start -H +ptk cluster -n start -i + +# [!危险] 启动 PTK 管理的所有集群 +ptk cluster start --all +``` + +## 选项 + +### -a, --all + +* 说明: 启动所有集群 +* 数据类型: bool +* 默认值: false + +### -H, --host string + +* 说明: 数据库实例 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 数据库实例 ID +* 数据类型: int +* 默认值: 0 + +### -r, --role string + +* 说明: 指定数据库角色,仅当指定 host 时生效 +可选项:[primary, standby, cascade_standby] +* 数据类型: string +* 默认值: "" + +### --security-mode + +* 说明: 是否以安全模式启动数据库 +* 数据类型: bool +* 默认值: false + +### --time-out duration + +* 说明: 启动超时时间 +* 数据类型: duration +* 默认值: 10m0s + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.1 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-status.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-status.md new file mode 100644 index 0000000000000000000000000000000000000000..c308153f1c27e384409f0ebb0511dfcd13456471 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-status.md @@ -0,0 +1,132 @@ +--- +title: dist/docs/commands/ptk-cluster-status.md +summary: dist/docs/commands/ptk-cluster-status.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster status + +显示集群或实例的状态信息 + +## 语法 + +```bash +ptk cluster status [flags] +``` + +## 示例 + +```bash +# 打印指定集群的状态 +ptk cluster -n status + +# 打印指定集群中某个实例的状态 +ptk cluster -n status -H +ptk cluster -n status -i + +# 打印所有集群的状态 +ptk cluster status --all +``` + +## 选项 + +### -a, --all + +* 说明: 查询所有集群状态 +* 数据类型: bool +* 默认值: false + +### --detail + +* 说明: 显示状态的详细信息 +* 数据类型: bool +* 默认值: false + +### -H, --host string + +* 说明: 数据库实例 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 数据库实例 ID +* 数据类型: int +* 默认值: 0 + +### -G, --vertical + +* 说明: 以竖版格式显示状态信息 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.1 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-stop.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-stop.md new file mode 100644 index 0000000000000000000000000000000000000000..7a0df405d9972492ebb9dd33ce81216f65555257 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-stop.md @@ -0,0 +1,132 @@ +--- +title: dist/docs/commands/ptk-cluster-stop.md +summary: dist/docs/commands/ptk-cluster-stop.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster stop + +停止数据库实例或集群 + +## 语法 + +```bash +ptk cluster stop [flags] +``` + +## 示例 + +```bash +# 停止指定集群的所有实例 +ptk cluster -n stop + +# 停止指定集群的特定实例 +ptk cluster -n stop -H +ptk cluster -n stop -i + +# [!危险] 停止 PTK 管理的所有集群 +ptk cluster stop --all +``` + +## 选项 + +### -a, --all + +* 说明: 停止所有集群 +* 数据类型: bool +* 默认值: false + +### -H, --host string + +* 说明: 数据库实例 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 数据库实例 ID +* 数据类型: int +* 默认值: 0 + +### -m, --mode string + +* 说明: 关闭模式, 可选项: [fast, immediate] +* 数据类型: string +* 默认值: "fast" + +### --time-out duration + +* 说明: 停止超时时间 +* 数据类型: duration +* 默认值: 10m0s + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.1 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-switchover.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-switchover.md new file mode 100644 index 0000000000000000000000000000000000000000..2e983f35c2e79d711bcdb44f8b6527fe0bf8c648 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-switchover.md @@ -0,0 +1,113 @@ +--- +title: dist/docs/commands/ptk-cluster-switchover.md +summary: dist/docs/commands/ptk-cluster-switchover.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster switchover + +主备切换,升级备库为主库,降主库为备库 + +## 语法 + +```bash +ptk cluster switchover [flags] +``` + +## 示例 + +```bash +ptk cluster -n switchover -H [-m fast] +ptk cluster -n switchover -i [-m fast] +``` + +## 选项 + +### -H, --host string + +* 说明: 要切换的数据库 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 待切换的数据库实例 ID +* 数据类型: int +* 默认值: 0 + +### -m, --mode string + +* 说明: 切换模式, 可选性: [fast, f] +* 数据类型: string +* 默认值: "fast" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-takeover.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-takeover.md new file mode 100644 index 0000000000000000000000000000000000000000..d5ffd7b2c8448e5acf0cc3674699dc1f49d12f04 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-takeover.md @@ -0,0 +1,158 @@ +--- +title: dist/docs/commands/ptk-cluster-takeover.md +summary: dist/docs/commands/ptk-cluster-takeover.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster takeover + +Takeover a new server to ptk metadata + +## 语法 + +```bash +ptk cluster takeover [flags] +``` + +## 示例 + +```bash +ptk cluster -n takeover [-H|--host ][-U|--user ] +[-i|--identity ] [--appdir ] [--datadir ] [--logdir ] [--tmpdir ] [--tooldir ] + +# For example: +ptk cluster -n takeover -H -U +``` + +## 选项 + +### --appdir string + +* 说明: App dir of db server +* 数据类型: string +* 默认值: "" + +### -y, --assumeyes + +* 说明: 自动对所有提问回复 Yes +* 数据类型: bool +* 默认值: false + +### --datadir string + +* 说明: Data dir of db server +* 数据类型: string +* 默认值: "" + +### --db-port int + +* 说明: DB port of db server +* 数据类型: int +* 默认值: 0 + +### -H, --host string + +* 说明: Specify the host of the takeover node +* 数据类型: string +* 默认值: "" + +### -i, --identity string + +* 说明: SSH private key path +* 数据类型: string +* 默认值: "" + +### --logdir string + +* 说明: Log dir of db server +* 数据类型: string +* 默认值: "" + +### --tmpdir string + +* 说明: Tmp dir of db server +* 数据类型: string +* 默认值: "" + +### --tooldir string + +* 说明: Tool dir of db server +* 数据类型: string +* 默认值: "" + +### -U, --username string + +* 说明: Specify the user to takeover the node +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.5.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-throwout.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-throwout.md new file mode 100644 index 0000000000000000000000000000000000000000..7fa76ba2f2177f9d7e9889a032996b9014d91238 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-throwout.md @@ -0,0 +1,118 @@ +--- +title: dist/docs/commands/ptk-cluster-throwout.md +summary: dist/docs/commands/ptk-cluster-throwout.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster throwout + +Remove a server from ptk metadata + +## 语法 + +```bash +ptk cluster throwout [flags] +``` + +## 示例 + +```bash + +# By host ip +ptk cluster -n throwout -H + +# By instance id +ptk cluster -n throwout -i + +``` + +## 选项 + +### -H, --host stringArray + +* 说明: 数据库实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 数据库实例 ID +* 数据类型: ints +* 默认值: [] + +### -y, --yes + +* 说明: 对所有问题自动确认 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.5.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-uninstall-cm.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-uninstall-cm.md new file mode 100644 index 0000000000000000000000000000000000000000..0b673885fb7a35758c0e130f7e79c5dd8953a0d5 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-uninstall-cm.md @@ -0,0 +1,92 @@ +--- +title: dist/docs/commands/ptk-cluster-uninstall-cm.md +summary: dist/docs/commands/ptk-cluster-uninstall-cm.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster uninstall-cm + +卸载 CM 组件 + +## 语法 + +```bash +ptk cluster uninstall-cm [flags] +``` + +## 示例 + +```bash +ptk cluster -n uninstall-cm +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.4.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-uninstall-kerberos-server.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-uninstall-kerberos-server.md new file mode 100644 index 0000000000000000000000000000000000000000..cc8a76fc0968bc25c13a1d8b5b567041a50637bc --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-uninstall-kerberos-server.md @@ -0,0 +1,107 @@ +--- +title: dist/docs/commands/ptk-cluster-uninstall-kerberos-server.md +summary: dist/docs/commands/ptk-cluster-uninstall-kerberos-server.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster uninstall-kerberos-server + +卸载 kerberos 服务 + +## 语法 + +```bash +ptk cluster uninstall-kerberos-server [flags] +``` + +## 示例 + +```bash +ptk cluster -n uninstall-kerberos-server -H +ptk cluster -n uninstall-kerberos-server -i +``` + +## 选项 + +### -H, --host string + +* 说明: 数据库实例 IP +* 数据类型: string +* 默认值: "" + +### -i, --id int + +* 说明: 数据库实例 ID +* 数据类型: int +* 默认值: 0 + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.0.0 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-uninstall-mogha.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-uninstall-mogha.md new file mode 100644 index 0000000000000000000000000000000000000000..59e98f3e53a032554e54e546ac903c095d8f332d --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-uninstall-mogha.md @@ -0,0 +1,92 @@ +--- +title: dist/docs/commands/ptk-cluster-uninstall-mogha.md +summary: dist/docs/commands/ptk-cluster-uninstall-mogha.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster uninstall-mogha + +卸载 MogHA + +## 语法 + +```bash +ptk cluster uninstall-mogha [flags] +``` + +## 示例 + +```bash +ptk cluster -n uninstall-mogha +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-upgrade-commit.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-upgrade-commit.md new file mode 100644 index 0000000000000000000000000000000000000000..84b469cf94691055a9063c7062023acbf964b2f5 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-upgrade-commit.md @@ -0,0 +1,92 @@ +--- +title: dist/docs/commands/ptk-cluster-upgrade-commit.md +summary: dist/docs/commands/ptk-cluster-upgrade-commit.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster upgrade-commit + +确认提交升级操作(!提交后不能回滚) + +## 语法 + +```bash +ptk cluster upgrade-commit [flags] +``` + +## 示例 + +```bash +ptk cluster -n upgrade-commit +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.7 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-upgrade-rollback.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-upgrade-rollback.md new file mode 100644 index 0000000000000000000000000000000000000000..34745337e450329f4bce75576427f4ffd7307576 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-upgrade-rollback.md @@ -0,0 +1,113 @@ +--- +title: dist/docs/commands/ptk-cluster-upgrade-rollback.md +summary: dist/docs/commands/ptk-cluster-upgrade-rollback.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster upgrade-rollback + +回滚升级操作 + +## 语法 + +```bash +ptk cluster upgrade-rollback [flags] +``` + +## 示例 + +```bash +ptk cluster -n upgrade-rollback [-i ID] [-H IP] +``` + +## 选项 + +### -H, --host stringArray + +* 说明: 数据库实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 数据库实例 ID +* 数据类型: ints +* 默认值: [] + +### --parallel uint + +* 说明: 同时操作的数据库的最大数量 +通常小于 sshd_config 中 MaxSessions 的值 +* 数据类型: uint +* 默认值: 10 + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.7 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster-upgrade.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-upgrade.md new file mode 100644 index 0000000000000000000000000000000000000000..6b12354d631729d27af748ebdfa935bcee79d298 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster-upgrade.md @@ -0,0 +1,165 @@ +--- +title: dist/docs/commands/ptk-cluster-upgrade.md +summary: dist/docs/commands/ptk-cluster-upgrade.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster upgrade + +升级集群的数据库版本 + +## 语法 + +```bash +ptk cluster upgrade [flags] +``` + +## 示例 + +```bash +# 使用本地安装包进行升级 +ptk cluster -n upgrade -p + +# 指定目标数据库版本升级(需要网络) +# 当 ptk 版本为 1.2.0 或更高版本时,它支持直接升级包含插件的数据库, +# ptk 会从网络上下载新版本对应的插件安装包 +ptk cluster -n upgrade -t 5.0.6 + +# 如果当前数据库包含插件并且无法访问互联网, +# 你可以下载插件安装包到一个固定的目录,然后通过 '--plugin-dir' 指定存放目录 +ptk cluster -n upgrade -p --plugin-dir +``` + +## 选项 + +### -y, --assumeyes + +* 说明: 自动对所有提问回复 Yes +* 数据类型: bool +* 默认值: false + +### -H, --host stringArray + +* 说明: 数据库实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -i, --id ints + +* 说明: 数据库实例 ID +* 数据类型: ints +* 默认值: [] + +### -m, --mode string + +* 说明: 升级模式,可选项: [replace, cover] +* 数据类型: string +* 默认值: "cover" + +### -p, --package string + +* 说明: 目标安装包路径 +* 数据类型: string +* 默认值: "" + +### --parallel uint + +* 说明: 同时操作的数据库的最大数量 +通常小于 sshd_config 中 MaxSessions 的值 +* 数据类型: uint +* 默认值: 10 + +### --plugin-dir string + +* 说明: 待升级的插件目录 +* 数据类型: string +* 默认值: "" + +### --plugin-upgrade-patch string + +* 说明: 插件升级补丁的文件路径 +* 数据类型: string +* 默认值: "" + +### -R, --remain + +* 说明: 升级剩余节点 +* 数据类型: bool +* 默认值: false + +### -t, --to-version string + +* 说明: 目标安装包版本 (依赖网络) +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.7 + +## 另请参阅 + +* [ptk cluster](./ptk-cluster.md) - 管理集群 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-cluster.md b/product/zh/docs-ptk/v2.0/commands/ptk-cluster.md new file mode 100644 index 0000000000000000000000000000000000000000..5130d4abcc1150a9228e1e195dd4244dd7578b8e --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-cluster.md @@ -0,0 +1,127 @@ +--- +title: dist/docs/commands/ptk-cluster.md +summary: dist/docs/commands/ptk-cluster.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk cluster + +管理集群 + +## 语法 + +```bash +ptk cluster [flags] +``` + +## 选项 + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.1 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB +* [ptk cluster add-kerberos-auth](./ptk-cluster-add-kerberos-auth.md) - 添加 kerberos 认证 +* [ptk cluster build](./ptk-cluster-build.md) - 重建数据库数据 +* [ptk cluster del-kerberos-auth](./ptk-cluster-del-kerberos-auth.md) - 删除 kerberos 认证 +* [ptk cluster demote](./ptk-cluster-demote.md) - 将数据库角色从 Primary 降级为 Standby,或从 Standby 降级为 Cascade Standby +* [ptk cluster failover](./ptk-cluster-failover.md) - 提升一个备库为主库 +* [ptk cluster gen-cert-files](./ptk-cluster-gen-cert-files.md) - 生成ssl证书文件 +* [ptk cluster inspect](./ptk-cluster-inspect.md) - 返回关于集群的内部信息 +* [ptk cluster install-cm](./ptk-cluster-install-cm.md) - 安装 CM 组件 +* [ptk cluster install-kerberos-server](./ptk-cluster-install-kerberos-server.md) - 安装 kerberos 服务器 +* [ptk cluster install-mogha](./ptk-cluster-install-mogha.md) - 为 MogDB 安装 MogHA +* [ptk cluster install-plugin](./ptk-cluster-install-plugin.md) - 安装 MogDB 插件 +* [ptk cluster is-in-upgrade](./ptk-cluster-is-in-upgrade.md) - 查看集群是否处于升级过程中 +* [ptk cluster list-plugins](./ptk-cluster-list-plugins.md) - 列出集群中的插件 +* [ptk cluster load-cm-vip](./ptk-cluster-load-cm-vip.md) - 管理 CM 的虚拟IP (仅 Mogdb v5.0.4+ 支持) +* [ptk cluster modify-comment](./ptk-cluster-modify-comment.md) - 修改指定集群的备注 +* [ptk cluster promote](./ptk-cluster-promote.md) - 将一个数据库实例从备库提升为主库, 或从级联备库提升为备库 +* [ptk cluster refresh](./ptk-cluster-refresh.md) - 更新集群配置 +* [ptk cluster rename](./ptk-cluster-rename.md) - Rename cluster +* [ptk cluster restart](./ptk-cluster-restart.md) - 重启数据库实例或集群 +* [ptk cluster scale-in](./ptk-cluster-scale-in.md) - 对一个MogDB集群进行缩容 +* [ptk cluster scale-out](./ptk-cluster-scale-out.md) - 对一个MogDB集群进行扩容 +* [ptk cluster set-guc](./ptk-cluster-set-guc.md) - 设置并重新加载数据库参数 +* [ptk cluster set-hba](./ptk-cluster-set-hba.md) - 设置并重新加载数据库的 pg_hba.conf +* [ptk cluster shell](./ptk-cluster-shell.md) - 执行 shell 命令或脚本 +* [ptk cluster show-config](./ptk-cluster-show-config.md) - 打印集群拓扑配置文件 +* [ptk cluster show-guc](./ptk-cluster-show-guc.md) - 打印数据库参数 +* [ptk cluster show-hba](./ptk-cluster-show-hba.md) - 打印数据库 pg_hba.conf 内容 +* [ptk cluster start](./ptk-cluster-start.md) - 启动数据库实例或集群 +* [ptk cluster status](./ptk-cluster-status.md) - 显示集群或实例的状态信息 +* [ptk cluster stop](./ptk-cluster-stop.md) - 停止数据库实例或集群 +* [ptk cluster switchover](./ptk-cluster-switchover.md) - 主备切换,升级备库为主库,降主库为备库 +* [ptk cluster takeover](./ptk-cluster-takeover.md) - Takeover a new server to ptk metadata +* [ptk cluster throwout](./ptk-cluster-throwout.md) - Remove a server from ptk metadata +* [ptk cluster uninstall-cm](./ptk-cluster-uninstall-cm.md) - 卸载 CM 组件 +* [ptk cluster uninstall-kerberos-server](./ptk-cluster-uninstall-kerberos-server.md) - 卸载 kerberos 服务 +* [ptk cluster uninstall-mogha](./ptk-cluster-uninstall-mogha.md) - 卸载 MogHA +* [ptk cluster upgrade](./ptk-cluster-upgrade.md) - 升级集群的数据库版本 +* [ptk cluster upgrade-commit](./ptk-cluster-upgrade-commit.md) - 确认提交升级操作(!提交后不能回滚) +* [ptk cluster upgrade-rollback](./ptk-cluster-upgrade-rollback.md) - 回滚升级操作 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-collect.md b/product/zh/docs-ptk/v2.0/commands/ptk-collect.md new file mode 100644 index 0000000000000000000000000000000000000000..56afadc93438a036413713d51a12bb36fdbe0c0b --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-collect.md @@ -0,0 +1,101 @@ +--- +title: dist/docs/commands/ptk-collect.md +summary: dist/docs/commands/ptk-collect.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk collect + +收集系统和集群信息用于分析 + +## 语法 + +```bash +ptk collect [flags] +``` + +## 示例 + +```bash +ptk collect -f +ptk collect -n +``` + +## 选项 + +### -f, --file string + +* 说明: 指定集群配置文件 +* 数据类型: string +* 默认值: "" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.2.0 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-completion-bash.md b/product/zh/docs-ptk/v2.0/commands/ptk-completion-bash.md new file mode 100644 index 0000000000000000000000000000000000000000..2c25c2fa4e1f65fb5f57056fa6b354a7982dfe28 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-completion-bash.md @@ -0,0 +1,107 @@ +--- +title: dist/docs/commands/ptk-completion-bash.md +summary: dist/docs/commands/ptk-completion-bash.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk completion bash + +Generate the autocompletion script for bash + +## 说明 + +Generate the autocompletion script for the 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. + +To load completions in your current shell session: + +source <(ptk completion bash) + +To load completions for every new session, execute once: + +### Linux + +ptk completion bash > /etc/bash_completion.d/ptk + +### macOS + +ptk completion bash > /usr/local/etc/bash_completion.d/ptk + +You will need to start a new shell for this setup to take effect. + +## 语法 + +```bash +ptk completion bash +``` + +## 选项 + +### --no-descriptions + +* 说明: disable completion descriptions +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 另请参阅 + +* [ptk completion](./ptk-completion.md) - Generate the autocompletion script for the specified shell diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-completion-fish.md b/product/zh/docs-ptk/v2.0/commands/ptk-completion-fish.md new file mode 100644 index 0000000000000000000000000000000000000000..f23d22ee5b7ed4a0e37768cbd0d6bf2000b5d9b8 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-completion-fish.md @@ -0,0 +1,98 @@ +--- +title: dist/docs/commands/ptk-completion-fish.md +summary: dist/docs/commands/ptk-completion-fish.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk completion fish + +Generate the autocompletion script for fish + +## 说明 + +Generate the autocompletion script for the 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. + +## 语法 + +```bash +ptk completion fish [flags] +``` + +## 选项 + +### --no-descriptions + +* 说明: disable completion descriptions +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 另请参阅 + +* [ptk completion](./ptk-completion.md) - Generate the autocompletion script for the specified shell diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-completion-powershell.md b/product/zh/docs-ptk/v2.0/commands/ptk-completion-powershell.md new file mode 100644 index 0000000000000000000000000000000000000000..451c62824ba386a97976f421a764ab846255f08c --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-completion-powershell.md @@ -0,0 +1,95 @@ +--- +title: dist/docs/commands/ptk-completion-powershell.md +summary: dist/docs/commands/ptk-completion-powershell.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk completion powershell + +Generate the autocompletion script for powershell + +## 说明 + +Generate the autocompletion script for powershell. + +To load completions in your current shell session: + +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. + +## 语法 + +```bash +ptk completion powershell [flags] +``` + +## 选项 + +### --no-descriptions + +* 说明: disable completion descriptions +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 另请参阅 + +* [ptk completion](./ptk-completion.md) - Generate the autocompletion script for the specified shell diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-completion-zsh.md b/product/zh/docs-ptk/v2.0/commands/ptk-completion-zsh.md new file mode 100644 index 0000000000000000000000000000000000000000..9727f34d3d4a744ba4494005b1ac887dbf180756 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-completion-zsh.md @@ -0,0 +1,109 @@ +--- +title: dist/docs/commands/ptk-completion-zsh.md +summary: dist/docs/commands/ptk-completion-zsh.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk completion zsh + +Generate the autocompletion script for zsh + +## 说明 + +Generate the autocompletion script for the zsh shell. + +If shell completion is not already enabled in your environment you will need +to enable it. You can execute the following once: + +echo "autoload -U compinit; compinit" >> ~/.zshrc + +To load completions in your current shell session: + +source <(ptk completion zsh); compdef _ptk ptk + +To load completions for every new session, execute once: + +### Linux + +ptk completion zsh > "${fpath[1]}/_ptk" + +### macOS + +ptk completion zsh > /usr/local/share/zsh/site-functions/_ptk + +You will need to start a new shell for this setup to take effect. + +## 语法 + +```bash +ptk completion zsh [flags] +``` + +## 选项 + +### --no-descriptions + +* 说明: disable completion descriptions +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 另请参阅 + +* [ptk completion](./ptk-completion.md) - Generate the autocompletion script for the specified shell diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-completion.md b/product/zh/docs-ptk/v2.0/commands/ptk-completion.md new file mode 100644 index 0000000000000000000000000000000000000000..0010606b6a3b77688cd1510d6922ec1bb9a2c8ba --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-completion.md @@ -0,0 +1,79 @@ +--- +title: dist/docs/commands/ptk-completion.md +summary: dist/docs/commands/ptk-completion.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk completion + +Generate the autocompletion script for the specified shell + +## 说明 + +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. + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB +* [ptk completion bash](./ptk-completion-bash.md) - Generate the autocompletion script for bash +* [ptk completion fish](./ptk-completion-fish.md) - Generate the autocompletion script for fish +* [ptk completion powershell](./ptk-completion-powershell.md) - Generate the autocompletion script for powershell +* [ptk completion zsh](./ptk-completion-zsh.md) - Generate the autocompletion script for zsh diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-demo.md b/product/zh/docs-ptk/v2.0/commands/ptk-demo.md new file mode 100644 index 0000000000000000000000000000000000000000..3092b472c8ef67950044780e48c6112ed1d08851 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-demo.md @@ -0,0 +1,107 @@ +--- +title: dist/docs/commands/ptk-demo.md +summary: dist/docs/commands/ptk-demo.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk demo + +快速部署本地示例 MogDB + +## 语法 + +```bash +ptk demo [flags] +``` + +## 示例 + +```bash +ptk demo +ptk demo -p +``` + +## 选项 + +### --compat-tools-dir string + +* 说明: 指定 compat-tools 插件目录 +* 数据类型: string +* 默认值: "" + +### --mogila-dir string + +* 说明: 指定 mogila 插件目录 +* 数据类型: string +* 默认值: "" + +### -p, --port int + +* 说明: MogDB 端口 +* 数据类型: int +* 默认值: 26000 + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.6 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-download.md b/product/zh/docs-ptk/v2.0/commands/ptk-download.md new file mode 100644 index 0000000000000000000000000000000000000000..eefc9e4037425f73cf75517f245be06b9e196b18 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-download.md @@ -0,0 +1,123 @@ +--- +title: dist/docs/commands/ptk-download.md +summary: dist/docs/commands/ptk-download.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk download + +在线下载 MogDB 安装包 + +## 语法 + +```bash +ptk download [flags] +``` + +## 示例 + +```bash +ptk download +ptk download --db-version 5.0.5 +``` + +## 选项 + +### --cpu string + +* 说明: 指定CPU型号名 +可通过 'ptk candidate cpu' 来查看支持的CPU型号名列表 +* 数据类型: string +* 默认值: "" + +### -V, --db-version string + +* 说明: Specify db version. +Type 'ptk candidate db' to show supported version +This flag only support MogDB +* 数据类型: string +* 默认值: "5.0.7" + +### --dest-dir string + +* 说明: 指定要存储的本地目录 +* 数据类型: string +* 默认值: "" + +### --dryrun + +* 说明: 预览下载流程,不执行下载 +* 数据类型: bool +* 默认值: false + +### -O, --os int + +* 说明: 指定系统ID (默认为当前系统) +可通过 'ptk candidate os' 查看支持的系统列表 +* 数据类型: int +* 默认值: 0 + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.3 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-encrypt.md b/product/zh/docs-ptk/v2.0/commands/ptk-encrypt.md new file mode 100644 index 0000000000000000000000000000000000000000..5e0d178863b76d45130a5f763ab2c4dcabc6d890 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-encrypt.md @@ -0,0 +1,107 @@ +--- +title: dist/docs/commands/ptk-encrypt.md +summary: dist/docs/commands/ptk-encrypt.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk encrypt + +提供一个便捷的方式来加密您的文本或密码 + +## 语法 + +```bash +ptk encrypt TEXT1 [TEXT2 TEXT3...] [flags] +``` + +## 示例 + +```bash +# Wrap the string to be encrypted with single quotes to prevent it from being interpreted +ptk encrypt 'Abcd@1234' + +# Enter text by interaction +ptk encrypt --stdin + +# Or pass text by pipe +echo '' | ptk encrypt --stdin [--disable-prompt] +``` + +## 选项 + +### --disable-prompt + +* 说明: Do not show prompt while entering +* 数据类型: bool +* 默认值: false + +### --stdin + +* 说明: Enter text by interactive +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-env.md b/product/zh/docs-ptk/v2.0/commands/ptk-env.md new file mode 100644 index 0000000000000000000000000000000000000000..7e82b22df1483e67e48463832856c8041dbe6e08 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-env.md @@ -0,0 +1,90 @@ +--- +title: dist/docs/commands/ptk-env.md +summary: dist/docs/commands/ptk-env.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk env + +打印 PTK 加载的环境变量值 + +## 语法 + +```bash +ptk env [key1 key2 ... keyN] [flags] +``` + +## 示例 + +```bash +# Print all supported environment variables +ptk env + +# Print value of specified environment variable +ptk env +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-exec.md b/product/zh/docs-ptk/v2.0/commands/ptk-exec.md new file mode 100644 index 0000000000000000000000000000000000000000..89dc221f699bcfc4a2fb3098ba4b681f562e89a4 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-exec.md @@ -0,0 +1,133 @@ +--- +title: dist/docs/commands/ptk-exec.md +summary: dist/docs/commands/ptk-exec.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk exec + +执行 shell 命令或脚本 + +## 语法 + +```bash +ptk exec [flags] +``` + +## 示例 + +```bash +# Run a command through specifying a config file +# (This generally used in the scenario where the cluster has not been installed) +ptk exec -f -c 'pwd' + +# Run a command through specifying the cluster name +ptk exec -n -c 'pwd' + +# If both '-f' and '-n' are specified, only '-n' will be used. + +# Run a local shell script on all hosts in the cluster +ptk exec -n -s + +# You can specify the command and the script at the same time, +# PTK will execute the command first, the script will be executed if the command executed successfully, +# otherwise the script will not be executed. +ptk exec -n -c 'pwd' -s +``` + +## 选项 + +### -c, --command string + +* 说明: 要执行的 shell 指令 +* 数据类型: string +* 默认值: "" + +### -f, --file string + +* 说明: 指定集群配置文件 +* 数据类型: string +* 默认值: "" + +### -H, --host stringArray + +* 说明: 操作的实例 IP +* 数据类型: stringArray +* 默认值: [] + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### -s, --script string + +* 说明: 要执行的shell脚本路径 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.5 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-gen-om-xml.md b/product/zh/docs-ptk/v2.0/commands/ptk-gen-om-xml.md new file mode 100644 index 0000000000000000000000000000000000000000..b2dc28a512c842fc05c088333a07f080da29fcf1 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-gen-om-xml.md @@ -0,0 +1,110 @@ +--- +title: dist/docs/commands/ptk-gen-om-xml.md +summary: dist/docs/commands/ptk-gen-om-xml.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk gen-om-xml + +生成 gs_om 的 XML 配置文件 + +## 语法 + +```bash +ptk gen-om-xml [flags] +``` + +## 示例 + +```bash +# 通过配置文件生成 xml +ptk gen-om-xml -f [-o output.xml] + +# 通过已经存在的集群生成 xml +ptk gen-om-xml -n [-o output.xml] +``` + +## 选项 + +### -f, --file string + +* 说明: 指定集群配置文件 +* 数据类型: string +* 默认值: "" + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### -o, --output string + +* 说明: 指定输出文件名 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-gen-ptkc.md b/product/zh/docs-ptk/v2.0/commands/ptk-gen-ptkc.md new file mode 100644 index 0000000000000000000000000000000000000000..f191dd1ecea69759e24817e58ea64c71774d8933 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-gen-ptkc.md @@ -0,0 +1,106 @@ +--- +title: dist/docs/commands/ptk-gen-ptkc.md +summary: dist/docs/commands/ptk-gen-ptkc.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk gen-ptkc + +生成 ptkc 二进制文件 + +## 语法 + +```bash +ptk gen-ptkc [flags] +``` + +## 选项 + +### --arch string + +* 说明: PTKC 的指令集架构, 可选项: [arm64, x86_64] +* 数据类型: string +* 默认值: "" + +### -H, --host strings + +* 说明: 指定集群内的主机 IP +* 数据类型: strings +* 默认值: [] + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### -o, --output string + +* 说明: 指定输出目录 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.8 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-gen-static-config.md b/product/zh/docs-ptk/v2.0/commands/ptk-gen-static-config.md new file mode 100644 index 0000000000000000000000000000000000000000..0becd632631d96965d088a77f3f27a167278b7b8 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-gen-static-config.md @@ -0,0 +1,101 @@ +--- +title: dist/docs/commands/ptk-gen-static-config.md +summary: dist/docs/commands/ptk-gen-static-config.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk gen-static-config + +使用指定的 YAML 配置生成一份新的集群静态文件并分发到数据节点 + +## 语法 + +```bash +ptk gen-static-config [flags] +``` + +## 示例 + +```bash +ptk gen-static-config -f +ptk distribute -f +``` + +## 选项 + +### -f, --file string + +* 说明: 指定集群配置文件 +* 数据类型: string +* 默认值: "" + +### -H, --host string + +* 说明: 分发到一个固定数据节点 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-init-cluster.md b/product/zh/docs-ptk/v2.0/commands/ptk-init-cluster.md new file mode 100644 index 0000000000000000000000000000000000000000..2eb0d8e6ab871c103db2a99f34ab0170b092c687 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-init-cluster.md @@ -0,0 +1,94 @@ +--- +title: dist/docs/commands/ptk-init-cluster.md +summary: dist/docs/commands/ptk-init-cluster.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk init-cluster + +Generate a new empty cluster + +## 语法 + +```bash +ptk init-cluster [flags] +``` + +## 示例 + +```bash +ptk init-cluster [--name|-n CLUSTER_NAME] +``` + +## 选项 + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.5.0 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-install.md b/product/zh/docs-ptk/v2.0/commands/ptk-install.md new file mode 100644 index 0000000000000000000000000000000000000000..bfd49cf1c53560e90d0d6491cb3e60b5cd1769fa --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-install.md @@ -0,0 +1,251 @@ +--- +title: dist/docs/commands/ptk-install.md +summary: dist/docs/commands/ptk-install.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk install + +安装 MogDB 或 Uqbar 数据库集群 + +## 语法 + +```bash +ptk install [flags] +``` + +## 示例 + +```bash +# Simplest command to install the database (require network) +# It will download latest MogDB installation package from internet and deploy to target hosts +ptk install -f + +# If you have previously performed checkos command and fixed them, +# you can skip unnecessary secondary checks by adding the '-skip-check-os' parameter +ptk install -f --skip-check-os + +# If you do not want to interact during the installation process +# you can specify '-y' to accept all questions automatically +ptk install -f -y + +# If your machine is unable to connect to the Internet, +# you can install it by specifying a local database package +ptk install -f -p + +# If you want to install the cm component, you can specify the '--install-cm' parameter +ptk install -f --install-cm + +# Of course, you can freely combine multiple parameters to meet specific usage scenarios +ptk install -f -p -y --skip-check-os --comment 'greate db' + +# There are many other parameters in the ptk install command. We look forward to your exploration and discovery. +``` + +## 选项 + +### -y, --assumeyes + +* 说明: 自动对所有提问回复 Yes +* 数据类型: bool +* 默认值: false + +### --comment string + +* 说明: 为当前集群添加备注信息 +* 数据类型: string +* 默认值: "" + +### --cpu string + +* 说明: 指定CPU型号名 +可通过 'ptk candidate cpu' 来查看支持的CPU型号名列表 +* 数据类型: string +* 默认值: "" + +### --db-version string + +* 说明: Specify the database package version if use online package +Type 'ptk candidate db' to show available version +This flag only support MogDB +* 数据类型: string +* 默认值: "5.0.7" + +### --default-guc + +* 说明: 不自动优化 GUC 参数,使用数据库默认参数 +* 数据类型: bool +* 默认值: false + +### --enable-dss + +* 说明: 启用DSS组件 +* 数据类型: bool +* 默认值: false + +### -e, --env strings + +* 说明: 环境变量将被添加到系统用户的配置文件中 +* 数据类型: strings +* 默认值: [] + +### -f, --file string + +* 说明: 指定集群配置文件 +* 数据类型: string +* 默认值: "" + +### --install-cm + +* 说明: 安装 CM 组件 +* 数据类型: bool +* 默认值: false + +### --launch-db-timeout duration + +* 说明: 启动数据库超时时间 +* 数据类型: duration +* 默认值: 10m0s + +### --no-cache + +* 说明: 不使用本地缓存的安装包 +* 数据类型: bool +* 默认值: false + +### --not-limit-cm-nodes + +* 说明: 不限制CM节点的数量必须是奇数 +* 数据类型: bool +* 默认值: false + +### -p, --pkg string + +* 说明: 指定数据库安装包的文件路径或 URL +* 数据类型: string +* 默认值: "" + +### --post-run string + +* 说明: 指定 Bash 脚本路径,将在部署成功后分发到每个服务器上运行 +* 数据类型: string +* 默认值: "" + +### --pre-run string + +* 说明: 指定 Bash 脚本路径,将在执行部署数据库之前分发到每个服务器上运行 +* 数据类型: string +* 默认值: "" + +### --skip-check-distro + +* 说明: 跳过系统发行版检查,直接安装 +* 数据类型: bool +* 默认值: false + +### --skip-check-os + +* 说明: 跳过系统环境检查,直接安装 +* 数据类型: bool +* 默认值: false + +### --skip-check-package + +* 说明: 跳过安装包的 md5 校验和内部包的 sha256 校验 +* 数据类型: bool +* 默认值: false + +### --skip-create-user + +* 说明: 跳过创建系统用户 +* 数据类型: bool +* 默认值: false + +### --skip-gen-ptkc + +* 说明: 跳过生成 ptkc 工具 +* 数据类型: bool +* 默认值: false + +### --skip-launch-db + +* 说明: 无需启动数据库 +* 数据类型: bool +* 默认值: false + +### --skip-load-vip + +* 说明: Skip load vip after deploying CM +* 数据类型: bool +* 默认值: false + +### --skip-rollback + +* 说明: 安装失败时,不进行回滚操作 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.1 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-ls.md b/product/zh/docs-ptk/v2.0/commands/ptk-ls.md new file mode 100644 index 0000000000000000000000000000000000000000..315775dffb8babdc747146d83f438813aac5099c --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-ls.md @@ -0,0 +1,94 @@ +--- +title: dist/docs/commands/ptk-ls.md +summary: dist/docs/commands/ptk-ls.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk ls + +列出所有 MogDB 集群列表 + +## 语法 + +```bash +ptk ls [flags] +``` + +## 示例 + +```bash +ptk ls [-n|--only-name] +``` + +## 选项 + +### -n, --only-name + +* 说明: 仅列出集群名称 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.1 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-manage.md b/product/zh/docs-ptk/v2.0/commands/ptk-manage.md new file mode 100644 index 0000000000000000000000000000000000000000..dc5ea6e69d7958dac8c93cafbc572bd716e62227 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-manage.md @@ -0,0 +1,106 @@ +--- +title: dist/docs/commands/ptk-manage.md +summary: dist/docs/commands/ptk-manage.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk manage + +Manage an exist cluster + +## 语法 + +```bash +ptk manage [flags] +``` + +## 示例 + +```bash +ptk manage --clustername -H -U +``` + +## 选项 + +### --clustername string + +* 说明: 指定一个新的集群名称 +* 数据类型: string +* 默认值: "" + +### -H, --host string + +* 说明: 目标集群中的一个机器的IP +* 数据类型: string +* 默认值: "" + +### -U, --username string + +* 说明: 运行数据库的操作系统用户 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.7 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-meta-dump.md b/product/zh/docs-ptk/v2.0/commands/ptk-meta-dump.md new file mode 100644 index 0000000000000000000000000000000000000000..0f57706018e06d2a1b055e6fb018882a40f1e488 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-meta-dump.md @@ -0,0 +1,110 @@ +--- +title: dist/docs/commands/ptk-meta-dump.md +summary: dist/docs/commands/ptk-meta-dump.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk meta dump + +导出集群元数据 + +## 语法 + +```bash +ptk meta dump [flags] +``` + +## 示例 + +```bash +# 转储一个集群的元数据 +ptk meta dump -n [-o OUTPUT_DIR] + +# 转储所有集群的元数据 +ptk meta dump --all [-o OUTPUT_DIR] +``` + +## 选项 + +### --all + +* 说明: 导出所有集群元数据 +* 数据类型: bool +* 默认值: false + +### -n, --name stringArray + +* 说明: 集群名称 +* 数据类型: stringArray +* 默认值: [] + +### -o, --output string + +* 说明: 指定输出目录 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.8 + +## 另请参阅 + +* [ptk meta](./ptk-meta.md) - 管理 PTK 元数据 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-meta-home.md b/product/zh/docs-ptk/v2.0/commands/ptk-meta-home.md new file mode 100644 index 0000000000000000000000000000000000000000..365ebd4f1df11329523b4d0493dc074335560748 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-meta-home.md @@ -0,0 +1,86 @@ +--- +title: dist/docs/commands/ptk-meta-home.md +summary: dist/docs/commands/ptk-meta-home.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk meta home + +打印元数据的根目录 + +## 语法 + +```bash +ptk meta home [flags] +``` + +## 示例 + +```bash +ptk meta home +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk meta](./ptk-meta.md) - 管理 PTK 元数据 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-meta-merge.md b/product/zh/docs-ptk/v2.0/commands/ptk-meta-merge.md new file mode 100644 index 0000000000000000000000000000000000000000..4cf79564cea9c2a310c15ffa73f94ab9e33a7060 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-meta-merge.md @@ -0,0 +1,94 @@ +--- +title: dist/docs/commands/ptk-meta-merge.md +summary: dist/docs/commands/ptk-meta-merge.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk meta merge + +合并集群元数据 + +## 语法 + +```bash +ptk meta merge [flags] +``` + +## 示例 + +```bash +ptk meta merge -p +``` + +## 选项 + +### -p, --package string + +* 说明: 指定通过 ptk 导出的元数据包 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.8 + +## 另请参阅 + +* [ptk meta](./ptk-meta.md) - 管理 PTK 元数据 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-meta-prune.md b/product/zh/docs-ptk/v2.0/commands/ptk-meta-prune.md new file mode 100644 index 0000000000000000000000000000000000000000..92e3a0cda2e929df1450ef9ed0f3361bb79a665b --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-meta-prune.md @@ -0,0 +1,106 @@ +--- +title: dist/docs/commands/ptk-meta-prune.md +summary: dist/docs/commands/ptk-meta-prune.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk meta prune + +清理过期的集群元数据 + +## 语法 + +```bash +ptk meta prune [flags] +``` + +## 示例 + +```bash +ptk meta prune -n [--force] +``` + +## 选项 + +### --assumeyes + +* 说明: 自动对所有提问回复 Yes +* 数据类型: bool +* 默认值: false + +### --force + +* 说明: 不检查冗余数据,直接清理元数据 +* 数据类型: bool +* 默认值: false + +### -n, --name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.6 + +## 另请参阅 + +* [ptk meta](./ptk-meta.md) - 管理 PTK 元数据 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-meta.md b/product/zh/docs-ptk/v2.0/commands/ptk-meta.md new file mode 100644 index 0000000000000000000000000000000000000000..c5b8d9e0a275ccb927df1be95008c3cad44e5538 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-meta.md @@ -0,0 +1,84 @@ +--- +title: dist/docs/commands/ptk-meta.md +summary: dist/docs/commands/ptk-meta.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk meta + +管理 PTK 元数据 + +## 语法 + +```bash +ptk meta [flags] +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB +* [ptk meta dump](./ptk-meta-dump.md) - 导出集群元数据 +* [ptk meta home](./ptk-meta-home.md) - 打印元数据的根目录 +* [ptk meta merge](./ptk-meta-merge.md) - 合并集群元数据 +* [ptk meta prune](./ptk-meta-prune.md) - 清理过期的集群元数据 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-rec-guc.md b/product/zh/docs-ptk/v2.0/commands/ptk-rec-guc.md new file mode 100644 index 0000000000000000000000000000000000000000..d282e7ab929756884664ae0973bf8d79c8e3704e --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-rec-guc.md @@ -0,0 +1,99 @@ +--- +title: dist/docs/commands/ptk-rec-guc.md +summary: dist/docs/commands/ptk-rec-guc.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk rec-guc + +显示优化参数列表 + +## 语法 + +```bash +ptk rec-guc version1 [version2] [flags] +``` + +## 示例 + +```bash +# 打印指定数据库版本的优化参数列表 +# such as 5.0.5 +ptk rec-guc 5.0.5 + +# 比较两个版本之间的差异 +ptk rec-guc 3.0.5 5.0.5 +``` + +## 选项 + +### -t, --type string + +* 说明: 数据库类型,支持: [mogdb, uqbar] +* 数据类型: string +* 默认值: "mogdb" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v1.2.0 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-register.md b/product/zh/docs-ptk/v2.0/commands/ptk-register.md new file mode 100644 index 0000000000000000000000000000000000000000..a03beaeebfa168f83a7cd607ca78bc8b2e703977 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-register.md @@ -0,0 +1,80 @@ +--- +title: dist/docs/commands/ptk-register.md +summary: dist/docs/commands/ptk-register.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk register + +注册一些内部类型以满足特定需求 + +## 语法 + +```bash +ptk register [flags] +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-self-upgrade.md b/product/zh/docs-ptk/v2.0/commands/ptk-self-upgrade.md new file mode 100644 index 0000000000000000000000000000000000000000..171360f5093dc7a080858eba05ac7c327b2c28fd --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-self-upgrade.md @@ -0,0 +1,108 @@ +--- +title: dist/docs/commands/ptk-self-upgrade.md +summary: dist/docs/commands/ptk-self-upgrade.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk self upgrade + +下载并自动安装 PTK + +## 语法 + +```bash +ptk self upgrade [flags] +``` + +## 示例 + +```bash +# 在线自升级(需要网络) +ptk self upgrade + +# 升级到固定版本(需要网络), +# 比如目标版本是1.2.0 +ptk self upgrade -V 1.2.0 + +# 使用本地 ptk 安装包自升级 +ptk self upgrade -p +``` + +## 选项 + +### -p, --pkg string + +* 说明: 指定本地的 PTK 安装包 +* 数据类型: string +* 默认值: "" + +### -V, --to-version string + +* 说明: 指定要升级的版本 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk self](./ptk-self.md) - 关于 ptk 的自操作 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-self.md b/product/zh/docs-ptk/v2.0/commands/ptk-self.md new file mode 100644 index 0000000000000000000000000000000000000000..cb927c78b7a589e15f47ad4c61c1daa05c2108ab --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-self.md @@ -0,0 +1,71 @@ +--- +title: dist/docs/commands/ptk-self.md +summary: dist/docs/commands/ptk-self.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk self + +关于 ptk 的自操作 + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB +* [ptk self upgrade](./ptk-self-upgrade.md) - 下载并自动安装 PTK diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-template-create.md b/product/zh/docs-ptk/v2.0/commands/ptk-template-create.md new file mode 100644 index 0000000000000000000000000000000000000000..1849621c52e7a3cf6020b161266d898c11838609 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-template-create.md @@ -0,0 +1,94 @@ +--- +title: dist/docs/commands/ptk-template-create.md +summary: dist/docs/commands/ptk-template-create.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk template create + +交互式创建配置文件 + +## 语法 + +```bash +ptk template create [flags] +``` + +## 示例 + +```bash +ptk template create [-o config.yml] +``` + +## 选项 + +### -o, --output string + +* 说明: 指定输出文件名 +* 数据类型: string +* 默认值: "config.2024-06-04T17_04_56.yaml" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk template](./ptk-template.md) - 生成配置模板 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-template-mogha.md b/product/zh/docs-ptk/v2.0/commands/ptk-template-mogha.md new file mode 100644 index 0000000000000000000000000000000000000000..b7a3d511c89a601a18285809abeec7c120733f40 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-template-mogha.md @@ -0,0 +1,106 @@ +--- +title: dist/docs/commands/ptk-template-mogha.md +summary: dist/docs/commands/ptk-template-mogha.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk template mogha + +生成 MogHA 配置 + +## 语法 + +```bash +ptk template mogha [flags] +``` + +## 示例 + +```bash +ptk template mogha -n [--port 8081] > node.conf +``` + +## 选项 + +### -n, --cluster-name string + +* 说明: 集群名称 +* 数据类型: string +* 默认值: "" + +### -o, --output string + +* 说明: 指定输出文件名 +* 数据类型: string +* 默认值: "" + +### --port int + +* 说明: 指定 MogHA 监听端口 +* 数据类型: int +* 默认值: 8081 + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk template](./ptk-template.md) - 生成配置模板 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-template-scale-out.md b/product/zh/docs-ptk/v2.0/commands/ptk-template-scale-out.md new file mode 100644 index 0000000000000000000000000000000000000000..429ae90899186d9782e9643aa9817e51aa0e855b --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-template-scale-out.md @@ -0,0 +1,94 @@ +--- +title: dist/docs/commands/ptk-template-scale-out.md +summary: dist/docs/commands/ptk-template-scale-out.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk template scale-out + +生成扩容配置 + +## 语法 + +```bash +ptk template scale-out [flags] +``` + +## 示例 + +```bash +ptk template scale-out > scaleout.yml +``` + +## 选项 + +### -o, --output string + +* 说明: 指定输出文件名 +* 数据类型: string +* 默认值: "" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.4 + +## 另请参阅 + +* [ptk template](./ptk-template.md) - 生成配置模板 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-template.md b/product/zh/docs-ptk/v2.0/commands/ptk-template.md new file mode 100644 index 0000000000000000000000000000000000000000..c2eafc5f370b7f96baf8495638ada214b0ab5a36 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-template.md @@ -0,0 +1,134 @@ +--- +title: dist/docs/commands/ptk-template.md +summary: dist/docs/commands/ptk-template.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk template + +生成配置模板 + +## 语法 + +```bash +ptk template [flags] +``` + +## 示例 + +```bash +# 生成本地单实例配置模板 +ptk template -l > config.yml + +# 生成多实例集群的配置模板 +ptk template > config.yml + +# 自定义部分配置字段的值 +ptk template -n -u -g -d -p > config.yml +``` + +## 选项 + +### -d, --base-dir string + +* 说明: 指定数据库要安装的基目录 +* 数据类型: string +* 默认值: "/home/kylin/mogdb" + +### -n, --cluster-name string + +* 说明: 指定集群名称, 默认会随机生成 +* 数据类型: string +* 默认值: "" + +### -g, --group string + +* 说明: 指定系统用户组 +* 数据类型: string +* 默认值: "kylin" + +### -l, --local + +* 说明: 生成安装本地数据库的配置文件 +* 数据类型: bool +* 默认值: false + +### -p, --port int + +* 说明: 指定数据库端口 +* 数据类型: int +* 默认值: 26000 + +### -u, --user string + +* 说明: 指定系统用户名 +* 数据类型: string +* 默认值: "kylin" + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB +* [ptk template create](./ptk-template-create.md) - 交互式创建配置文件 +* [ptk template mogha](./ptk-template-mogha.md) - 生成 MogHA 配置 +* [ptk template scale-out](./ptk-template-scale-out.md) - 生成扩容配置 diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-uninstall.md b/product/zh/docs-ptk/v2.0/commands/ptk-uninstall.md new file mode 100644 index 0000000000000000000000000000000000000000..07e26391a4640870c79e2d207359dad70286c13b --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-uninstall.md @@ -0,0 +1,116 @@ +--- +title: dist/docs/commands/ptk-uninstall.md +summary: dist/docs/commands/ptk-uninstall.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk uninstall + +卸载数据库集群 + +## 语法 + +```bash +ptk uninstall [flags] +``` + +## 示例 + +```bash +# 按集群名称卸载 +ptk uninstall -n + +# 如果要避免交互,可在命令行提前提交交互问题的答案 +ptk uninstall -n --skip-confirm --remove-data y --remove-user y +``` + +## 选项 + +### -n, --name string + +* 说明: 指定要卸载的集群名称 +* 数据类型: string +* 默认值: "" + +### --remove-data string + +* 说明: 删除数据库数据, 选项: [y/n] +* 数据类型: string +* 默认值: "" + +### --remove-user string + +* 说明: 删除操作系统用户, 选项: [y/n] +* 数据类型: string +* 默认值: "" + +### --skip-confirm + +* 说明: 跳过第一个确认问题 +* 数据类型: bool +* 默认值: false + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 开始支持的版本 + +v0.2 + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk-version.md b/product/zh/docs-ptk/v2.0/commands/ptk-version.md new file mode 100644 index 0000000000000000000000000000000000000000..e3bbd42c2a2c7b69002421ce720c67a5eae80bbb --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk-version.md @@ -0,0 +1,76 @@ +--- +title: dist/docs/commands/ptk-version.md +summary: dist/docs/commands/ptk-version.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk version + +打印 PTK 版本 + +## 语法 + +```bash +ptk version [flags] +``` + +## 从父命令继承的选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +## 另请参阅 + +* [ptk](./ptk.md) - Provisioning Toolkit for MogDB diff --git a/product/zh/docs-ptk/v2.0/commands/ptk.md b/product/zh/docs-ptk/v2.0/commands/ptk.md new file mode 100644 index 0000000000000000000000000000000000000000..613c94428b25169e385847e2f9df5da0858625aa --- /dev/null +++ b/product/zh/docs-ptk/v2.0/commands/ptk.md @@ -0,0 +1,110 @@ +--- +title: dist/docs/commands/ptk.md +summary: dist/docs/commands/ptk.md +author: ptk +date: 2024-06-04T17:04:56+08:00 +--- + +# ptk + +Provisioning Toolkit for MogDB + +## 说明 + +PTK 是一款部署和管理MogDB数据库集群的命令行工具 + +## 语法 + +```bash +ptk [flags] [args...] +``` + +## 选项 + +### --disable-color + +* 说明: 禁用彩色日志 +* 数据类型: bool +* 默认值: false + +### --disable-debug-log + +* 说明: 不生成调试日志文件 +* 数据类型: bool +* 默认值: false + +### --disable-progressbar + +* 说明: 全局不显示进度条 +* 数据类型: bool +* 默认值: false + +### -h, --help + +* 说明: 打印帮助信息 +* 数据类型: bool +* 默认值: false + +### --log-file string + +* 说明: 指定运行日志文件路径 +* 数据类型: string +* 默认值: "" + +### --log-format string + +* 说明: 指定运行日志的输出格式, 可选项: [text, json] +* 数据类型: string +* 默认值: "text" + +### --log-level string + +* 说明: 指定运行日志级别, 可选项: [debug, info, warning, error, panic] +* 数据类型: string +* 默认值: "info" + +### --silence + +* 说明: 不打印日志到标准输出 +* 数据类型: bool +* 默认值: false + +### --skip-fix-ssh + +* 说明: 无需通过交互修复 ssh 连接 +* 数据类型: bool +* 默认值: false + +### -v, --version + +* 说明: 打印 PTK 版本 +* 数据类型: bool +* 默认值: false + +## 另请参阅 + +* [ptk cache](./ptk-cache.md) - 列出缓存文件 +* [ptk candidate](./ptk-candidate.md) - 打印 PTK 支持的软件版本列表 +* [ptk checkos](./ptk-checkos.md) - 检查集群服务器系统依赖是否满足安装数据库需求 +* [ptk cluster](./ptk-cluster.md) - 管理集群 +* [ptk collect](./ptk-collect.md) - 收集系统和集群信息用于分析 +* [ptk completion](./ptk-completion.md) - Generate the autocompletion script for the specified shell +* [ptk demo](./ptk-demo.md) - 快速部署本地示例 MogDB +* [ptk download](./ptk-download.md) - 在线下载 MogDB 安装包 +* [ptk encrypt](./ptk-encrypt.md) - 提供一个便捷的方式来加密您的文本或密码 +* [ptk env](./ptk-env.md) - 打印 PTK 加载的环境变量值 +* [ptk exec](./ptk-exec.md) - 执行 shell 命令或脚本 +* [ptk gen-om-xml](./ptk-gen-om-xml.md) - 生成 gs_om 的 XML 配置文件 +* [ptk gen-ptkc](./ptk-gen-ptkc.md) - 生成 ptkc 二进制文件 +* [ptk gen-static-config](./ptk-gen-static-config.md) - 使用指定的 YAML 配置生成一份新的集群静态文件并分发到数据节点 +* [ptk init-cluster](./ptk-init-cluster.md) - Generate a new empty cluster +* [ptk install](./ptk-install.md) - 安装 MogDB 或 Uqbar 数据库集群 +* [ptk ls](./ptk-ls.md) - 列出所有 MogDB 集群列表 +* [ptk manage](./ptk-manage.md) - Manage an exist cluster +* [ptk meta](./ptk-meta.md) - 管理 PTK 元数据 +* [ptk rec-guc](./ptk-rec-guc.md) - 显示优化参数列表 +* [ptk register](./ptk-register.md) - 注册一些内部类型以满足特定需求 +* [ptk self](./ptk-self.md) - 关于 ptk 的自操作 +* [ptk template](./ptk-template.md) - 生成配置模板 +* [ptk uninstall](./ptk-uninstall.md) - 卸载数据库集群 +* [ptk version](./ptk-version.md) - 打印 PTK 版本 diff --git a/product/zh/docs-ptk/v2.0/debug.md b/product/zh/docs-ptk/v2.0/debug.md new file mode 100644 index 0000000000000000000000000000000000000000..cde6adf40210f7e0c2634ae67ad2b3236618a8a0 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/debug.md @@ -0,0 +1,334 @@ +--- +title: 故障排查 +summary: 故障排查 +author: Yao Qian +date: 2022-05-30 +--- + +## 故障排查 + +### 错误码 4xxx + +#### PTK-4001 + +该错误码代表配置文件中对应服务器的用户和用户组配置不能设置为 root,请修改为普通用户即可 + +#### PTK-4002 + +该错误码代表配置文件中使用了不合理的端口号,PTK 对于端口的配置仅接受 [1024, 65534] 区间内的端口号 + +#### PTK-4003 + +该错误码代表错误提示的 IP 为一个无效的 IP 字符串 + +#### PTK-4004 + +该错误码代表在配置文件中,数据目录 (data_dir) 配置的目录不能为应用目录 (app_dir) 的子目录,请修改数据目录即可。 + +#### PTK-4005 + +该错误码代表提示的目录路径是一个相对路径,PTK 的运行是通过远程操作的,相对路径是不可靠的路径配置,所以请将相对路径修改为绝对路径即可 + +#### PTK-4006 + +该错误码代表目录路径中包含非法的字符,请检查配置文件中对应的字段 + +#### PTK-4007 + +该错误码代表配置文件中指定了一个无效的数据库角色,数据库角色需要确保为 primary/standby/cascade_standby 之一 + +#### PTK-4008 + +该错误码代表 PTK 接收到了一个无效的 URL 字符串 + +#### PTK-4010 + +该错误码代表目标系统缺少必要的工具,无法进行系统检查,请在目标系统上安装提示的必要依赖工具即可 + +#### PTK-4011 + +该错误码代表执行的命令缺少了必要的参数,请通过运行命令的参数 --help 来查看使用说明 + +#### PTK-4012 + +该错误码代表指定的集群名称已经被其他集群使用,请修改一个新的集群名称即可 + +#### PTK-4013 + +该错误码代表指定的端口已经被占用,可以通过关闭占用端口的进程或者修改配置使用其他新的端口解决 + +#### PTK-4014 + +该错误码代表在同一个集群中不同的服务器上操作系统的发行版信息不一致,PTK 强烈建议在部署数据库集群时,集群内的所有服务器的操作系统需保持一致 + +#### PTK-4015 + +该错误码代表 PTK 无法识别提示的 CPU 架构 + +#### PTK-4017 + +该错误码代表提示的名称字符串中包含非法的字符,名称在定义时仅允许包含字母、数字、短横线(-)、下划线(_)和点(.) + +#### PTK-4018 + +该错误码代表集群的名称不能为空 + +#### PTK-4019 + +该错误码代表集群名称是 PTK 的内部保留关键词,请更换为其他名字即可 + +#### PTK-4020 + +该错误码代表安装时配置文件中没有配置任何 db_server + +#### PTK-4021 + +该错误码代表执行 checkos 命令时指定了无效的检查项编号 + +#### PTK-4022 + +该错误码代表在安装数据库时,指定了跳过检查操作系统发行版,但没有指定安装包的路径,此时 PTK 无法自动判断应该使用何种安装包。所以在安装时的命令中,通过 -p 或 --pkg 指定安装包路径即可 + +#### PTK-4023 + +该错误码代表命令行没有指定配置文件,通过 -f 指定即可 + +#### PTK-4024 + +该错误码代表在配置文件中,数据库实例的上游实例不能设置为自己,需指定另一个实例的 IP + +#### PTK-4025 + +该错误码代表在配置文件中设置了某个数据库实例的上游实例 IP,但是上游实例的 IP 没有在当前集中找到,这种一般是上游 IP 配置错误导致 + +#### PTK-4026 + +该错误码代表在配置文件中没有找到角色为 primary 的数据库实例 + +#### PTK-4027 + +该错误码代表在配置文件中级联备的上游 IP 设置上了主库的地址,级联备的上游须为备库的 IP + +#### PTK-4028 + +该错误码代表在配置文件中存在多个角色为 primary 的数据库实例配置,请确保一个集群配置中仅存在一个主库配置 + +#### PTK-4029 + +该错误码代表配置文件中级联备库的上游实例 IP 没有配置,当角色为 cascade_standby 使,上游实例字段 upstream_host 就变为了必填字段 + +#### PTK-4030 + +该错误码代表指定的集群名不存在 + +#### PTK-4031 + +该错误码代表数据库密码长度需为8~16个字符 + +#### PTK-4032 + +该错误码代表交互输入密码的场景时,前后两次输入的密码不一致 + +#### PTK-4033 + +该错误码代表配置文件中数据库实例的个数太多,超过了9个,由于数据库本身的限制,一个集群内实例的数量最多只能为9个 + +#### PTK-4034 + +该错误码代表配置文件中 xlog 的目录不能为数据库目录 (data_dir) 的子目录 + +#### PTK-4035 + +该错误码代表在配置文件中非本机IP的服务器(远程服务器)均必须设置 ssh_option 字段(global 中也没有设置),错误会列出没有配置的服务器列表 + +#### PTK-4036 + +该错误码代表在配置文件中密码类型的字段没有使用 PTK encrypt 加密,出于安全考虑,密码类型的字段不允许明文提交 + +#### PTK-4037 + +该错误码代表在 MogDB 2.1.0 版本之前,并不支持插件的安装(没有发布过对应的插件) + +#### PTK-4038 + +该错误码代表交互确认场景时,用户选择了取消确认 + +#### PTK-4039 + +该错误码代表在安装 CM 集群时至少需要配置 2 个服务器 + +#### PTK-4040 + +该错误码代表在配置文件中基础目录(base_dir) 被用于同一个服务器的不同实例 + +#### PTK-4041 + +该错误码代表在安装两节点 CM 集群时,不允许设置数据库参数 enable_dcf=on + +#### PTK-4042 + +该错误码代表提示的服务器上的用户已经被 PTK 管理的其他的集群使用了,一个服务器上的一个用户不允许安装多个数据库实例。 + +#### PTK-4043 + +该错误码代表在配置文件的 global.cm_option.cm_server_conf 中需配置 third_party_gateway_ip 参数来指定网关IP, +这个错误出现于在安装两节点 CM 集群的场景,且安装时指定了 -y,两节点CM时,该参数是必填参数, +所以可以手动在配置文件中配置,或者去掉 -y 参数通过和 PTK 交互形式进行实时填写。 + +#### PTK-4044 + +该错误码代表提示的数据节点没有处于运行当中,可以通过 ptk cluster status 来确认实例状态 + +#### PTK-4045 + +该错误码代表在交互时场景下,超过了指定的重试次数导致退出 + +#### PTK-4046 + +该错误码代表配置文件中服务器的 host 字段不能为空 + +### 错误码 5xxxx + +#### PTK-50000 + +该错误码代表 PTK 在调用系统执行指令时的运行时错误,需根据实际错误信息判断错误原因 + +#### PTK-50001 + +该错误码代表 bash 脚本在目标服务器上执行失败 + +#### PTK-50101 + +该错误码代表序列化配置文件失败 + +#### PTK-50102 + +该错误码代表反序列化配置文件失败 + +#### PTK-50103 + +该错误码代表保存配置文件到本地失败 + +#### PTK-50105 + +该错误码代表指定的数据目录已经被一个正在运行的数据库实例在使用中 + +#### PTK-50106 + +该错误码代表在当前集群中没有找到用户指定 IP 的实例 + +#### PTK-50107 + +该错误码代表配置文件异常为空 + +#### PTK-50108 + +该错误码代表在当前集群中没有找到用户指的 ID 的实例 + +#### PTK-50201 + +该错误码代表提示的服务器上的目录已经存在 + +#### PTK-50202 + +该错误码代表创建目录失败 + +#### PTK-50203 + +该错误码代表创建文件失败 + +#### PTK-50204 + +该错误码代表读取本地元数据文件失败 + +#### PTK-50205 + +该错误码代表提示的文件已经存在 + +#### PTK-50206 + +该错误码代表路径中存在非法的字符 + +#### PTK-50207 + +该错误码代表提示的目录中不为空 + +#### PTK-50208 + +该错误码代表创建临时目录失败 + +#### PTK-50209 + +该错误码代表没有找到指定的集群 + +#### PTK-50210 + +该错误码代表提示的目录不存在 + +#### PTK-50211 + +该错误码代表提示的文件已经存在 + +#### PTK-50301 + +该错误码代表提示的用户已经存在 + +#### PTK-50302 + +该错误码代表提示的用户不存在 + +#### PTK-50303 + +该错误码代表用户组不匹配 + +#### PTK-50304 + +该错误码代表提示的文件或目录不属于指定用户,也就是文件的属主权限不对 + +#### PTK-50305 + +该错误码代表提示的用户没有 sudo 权限,一般是出现于依赖超级用户权限的场景 + +#### PTK-50601 + +该错误码代表请求指定的 URL 失败 + +#### PTK-50602 + +该错误码代表读取 HTTP 响应失败 + +#### PTK-50603 + +该错误码代表获取网卡的 bonding 信息失败 + +#### PTK-50604 + +该错误码代表探测网卡信息失败 + +#### PTK-50801 + +该错误码代表目标系统没有找到提示的 CPU 指令集,缺少某些必要的指令集可能导致数据库进程无法启动 + +#### PTK-50802 + +该错误码代表提示的命令未找到 + +#### PTK-50803 + +该错误码代表无效的 sysctl 配置 + +#### PTK-50804 + +该错误码代表 RemoveIPC 的配置必须为 no + +#### PTK-50805 + +该错误码代表未找到指定的依赖,需要先手动安装 + +### 其他错误 + +PTK 对于内部固定的错误类型设置了错误码,但也存在运行时依赖的库或系统抛出的其他错误, + +这些错误需用户根据错误提示,查看对应的系统或运行参数来进行修复,我们也会收集一些场景的错误来列举到 [FAQ](./faq.md) 页面。 + +但我们可能收集的不全面,如果您在使用过程中不能够自己解决的话,可以通过墨天轮的[问答频道](https://www.modb.pro/issue)进行提问,我们的开发者也会及时关注并回复。(注意在提问是添加 `ptk` 标签哦) diff --git a/product/zh/docs-ptk/v2.0/faq.md b/product/zh/docs-ptk/v2.0/faq.md new file mode 100644 index 0000000000000000000000000000000000000000..0d9d86e925bc37ed20aa7c3cb6e5a79f6dfecbee --- /dev/null +++ b/product/zh/docs-ptk/v2.0/faq.md @@ -0,0 +1,111 @@ +--- +title: FAQ +summary: FAQ +author: Yao Qian +date: 2022-05-30 +--- + +# FAQ + +## 常见问题 + +### 是否可以以非 root 用户安装 ptk + +可以,PTK 对自身的运行用户没有要求。 + +### 是否可以通过普通用户SSH连接安装数据库集群 + +可以。在部署集群时,配置文件中链接数据库服务的 SSH 用户一般建议设置为具有 sudo 权限的超级用户,这样PTK可以自动创建运行数据库的普通用户并配置用户的 ulimit 参数等。如果无法提供超级权限用户,您也可以预先在数据库服务器上创建好系统用户,然后在PTK的配置文件使用该系统用户配置ssh链接信息进行安装数据库集群,但无法执行安装 MogHA 等需要 sudo 权限的组件。 + +### 是否需要预装 Python3? + +需要,且版本需为 python3.6 或者 python 3.7,因为 om 包中提供的预编译好的 psutil 动态库目前仅支持这两个版本。 + +> ptk 和 mogdb 本身不依赖 python3,gs_om、gs_guc 等工具依赖,所以建议预装好,保证环境使用顺利。 + +### 能否在 PTK 未支持的操作系统版本上使用 PTK 进行数据库安装? + +可以。 + +PTK 本身提供完整通用的安装流程,默认情况下,PTK 会针对客户系统自动判断需要下载的数据库安装包类型,但对于超出 PTK 支持的操作系统或版本,PTK 无法为用户决定应该使用哪个安装包,此时,用户可以通过 ptk install 提供的 `-p` 参数来指定安装包安装,但由于未测试过,不一定能够正常启动,这是很正常的。 + +用户在决定自己的系统应该尝试使用哪个安装包时,可以参考如下规则: + +1. 优先判断 CPU 指令集架构 + + ```bash + uname -m + ``` + + `arm64/aarch64` 的情况考虑使用 openEuler arm64 安装包 + + `x86_64` 继续判断 + +2. 其次根据内核 glibc 版本判断 + + ```bash + getconf GNU_LIBC_VERSION + ``` + + 如果 glibc 版本小于等于 2.17,考虑使用 centos7 x86_64 的安装包,否则考虑使用 openEuler x86_64 的安装包 + +### PTK安装后,是否还支持 gs_om 操作? + +支持。PTK 安装的集群兼容 gs_om 工具,但不支持 gs_upgrade、gs_expansino、gs_dropnode 等涉及集群结构变更的工具。 + +> 注意:`gs_om` 的操作需要是节点之间的用户SSH互信,PTK 安装后会自动建立,若未创建需用户自行建立。 + +### PTK 如何查看目前可支持安装的mogdb版本? + +执行 `ptk candidate db` 指令查看 + +### PTK 如何查看目前可支持安装的操作系统? + +执行 `ptk candidate os` 指令查看 + +### 是否支持安装 CM 组件? + +支持。 在安装数据库集群时,通过指定 `--install-cm` 参数即可自动安装CM组件。 + +### PTK 必须和数据库在同一个服务器上吗? + +不是的。PTK 工具是中心化多集群管理工具,所以我们更推荐 PTK 独立在一个管理服务器上安装,数据库在数据库专用的服务器集群内节点上安装。 + +## 常见报错 + +### 安装时报错:cmd init: ssh: setenv failed + +该错误是由于目标服务器的 sshd 服务不接受创建连接时设置 LANG 环境变量,需在目标服务器上执行以下命令更新一下 sshd 的配置文件,然后重启 sshd 服务即可: + +``` +sudo echo "AcceptEnv LANG LC_*" >> /etc/ssh/sshd_config && sudo systemctl restart sshd +``` + +### 初始化数据库报错:undefined symbol: EVP_KDF_ctrl + +使用的安装包和机器的系统不匹配,此错误一般出现于在 glibc 版本较高的系统上使用 centos7 的安装包进行安装。 + +解决方法就是改用 openEuler 的安装包进行安装即可。 + +### 报错:can not combine with 'abrt-hook-ccpp' + +使用 abrt(automatic bug report too) 服务代理 coredump 文件,有可能导致 core 文件丢失或者数据库宕机的风险。 + +*[什么是abrt服务](https://abrt.readthedocs.io/en/latest/howitworks.html)* + +可通过修改 `kernel.core_pattern` 参数的值修复。 + +```bash +# 值根据需求可自定义 +sysctl -w kernel.core_pattern=/var/log/coredump/%e.%p.%u.%t.core +``` + +### 查询的状态报错 `FATAL: semctl(578486307, 7, SETVAL, 0) failed: Invalid argument` + +请检查服务器 /etc/systemd/logind.conf 中 **RemoveIPC** 的值是否为 `no`,修改后重启服务器 + +### 报错 fail to new sftp client: EOF + +这个错误代表 PTK 在和目标机器创建 sftp 连接时失败,可以通过手动在 PTK 的机器上去执行 `sftp -vvv USER@HOST` 去查看调试日志里的报错信息。 + +一般是由于目标机器的 `/etc/ssh/sshd_config` 文件里的 `Subsystem sftp` 配置的 sftp-server 文件不存在或无法访问导致 diff --git a/product/zh/docs-ptk/v2.0/guide/guide-checkos.md b/product/zh/docs-ptk/v2.0/guide/guide-checkos.md new file mode 100644 index 0000000000000000000000000000000000000000..ba5ff90137c3ba99453cb0e0eda705b97ebe69d5 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/guide-checkos.md @@ -0,0 +1,83 @@ +--- +title: 系统检查 +author: Yao Qian +date: 2024-06-10 +--- + +# 系统检查 + +在安装数据库之前,您需要先对要安装数据库的服务器进行一下系统参数以及软件依赖等检查,确保安装过程可以顺利进行。 + +> PTK 在检查过程中给出的系统参数值为**数据库在生产环境**中的建议值,不同系统版本或硬件配置存在参数差异,用户可根据自己的环境进行调优。 + +## 检查项列表 + +PTK 提供了 `checkos` 的指令来辅助您进行操作系统检查操作,在检查过程中,PTK 会对服务器上的这些模块进行检查: + +| 类别编号 | 类别 | 检查项 | 说明 | +| -------- | ------------ | ----------------------------- | -------------------- | +| A1 | 系统版本 | Check_OS_Version | 检查系统版本 | +| A2 | 内核版本 | Check_Kernel_Version | 检查内核版本 | +| A3 | 字符集 | Check_Unicode | 检查字符集 | +| A4 | 时区 | Check_TimeZone | 检查时区 | +| A5 | 内存交换区 | Check_Swap_Memory_Configure | 检查 swap 内存配置 | +| A6 | sysctl参数 | Check_SysCtl_Parameter | 检查 sysctl 参数 | +| A7 | 文件系统 | Check_FileSystem_Configure | 检查文件系统配置 | +| A8 | 磁盘配置 | Check_Disk_Configure | 检查磁盘配置 | +| A9 | 预读块设置 | Check_BlockDev_Configure | 检查块设备配置 | +| | | Check_Logical_Block | 检查逻辑块 | +| A10 | IO调度 | Check_IO_Request | 检查 IO 请求参数 | +| | | Check_Asynchronous_IO_Request | 检查异步 IO 请求参数 | +| | | Check_IO_Configure | 检查 IO 配置 | +| A11 | 网络配置 | Check_Network_Configure | 检查网络配置 | +| A12 | 时钟一致性 | Check_Time_Consistency | 检查时钟一致性 | +| A13 | 防火墙配置 | Check_Firewall_Service | 检查防火墙配置 | +| A14 | 透明大页配置 | Check_THP_Service | 检查透明大页配置 | +| A15 | 依赖包 | Check_Dependent_Package | 检查数据库系统安装依赖 | +| A16 | CPU指令集 | Check_CPU_Instruction_Set | 检查CPU指令集 | +| A17 | 端口状态 | Check_Port | 检查数据库端口是否被占用 | +| A18 | Selinux状态 | Check_Selinux | 检查系统Selinux是否关闭 | +| A19 | 用户Ulimit状态 | Check_User_Ulimit | 检查数据库用户的 Ulimit 值是否满足数据库要求(系统用户存在时) | +| A20 | 数据目录检查 | Check_Directory | 如果数据库的数据目录已经存在时,检查其是否为空 | + +在使用 PTK 进行系统检查时,需通过 `-f` 参数指定集群[配置文件](./guide-prepare-config.md) 来告诉 PTK 要检查的服务器,默认 PTK 会检查上述表格中所有的检查项。如果希望针对特定的检查项进行检查,可以在命令行通过 `-i` 参数进行指定对应的检查类别编号,多个编号时通过英文逗号进行分隔即可。 + +## 示例 + +```shell +# 检查全部检查项 +ptk checkos + +# 加上--detail 会显示详细错误信息 +ptk checkos --detail + +# 显式的知道要检查的多个检查类别 +ptk checkos -i A1,A2,A3 +``` + +## 检查结果分类 + +PTK 的检查结果分为四个等级: + +- **OK**:符合预期值,满足安装需求 +- **Warning**: 不符合预期值,但不影响安装(预期值主要针对生产环境进行的建议) +- **Abnormal**: 不满足安装要求,可能会导致安装过程失败,需根据 PTK 给出的修改建议脚本,人工执行修改 +- **ExecuteError**: 执行错误,该等级表示 PTK 在检查时执行命令失败,可能为用户环境工具缺失或内部BUG,需根据实际错误提示进行修正 + +在安装数据库之前,需确保所有的检查项都在 **OK** 或 **Warning** 级别,如果存在 **Abnormal** 的检查结果,在安装时会中断退出。 + +## 修复系统 + +PTK 在执行了 `checkos` 的命令后,如果存在 **Abnormal** 项目,会在当前目录下生成一个以 `root_fix_os` 为前缀的 shell 脚本文件。 + +您可以打开该文件进行查看里面的内容,文件包含了 PTK 针对 **Abnormal** 项目给出的修复建议。 + +> 在脚本中默认不生成 `Warning` 级别的修复建议,如果需要,需在 `checkos` 执行时,增加 `--gen-warning-fix` 参数 + +您可以手动执行脚本中的修复指令,也可以通过 PTK 自动在集群内所有机器上执行该脚本来进行系统修复: + +> 因为修复的指令一般都需要超级用户权限,所以在通过 exec 指令修复时,提供的 config.yaml 中的SSH 用户需为 root 或具有 sudo 免密执行的权限 + +```shell +ptk exec -f config.yaml -s +``` diff --git a/product/zh/docs-ptk/v2.0/guide/guide-collectos.md b/product/zh/docs-ptk/v2.0/guide/guide-collectos.md new file mode 100644 index 0000000000000000000000000000000000000000..fff6426b4d8401dec13764f85df27f6467e257be --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/guide-collectos.md @@ -0,0 +1,23 @@ +--- +title: 收集运行环境信息 +author: Yao Qian +date: 2024-06-10 +--- + +# 收集运行环境信息 + +在使用 PTK 或 MogDB 时,不可避免的会遇到由于运行环境变化或者其他因素导致的软件运行故障,不论是 PTK 运行报错还是 MogDB 的异常退出,我们都需要尽可能的将故障现场的环境信息保留下来以便于专业人员更进一步的分析和排查。所以 PTK 提供了一个可以快速收集系统环境信息的命令,方便用户可以在向开发人员反馈问题时作为附件一并反馈。 + +收集本机信息的命令为: + +```shell +ptk collect +``` + +执行该命令后,会在当前目录下生成一个以 `ptk-collect` 的压缩包文件,用户可以打开复查里面的内容。 + +如果要针对某个集群进行信息收集信息,可以通过 `-n` 参数指定: + +```shell +ptk collect -n +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/guide-download-package.md b/product/zh/docs-ptk/v2.0/guide/guide-download-package.md new file mode 100644 index 0000000000000000000000000000000000000000..d62411c02fac614284d5cbec03e61cab6a5398df --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/guide-download-package.md @@ -0,0 +1,40 @@ +--- +title: 下载MogDB安装包 +author: Yao Qian +date: 2024-06-10 +--- + +# 下载MogDB安装包 + +## 下载符合当前系统的安装包 + +PTK 除了提供 MogDB 部署和运维能力,还支持单独下载 MogDB 安装包,PTK 默认会自动识别所在服务器的环境,并下载符合所在服务器操作系统和 CPU 架构的对应安装包: + +```shell +ptk download +``` + +## 指定 MogDB 版本下载 + +当然,您也可以通过 `-V` 或 `--db-version` 参数来指定希望下载的 MogDB 版本 + +```shell +ptk download -V 5.0.7 +``` + +## 指定操作系统下载 + +如果该命令报 `no support current os` 的错误,代表 MogDB 没有提供当前操作系统的安装包,可以通过 `-O` 或 `--os` 来指定目标操作系统的 `ID` ,这个 `ID` 可以通过 `ptk candidate os` 查看: + +```shell +# 下载 centos7 x86_64 的安装包 +ptk download -O 1007010 +``` + +## 仅演示下载流程,不执行下载 + +有时,我们可能想知道符合当前操作系统的包的下载地址是什么,但不需要真正下载安装包,此时,您可以通过在命令行增加 `--dryrun` 参数,这样就只会输出执行流程日志,并不会真正下载安装包: + +```shell +ptk download --dryrun +``` diff --git a/product/zh/docs-ptk/v2.0/guide/guide-encrypt.md b/product/zh/docs-ptk/v2.0/guide/guide-encrypt.md new file mode 100644 index 0000000000000000000000000000000000000000..438c9c1718d70b288688863ee694aef2c5961fb5 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/guide-encrypt.md @@ -0,0 +1,38 @@ +--- +title: 加密敏感信息 +author: Yao Qian +date: 2023-06-14 +--- + +# 加密敏感信息 + +## 介绍 + +在编写[配置文件](./guide-prepare-config.md)时,如果要填写密码字段时,为了安全考虑,PTK 不允许在配置文件中直接填写明文信息,必须使用 PTK 提供的 `encrypt` 命令进行加密后再填写。 + +配置文件中的密码字段包含: + +- global.[user_password](../reference/ref-config.md#user_password) +- global.[db_password](../reference/ref-config.md#db_password) +- ssh_option.[password](../reference/ref-config.md#password) +- ssh_option.[passphrase](../reference/ref-config.md#passphrase) + +## 加密方式 + +- 将密码作为参数加密(建议将密码通过单引号包裹起来,避免密码中存在特殊字符被 shell 解析) + + ```shell + ptk encrypt '密码' + ``` + +- 交互式输入密码 + + ```shell + ptk encrypt --stdin + ``` + +- 通过管道传递密码给 PTK + + ```shell + echo '密码' | ptk encrypt --stdin [--disable-prompt] + ``` diff --git a/product/zh/docs-ptk/v2.0/guide/guide-install-cluster.md b/product/zh/docs-ptk/v2.0/guide/guide-install-cluster.md new file mode 100644 index 0000000000000000000000000000000000000000..ba7c9254472eb10b533d977dfd57fae9ed60f08b --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/guide-install-cluster.md @@ -0,0 +1,171 @@ +--- +title: 部署数据库集群 +author: Yao Qian +date: 2024-06-10 +--- + +# 部署数据库集群 + +## 推荐流程 + +在部署数据库集群时,建议您按照如下流程来进行操作: + +1. 准备描述集群的[配置文件](./guide-prepare-config.md) +2. 对部署的服务器进行操作[系统检查](./guide-checkos.md),确保安装前操作系统不存在异常的检查项 +3. (*有网络的话可以省略*)从官网[下载](https://www.mogdb.io/downloads/mogdb/all)要安装的数据库版本的对应操作系统的安装包 +4. 进行数据库集群安装 + +## 数据库集群安装 + +### 说明 + +由于 PTK 的所有行为都是基于 SSH 连接来进行指令下发的,所以在配置文件中我们要求为每个数据库服务器都需要配置 `ssh_option` 字段,当然如果所有服务器拥有相同的连接用户、端口和密码的话,仅需要在 `global` 块中配置一份 `ssh_option` 即可。 + +对于在 `ssh_option` 中的登录用户,我们推荐您直接配置 **root** 用户或者具有 **sudo** 免密权限的用户,由于数据库作为一个基础软件,其对系统的要求相对于应用来说,可能更为苛刻,所以需要借助超级用户权限来给运行数据库的系统用户设置更宽容的 ulimit 配置,同时,提供超级用户的话,您无需提前创建运行数据库的操作系统用户,只需在配置文件中定义好用户名,PTK会自动为您创建好相应的用户,并设置好 ulimit 配置。 + +当然,如果处于企业安全性强制要求下的话,有可能无法满足 root 用户直接登录的条件,也是可以使用 PTK 进行部署的。这种情况下,您需要提前做以下 3 步: + +1. 提前在服务器上创建好用于运行数据库的操作系统用户(假设用户名为 `omm`) +2. 在 `/etc/security/limits.conf` 文件末尾为该用户增加以下配置项( `omm` 替换为您创建的用户名): + + ``` + omm soft as unlimited + omm hard as unlimited + omm soft nproc unlimited + omm hard nproc unlimited + omm soft nofile 1000000 + omm hard nofile 1000000 + omm soft stack unlimited + omm hard stack unlimited + ``` + +3. 在配置文件中的 `ssh_option` 配置为您创建的用户的登录信息 + +> 注:如果使用非超级用户进行集群管理,部分依赖超级权限的命令后续也无法使用,比如 `install-mogha` + +### 在线安装 + +安装仅需一行指令即可完成: + +```shell +ptk install -f config.yaml +``` + +该命令会自动从网络上下载 MogDB 的最新的 LTS 版本数据库安装包进行安装,如果您希望自己指定 MogDB 的版本,可以通过 `--db-version` 参数进行指定,例如: + +```shell +ptk install -f config.yaml --db-version 5.0.7 +``` + +可以通过 `ptk candidate db` 查看 PTK 支持自动下载的 MogDB 版本列表。 + +在安装完数据库集群后,PTK 默认会将数据库集群启动,如果您不希望安装完成后自动启动集群,可以在命令行指定 `--skip-launch-db` 参数。 + +### 离线安装 + +如果您提前下载好了安装包,可以通过 `-p` 参数指定本地安装包进行离线安装: + +```shell +ptk install -f config.yaml -p <安装包> +``` + +### 同时部署 CM 集群 + +PTK 支持在部署数据库集群的同时一同把 CM 集群部署好,您仅需在安装的命令中增加一个 `--install-cm` 参数即可: + +> 集群最少 2 节点才生效 + +```shell +ptk install -f config.yaml --install-cm +``` + +默认 PTK 会将 `CM server` 和数据库实例部署在一起,和数据库的数量保持一致。如果集群的数量大于 3 个以上时,由于 CM 高可用采用的多数派选举算法要求,默认我们推荐是部署奇数个 `CM server` 节点,所以当部署偶数个数据库实例时, PTK 会通过交互来让您选择一个节点不部署 `CM server`。您如果仍希望 `CM server` 和数据库实例的个数保持一致,可以通过在安装命令里增加 `--not-limit-cm-nodes` 参数来取消该限制。 + +### 资源池化部署(beta) + +虽然目前内核资源池化的特性还处于深度研发中,但 PTK 在 1.2.0 版本开始就逐渐支持了资源池化的部署。资源池化的部署方式,提供主备机共享一份存储的能力,实现基于磁阵设备的资源池化HA部署形态,解决传统HA部署下存储容量较单机翻倍的问题,同时备机支持实时一致性读。 + +资源池化架构图如下图所示 (图片来源:[openGauss 官网](https://docs-opengauss.osinfra.cn/zh/docs/5.0.0/docs/AboutopenGauss/%E8%B5%84%E6%BA%90%E6%B1%A0%E5%8C%96.html)): + +![资源池化架构图](https://docs-opengauss.osinfra.cn/zh/docs/5.0.0/docs/AboutopenGauss/figures/Resource-pooling-architecture-diagram.jpg) + +PTK 支持资源池化场景的部署,由于资源池化的架构中新增了 `DSS` 模块,同时依赖 CM 对于集群的高可用管理,所以我们需要在配置文件中增加 `dss_option` 和 `cm_option` 的配置,以下为一个示例配置: + +```yaml +global: + cluster_name: c1 + user: omm + db_password: pTk6Y2I1OWFiZjI8RT1FPUE9RFZfVTUzTy0zUlR5TDZUTmh1STE4VkQ0T2RDYXBNMThoSlNhZDY3UHB4WVE= + db_port: 26000 + base_dir: /data/mogdb + ssh_option: + port: 22 + user: root + password: pTk6ZDJmZjZlZjI8RT1FPUE9RUs4WEh1OUJRQURfM29GUjZyb3gzZGU3LVRmLTM3Mm5ySmZ5anJXVkNOTUE= + cm_option: + dir: /data/mogdb/cm + cm_server_port: 15300 + dss_option: + dir: /data/mogdb/dss + dss_port: 26010 + dms_port: 26020 + data_vg_name: data + data_vg_path: /dev/data_shared + inst_vg_map: + 172.23.1.28: /dev/data_private_28 + 172.23.1.45: /dev/data_private_45 + cm_share_vg_path: /dev/cm_shared + cm_voting_vg_path: /dev/cm_vote + enable_ssl: on +db_servers: + - host: 172.23.1.28 + role: primary + - host: 172.23.1.45 + role: standby +``` + +其他配置和普通安装一样,我们重点看下 `dss_option` 字段。 + +在 `dss_option` 字段中,有以下配置: + +| 字段名 | 说明 | +|---|---| +|dir| dss 模块的安装目录 | +|dss_port| dssserver 进程运行时监听的端口,默认 `26010` | +|dms_port| 资源池化模式时数据库内核之间通信的端口, 默认 `26020` | +|data_vg_name| 自定义共享数据卷名,默认为 `data` | +|data_vg_path| 共享数据卷磁盘设备路径 | +|inst_vg_map | 每个数据库实例的私有盘路口映射,键为数据库实例IP,值为对应实例的私有数据盘路径 | +|cm_share_vg_path| CM 共享盘设备路径 | +|cm_voting_vg_path| CM 投票盘设备路径 | +|enable_ssl| 是否使用 SSL 加密通信| + +准备好配置文件后,仅需在安装的命令中增加 `--enable-dss` 参数即可: + +```shell +ptk install -f config.yaml --enable-dss +``` + +### 更多参数 + +以上文档举例给出来不同使用场景的一些参数组合,PTK 的 `install` 命令还支持很多的参数,可以通过查看[命令文档](../commands/ptk-install.md)来进一步的了解。 + +## 安装结果状态 + +|状态|说明| +|:--|:--| +|precheck_success|安装前预检查成功| +|precheck_failed|安装前预检查失败| +|setup_db_success|数据库实例安装成功| +|setup_db_failed|数据库实例安装失败| +|setup_cm_success|CM组件实例安装成功| +|setup_cm_failed|CM组件实例安装失败| +|init_dss_failed|初始化DSS组件失败| +|init_dss_success|初始化DSS组件成功| +|initdb_failed|初始化数据库失败| +|initdb_success|初始化数据库成功| +|rollback_success|安装步骤回滚成功| +|need_rollback_manually|需要手动回滚| +|start_success|数据库启动成功| +|start_failed|数据库启动失败| +|need_start_manually|需要手动启动| \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/guide-prepare-config.md b/product/zh/docs-ptk/v2.0/guide/guide-prepare-config.md new file mode 100644 index 0000000000000000000000000000000000000000..438e5763767298d529571fc1336f2eed71fa7851 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/guide-prepare-config.md @@ -0,0 +1,203 @@ +--- +title: 准备配置文件 +author: Yao Qian +date: 2024-05-30 +--- + +# 准备配置文件 + +## 配置文件简介 + +在安装数据库之前,需通过 PTK 来创建一个[配置文件](../reference/ref-config.md),用于描述期望的数据库集群拓扑结构。 + +如果要安装本地单实例数据库,可以通过以下命令生成模板配置文件: + +```shell +ptk template -l > config.yaml +``` + +如果要安装多实例集群,则可以通过以下命令生成模板配置文件: + +```shell +ptk template > config.yaml +``` + +运行后会在当前文件夹内生成 `config.yaml` 文件,用户需根据自己的服务器和目录规划修改相关配置。 + +如果存在密码字段,用户需通过 [ptk encrypt](../commands/ptk-encrypt.md) 指令加密后写入配置文件。 + +> 注意: +> 如果您希望 PTK 使用非 root 用户来 SSH 连接目标机器操作, 请确保该用户在目标机器上具有免密执行 sudo 的权限, +> 配置方式:可在目标机器上的 /etc/sudoers 文件中新增如下一行(USERNAME 替换为SSH连接用户名) : +> `[USERNAME] ALL=(ALL) NOPASSWD:ALL` + +## 交互式创建 + +PTK 也支持通过交互式方式创建配置文件,只需执行如下命令: + +```shell +ptk template create +``` + +执行后,会进入交互式终端,用户只需根据提示的问题,逐个填写即可。 + +注意,在填写 `db_servers` 时,SSH 的登录信息如果相同可重复使用。 + +当交互式终端退出后,会自动在当前文件夹下创建一个 `config.yaml` 的文件。 + +## 配置文件字段说明 + +我们以下面这个完整的配置文件为例说明: + +*yaml 语法中,如果是字符串类型默认无需加引号,如果字符串之中包含空格或特殊字符,需要放在引号之中,更多语法内容请参考[附录:YAML语法](../appendix/yaml-grammar.md)* + +```yaml +global: + # 集群名称,用户自定义 + cluster_name: c1 + # 运行数据的系统用户 + user: omm + # 系统用户组,默认和用户名同名 + group: omm + # 系统用户密码,PTK在创建用户时设置,可不填。若填写需通过 ptk encrypt 加密 + user_password: "" + # 数据库密码,需通过 ptk encrypt 加密。若不填写,在安装时会通过交互式填写 + db_password: "" + # 数据库端口 + db_port: 26000 + # 数据库的安装目录 + # PTK 会在该目录下分别创建应用目录,数据目录,工具目录,日志目录以及临时目录 + base_dir: /opt/mogdb + # gs_initdb 工具支持参数列表,安装时会追加到指令中 + gs_initdb_opts: + - --encoding=UTF-8 + - --dbcompatibility=A + # 新增允许集群外可以访问数据库的服务器IP + extra_hba_conf: + - type: host + database: all + user: all + address: /32 + method: sha256 + option: + # CM 组件的配置,该值在启用CM组件时生效 + cm_option: + # CM 的安装目录,不填写默认会在 base_dir 目录下创建 cm 目录 + # dir: /opt/mogdb/cm + # CM Server 端口 + cm_server_port: 15300 + # 虚拟IP,该值需CM支持的版本才生效 + db_service_vip: "" + # CM Server 配置,会更新到 cm_server.conf 中 + cm_server_conf: + # instance_heartbeat_timeout: 2 + # ... + # CM Agent 配置,会更新到 cm_agent.conf 中 + cm_agent_conf: + # log_max_size: 10240 + # ... +db_servers: + - host: + # 数据库端口,可省略,自动继承 global 里配置的 db_port + db_port: 26000 + # 数据库角色,支持的选项: primary, standby, cascade_standby + role: primary + # 可用区名称,该值在启用CM组件时生效 + az_name: AZ1 + # 可用区优先级,值越小优先级越高,最小 1,该值在启用CM组件时生效 + az_priority: 1 + # 级联备的上游备库IP,仅级联备时必填 + upstream_host: + # postgresql.conf 中支持的参数 + db_conf: + # replication_type: 1 + # 连接服务器的SSH配置 + ssh_option: + port: 22 + user: root + # SSH 登录密码,不支持明文,需使用 ptk encrypt 加密后填写 + password: +# cm 服务器列表,如果不在这里列出,在安装时会在每个 db_server 的机器上部署 +# 注意此处配置不意味着会安装CM,需在安装时通过命令行指定 --install-cm 参数才会生效 +cm_servers: + - host: + # CM Server 端口,默认为 global.cm_option.cm_server_port + port: 15300 + # ssh 配置信息,如果 db_server 有相同机器配置过,则无需在此处配置 + ssh_option: +``` + +整个配置文件分为三个部分:`global`, `db_servers` 和 `cm_servers` + +- **global:** 定义集群内所有实例公用的信息及缺省值 +- **db_servers:** 实例列表,每个元素代表一个实例信息 +- **cm_servers:** CM server 部署节点信息,该部分仅在指定了 `--install-cm` 参数时生效,也可以省略,默认和 `db_servers` 部署在一起 + +### global 配置 + +字段名 | 解释 | 值类型 | 默认值 | 是否必填 | 备注 +------|-------|-----|------|------ | ------ +cluster_name | 集群名称 | 字符串 | `cluster_` 前缀,随机生成| 是 +user | 操作系统用户 | 字符串| omm | 否 +group | 操作系统用户组 | 字符串| omm | 否 +user_password | 操作系统用户密码 | 字符串 | 空 | 否 | 需通过 encrypt 指令加密后填写 +db_password | 数据库密码 | 字符串| 空 | 否 | 需通过 encrypt 指令加密后填写,若不填写,安装过程也可以填写 +db_port | 数据库监听端口 | 整型| 26000 | 否| +base_dir | 数据库安装的基础目录 | 字符串| /opt/mogdb | 否 | 若填写该字段,app_dir, log_dir, data_dir, tool_dir, cm_dir, tmp_dir 可不填写,自动放置到该字段指定的目录下 +app_dir | 数据库应用目录 | 字符串| /opt/mogdb/app | 否| +log_dir | 数据库日志存放目录 | 字符串 | /opt/mogdb/log | 否| +data_dir | 数据库数据存放目录 | 字符串 | /opt/mogdb/data | 否| +tool_dir | 数据库工具存放目录 | 字符串| /opt/mogdb/tool | 否| +tmp_dir | 数据库临时文件存放目录 | 字符串 | /opt/mogdb/tmp | 否| +core_file_dir | 系统 corefile 路径 | 字符串 | 空 | 否 | 若填写会修改系统 `kernel.core_pattern` 的值 +gs_initdb_opts | 初始化数据库时 gs_initdb 工具的参数 | 字符串列表 | 否 | 一个元素设置一个参数,如果未设置 `--locale` 参数,PTK 默认设置 `--no-locale` +ssh_option | SSH连接认证信息 | [ssh_option](#ssh_option) | 否 | 实例如果需要远程连接,但实例级别的 ssh_option 未配置时会使用 global 内的该字段 +cm_option | CM组件配置参数 | [cm_option](#cm_option) | 否 | 该字段在安装时指定 `--install-cm` 时生效 + +### db_servers 配置 + +字段名 | 解释 | 值类型 | 默认值 | 是否必填 | 备注 +------|-------|-----|------|------ | ------ +host | 实例IP | 字符串 | 空 | 是 | +db_port | 实例端口 | 整型 | 26000 | 否 | 若未填写,使用 global 内的配置 +ha_ips | 实例日志复制备用IP列表 | 字符串列表 | 空 | 否 | +ha_port | 日志复制备用端口 | 整型 | 26001 | 否 | +role | 数据库实例角色 | 字符串 | 空 | 否 | 可选值: `primary`, `standby`, `cascade_standby`, 若不填写,集群内随机选择一个实例设置主,其余为备库 +upstream_host | 级联备上游备库IP | 字符串 | 空 | 级联备时必填 | +az_name | 可用区名 | 字符串 | AZ1 | 否 | +az_priority | 可用区优先级 | 整型 | 1 | 数值越小优先级越高 +xlog_dir | xlog 日志目录 | 字符串 | 空 | 默认会放到 log_dir 的 pg_log 下,若配置该字段,不能为数据目录的子目录,否则启动报错 +db_conf | 数据库guc 参数配置 | 字典 | 空 | 字典键为 postgresql.conf 中的参数 +ssh_option | 连接实例时的ssh 连接认证信息 | [ssh_option](#ssh_option) | 否 | 若未设置使用 global 内的配置 + +### cm_servers 配置 + +字段名 | 解释 | 值类型 | 默认值 | 是否必填 | 备注 +------|-------|-----|------|------ | ------ +host | 实例IP | 字符串 | 空 | 是 | +port | CM Server端口 | 整型 | 15300 | 否 | 若未填写,使用 global.cm_option.cm_server_port 的值 +ssh_option | 连接实例时的ssh 连接认证信息 | [ssh_option](#ssh_option) | 否 | 若未设置使用 global 内的配置或db_servers 中相同IP的配置 + +### cm_option + +字段名 | 解释 | 值类型 | 默认值 | 是否必填 | 备注 +------|-------|-----|------|------ | ------ +dir | CM 安装目录 | 字符串 | $base_dir/cm | 是 | +cm_server_port | CM server 监听端口 | 整型 | 15300 | 否| +db_service_vip | 虚拟IP(需CM支持) | 字符串 | 空 | 否 | +cm_server_conf | CM sever 配置参数 | 字典| 空 | 否 | 该字段下字典的键支持任何 cm_server 的参数,PTK 会将值设置到 cm_server.conf 文件中 +cm_agent_conf | CM agent 配置参数 | 字典 | 空 | 否 | 该字段下字典的键支持任何 cm_agent 的参数,PTK 会将值设置到 cm_agent.conf 文件中 + +### ssh_option + +字段名 | 解释 | 值类型 | 默认值 | 是否必填 | 备注 +------|-------|-----|------|------ | ------ +host | 机器IP | 字符串 | 实例的IP | 否 | 如果配置为 proxy 跳板机时,该字段必填 +port | ssh 连接端口 | 整型 | 22 | 否 | +user | ssh 连接用户 | 字符串 | root | 否 | 如果连接的用户为非 root 时,需确保该用户具有免密执行 sudo 的权限 +password | ssh 连接密码 | 字符串 | 空 | 否 | 需通过 encrypt 指令加密后填写 +key_file | ssh 连接密钥文件 | 字符串 | 空 | 否 | +passphrase | ssh 连接密钥文件的口令 | 字符串 | 空 | 否 | +conn_timeout | ssh 连接超时时间 | Duration | 1m | 否 | +exec_timeout | 执行命令超时时间 | Duration | 10m | 否 | +proxy | 跳板机配置 | ssh_option | 空 | 否 | 仅支持跳一次连接 diff --git a/product/zh/docs-ptk/v2.0/guide/guide-ptkc-tool.md b/product/zh/docs-ptk/v2.0/guide/guide-ptkc-tool.md new file mode 100644 index 0000000000000000000000000000000000000000..09ff78568a0229612f1916afe4ee345f2b9cc306 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/guide-ptkc-tool.md @@ -0,0 +1,84 @@ +--- +title: PTKC工具 +author: Yao Qian +date: 2023-06-14 +--- + +# PTKC工具 + +## 介绍 + +PTKC 工具是 PTK 部署数据库集群后单独生成的一个数据库实例级别的运维工具,PTK 会在每个服务器的运行数据库的操作系统用户下生成一份 PTKC 工具。 + +PTKC 不依赖任何元数据,完全依赖运行环境的环境变量和数据库的静态配置文件等信息来识别集群,所以可以直接拷贝到任意一个集群的实例下使用,也可以通过 PTK 独立生成: + +``` +ptk gen-ptkc +``` + +> 该工具在 ptk v0.8 及以上版本支持 + +## 支持的子命令 + +- **start:** 启动集群或实例 +- **stop:** 停止集群或实例 +- **restart:** 重启集群或实例 +- **build:** 重建指定实例 +- **status:** 查询集群状态 +- **show-guc:** 查看数据库参数的值 +- **show-hba:** 查看数据库的 pg_hba.conf +- **failover:** 故障切换 +- **swichover:** 主备倒换 + +## ptkc,gs_ctl,gs_om 对比 + +| 功能点 | ptkc | gs_ctl | gs_om | +| :--------------------: | :-----------: | :------------: | :-----------: | +| 查询数据库状态 | 支持集群/实例 | 仅支持本地实例 | 支持集群/实例 | +| 启动数据库 | 支持集群/实例 | 仅支持本地实例 | 支持集群/实例 | +| 关闭数据库 | 支持集群/实例 | 仅支持本地实例 | 支持集群/实例 | +| 重启数据库 | 支持集群/实例 | 仅支持本地实例 | 支持集群/实例 | +| 重建数据库 | 支持本地/远程 | 仅支持本地实例 | 支持本地/远程 | +| 指定上游节点重建数据库 | 支持 | 支持 | 不支持 | +| failover | 支持本地/远程 | 仅支持本地实例 | 不支持 | +| switchover | 支持本地/远程 | 仅支持本地实例 | 不支持 | +| 查看数据库参数 | 支持本地/远程 | 不支持 | 不支持 | +| 查看HBA内容 | 支持本地/远程 | 不支持 | 不支持 | + +## ptkc 使用 + +PTKC 保持了和 PTK 一致的用户体验。 PTK 是多集群管理工具,而 PTKC 是单集群运维工具,所以 PTKC 的操作指令在 PTK 的基础上更加精简。 + +> 注:由于 PTKC 自身不存储任何元数据,完全依赖数据库已有的状态文件解析集群信息,目前的状态信息中没有存储系统用户等信息,所以 ptkc 不支持不同节点不同用户和单机多实例的场景 + +以下给出部分操作示例,更多命令可通过 `ptkc -h` 获取: + +- 集群状态查询 + + ```shell + ptkc status + ``` + +- 集群重启操作 + + ```shell + ptkc restart + ``` + +- 主备切换操作 + + ```shell + ptkc switchover -H + ``` + +- 查看数据库参数 + + ```shell + ptkc show-guc -k port + ``` + +- 查看 pg_hba 信息 + + ```shell + ptkc show-hba + ``` diff --git a/product/zh/docs-ptk/v2.0/guide/guide-self-upgrade.md b/product/zh/docs-ptk/v2.0/guide/guide-self-upgrade.md new file mode 100644 index 0000000000000000000000000000000000000000..73dcaae67d7de3439c6eccb9edf395000f196af1 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/guide-self-upgrade.md @@ -0,0 +1,37 @@ +--- +title: PTK自升级 +author: Yao Qian +date: 2023-06-14 +--- + +# PTK自升级 + +PTK 提供了 `self upgrade` 子命令来实现对自身的自动更新。 + +## 在线升级 + +PTK 支持在有网络情况下,通过如下命令可以将 PTK 升级到已经发布的最新版本,升级后通过 `ptk -v` 查看版本。 + +```shell +ptk self upgrade +``` + +如果你希望升级到一个特定的 PTK 版本可以通过 `-V` 参数指定: + +``` +ptk self upgrade -V 1.5.1 +``` + +## 离线升级 + +如果您的 PTK 所在的服务器无法访问网络,可以通过下载离线安装包进行本地升级。 + +PTK 安装包可以从这里下载得到 + +- [https://www.mogdb.io/downloads/ptk/all](https://www.mogdb.io/downloads/ptk/all) + +下载好安装包以后,将安装包上传到 PTK 所在的服务器上,通过 `-p` 参数进行本地升级: + +```shell +ptk self upgrade -p +``` diff --git a/product/zh/docs-ptk/v2.0/guide/guide-uninstall-cluster.md b/product/zh/docs-ptk/v2.0/guide/guide-uninstall-cluster.md new file mode 100644 index 0000000000000000000000000000000000000000..4a0542518736e14c0595eea0aebb0507ed6ce523 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/guide-uninstall-cluster.md @@ -0,0 +1,27 @@ +--- +title: 卸载数据库集群 +author: Yao Qian +date: 2024-06-10 +--- + +# 卸载数据库集群 + +> 注意:卸载操作一定要谨慎,请操作卸载数据库集群之前,反复确认当前集群是否确实可以卸载! + +卸载数据库集群仅需要一行指令即可完成: + +```shell +ptk uninstall -n +``` + +- **:** 集群名称 + +在卸载时,PTK会检测集群是否处于运行状态,运行中的集群是不允许被卸载的,需先将集群停止后再进行卸载操作。 + +执行卸载时需指定要卸载的集群名称,可以通过 [`ptk ls`](./manage-cluster/manage-cluster-list-clusters.md) 来查看集群名称。 + +在卸载中,PTK 会和用户确认卸载的内容,以确认要删除的集群拓扑信息,确认是否要连带删除系统用户,以及确认是否要连带删除数据库数据。 + +**请在回答每一个问题时,谨慎确认你的输入,避免由于误操作导致不可恢复的数据丢失!** + +在 PTK 执行数据库卸载操作时,如果用户指定了删除数据目录,PTK 仅会删除数据目录,不会删除数据目录所在的父目录,**需用户手动清理父目录**。 diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-build-db.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-build-db.md new file mode 100644 index 0000000000000000000000000000000000000000..cb5be40050f561237b7f4cdaf7e4388ccab74645 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-build-db.md @@ -0,0 +1,33 @@ +--- +title: 重建数据库 +author: Qian Yao +date: 2024-06-12 +--- + +# 重建数据库 + +如果集群内的备库或级联备库出现了不可自动修复的数据等问题,我们有时需要通过和其他实例同步数据来重建数据库来修复这个实例,此时您可以通过 PTK 来重建指定的实例。 + +## 重建指定实例 + +我们在重建某个实例时必须通过 `-H` 或 `-i` 来指定实例进行操作。 + +`-H` 或 `--host` 参数指定实例的 IP + +```bash +ptk cluster -n build -H +``` + +`-i` 或 `--id` 参数可以指定实例的 ID (ID 可通过 `ptk ls` 查看) + +```bash +ptk cluster -n build -i +``` + +## 从指定实例同步数据 + +默认情况下将和主库进行数据库同步来重建备库,但这样会给主库带来IO压力,进而可能影响业务的性能。此时您可以通过 `--build-from` 参数来指定其他的实例 IP 来重建: + +``` +ptk cluster -n build -H --build-from +``` diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-failover.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-failover.md new file mode 100644 index 0000000000000000000000000000000000000000..6330794c63722de5f9c5f04740284719890fcbd6 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-failover.md @@ -0,0 +1,25 @@ +--- +title: 故障切换 +author: Qian Yao +date: 2024-06-12 +--- + +# 故障切换 + +如果集群内的主库由于某种原因宕机而无法通过重启实例来恢复的话,为了保证集群的可用性,您需要通过 `failover` 命令来将当前集群内一个正常的备库提升为主库来恢复对外提供服务。 + +> 注意:在集群正常的情况下,请不要使用该命令进行切换,会导致集群出现双主的情况。 + +## 切换命令 + +`-H` 或 `--host` 参数指定实例的 IP + +```bash +ptk cluster -n failover -H +``` + +`-i` 或 `--id` 参数可以指定实例的 ID (ID 可通过 `ptk ls` 查看) + +```bash +ptk cluster -n failover -i +``` diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-init-empty-clsuter.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-init-empty-clsuter.md new file mode 100644 index 0000000000000000000000000000000000000000..5555f2afb5caaeb754444db1a9fd8c433b17dea3 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-init-empty-clsuter.md @@ -0,0 +1,51 @@ +--- +title: 创建空集群 +author: Bai Kai +date: 2024-06-12 +--- + +# 创建空集群 + +## 空集群 + +自 PTK 1.5.0 版本起,引入了空集群的概念。 + +在某些情况下,用户可能希望使用 PTK 来接管并非由 PTK 安装的特定节点,此时提供空集群的概念,能让用户更灵活地运用 PTK 进行管理。 + +空集群指的是在 PTK 所管理的集群中,其元数据仅有集群名字的集群。在这个空集群内,不存在实例信息,需要用户自行去添加。 + +## 创建空集群 + +使用 PTK 创建一个空的集群,可执行如下命令: + +```bash +ptk init-cluster [--name|-n CLUSTER_NAME] +``` + +- --name|-n :此为可选参数,若不添加,PTK 将会自动创建一个不重复的集群名。 +- CLUSTER_NAME :为指定的集群名。 + +执行该命令成功后,将会有"cluster "xxx" init success"的日志输出。 + +## 空集群展现形式 + +在执行 `ptk ls` 时,空集群的展现格式如下: + +```bash +$ ptk ls + cluster_name | id | addr | user | data_dir | db_version | create_time | comment +---------------+----+------+------+----------+------------+---------------------+---------- + test | - | - | - | - | - | 2024-06-12T15:37:39 | +``` + +在执行 `ptk cluster status -n ` 时,空集群的展现形式为: + +```bash +$ ptk cluster status -n test +[ Cluster State ] +cluster_name : test + +[ Datanode State ] + cluster_name | id | ip | port | user | nodename | db_role | state | uptime | upstream +---------------+----+----+------+------+----------+---------+-------+--------+----------- +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-inspect.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-inspect.md new file mode 100644 index 0000000000000000000000000000000000000000..77943ece0b64649ff7f5aa5746d0c6e5fa1f6a72 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-inspect.md @@ -0,0 +1,17 @@ +--- +title: 查看集群元信息 +author: Bai Kai +date: 2024-06-17 +--- + +# 查看集群元信息 + +PTK 提供了查看已安装好集群的元信息的功能。 + +> _集群元信息是指 PTK 在管理集群时,内部使用的一些基础信息。_ + +只需要指定要查看的集群名字 ,执行以下命令即可: + +```shell +ptk cluster -n inspect +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-install-cm.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-install-cm.md new file mode 100644 index 0000000000000000000000000000000000000000..70fef2ca889d2db380820f0fa78520e53918b310 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-install-cm.md @@ -0,0 +1,37 @@ +--- +title: 安装CM组件 +author: Qian Yao +date: 2024-06-12 +--- + +# 安装 CM 组件 + +[CM(Cluster Manager)](https://docs.mogdb.io/zh/mogdb/v5.0/14-cm)是一款针对 MogDB 开发的数据库高可用管理软件。PTK 支持在安装 MogDB 数据库集群时在命令行指定 `--install-cm` 参数即可一并安装 CM 组件。同时,如果您在安装完数据库集群时未安装 CM 组件,PTK 也提供了安装 CM 组件的功能方便独立安装。 + +## 自动探测安装包安装 + +默认情况下,如果未指定 CM 组件的安装包,PTK 会在数据库集群的工具目录(`$GPHOME`)中搜索 CM 的安装包,因为一般情况下,PTK 安装数据库集群后解压的安装包会留存在这个目录下。如果搜索到 CM 的安装包就可以自动完成安装。 + +CM 的安装目录默认会安装到集群配置文件中 `global.base_dir` 目录下的 `cm` 目录,如果未配置 `global.base_dir` 目录或者希望指定安装目录的话,需要通过 `--cmdir` 参数来指定。 + +安装命令为: + +```bash +ptk cluster -n install-cm +``` + +## 指定本地安装包安装 + +```bash +ptk cluster -n install-cm -p <本地CM安装包路径> +``` + +## 配置 CM agent 或者 CM server 的参数 + +如果在安装 CM 组件时希望修改 CM agent 或者 CM server 的配置文件中的默认配置,可以通过在命令行中通过 `--agent-conf` 和 `--server-conf` 指定,多个参数需多次指定: + +```bash +ptk cluster -n install-cm --agent-conf = --agent-conf = --server-conf = --server-conf = +``` + +更多参数可以参考[install-cm 命令文档](../../commands/ptk-cluster-install-cm.md) diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-install-mogha.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-install-mogha.md new file mode 100644 index 0000000000000000000000000000000000000000..cd9a202205b99d60755698b20b103d52af86266e --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-install-mogha.md @@ -0,0 +1,112 @@ +--- +title: 安装MogHA服务 +author: Bai Kai +date: 2024-06-14 +--- + +# 安装MogHA服务 + +## MogHA服务 + +MogHA 是一款基于 MogDB 数据库复制流技术研发的高可用系统。其核心目标是在有力保障 RPO 的前提下,尽最大可能地缩短 RTO 时间,以此为上层应用提供持续稳定的运行保障。(适用于 openGauss 数据库和 MogDB 数据库) + +[=> 详细文档](https://docs.mogdb.io/zh/mogha/v2.4/overview) + +## 利用 PTK 安装 MogHA 服务 + +PTK 为我们提供了一种针对集群高效安装 MogHA 服务的便捷途径,以下是具体的操作流程: + +1. **生成配置文件**:这是安装的起始步骤,确保后续步骤有准确的配置依据。 +2. **编辑配置文件中的必填项**:对生成的配置文件进行必要的补充和完善,使其符合实际需求。 +3. **执行安装 MogHA 命令**:真正开始安装的关键环节。 + +### 前置条件 + +务必提前准备好仲裁节点 IP(如果集群在同一个子网内,可以为网关),这是整个安装过程顺利进行的基础。 + +### 生成集群的 MogHA 的配置文件 + +可以通过执行以下命令来创建配置文件: + +```bash +ptk template mogha -n [--prot 8081] > node.conf +``` + +在此命令中,`port` 是一个可选参数,如果不填则默认为 `8081`。 + +同时也提供了 `-o` 参数,它可以让我们指定文件名来进行输出,以便更好地管理和保存配置文件。 + +`node.conf` 配置示例: + +```yaml +# docs: https://docs.mogdb.io/zh/mogha/latest/overview + +[ config ] +db_port=23419 +db_user=mog +db_datadir=/opt/mogdb/data +primary_info=/opt/mogdb/mogha/primary_info +standby_info=/opt/mogdb/mogha/standby_info +lite_mode=true +agent_port=8081 +http_req_timeout=3 +heartbeat_interval=3 +primary_lost_timeout=10 +primary_lonely_timeout=10 +double_primary_timeout=10 +meta_file_type=json +logger_format=%(asctime)s %(levelname)s [%(filename)s:%(lineno)d]: %(message)s +log_dir=/opt/mogdb/mogha +log_max_size=512MB +log_backup_count=10 +allow_ips= +handle_down_primary=true +handle_down_standby=true +primary_down_handle_method=restart +restart_strategy=10/3 +debug_mode=false + + +[ host1 ] +ip= +heartbeat_ips= +[ host2 ] +ip= +heartbeat_ips= +[ host3 ] +ip= +heartbeat_ips= + +[ zone1 ] +vip= +hosts=host1,host2,host3 +ping_list=<仲裁IP> +cascades= +arping= +``` + +您可以根据自己的需求,修改配置文件中的字段信息。 + +### 安装 MogHA + +执行如下命令即可自动完成 MogHA 的部署: + +```bash +ptk cluster -n install-mogha -c node.conf [-y] [-p ] [-d ] [--service-name mogha] [--mogha-version 2.4.17] +``` + +在`install-mogha`这个指令中: + +- `-c` 后面需要加上我们创建好的 `node.conf`。 +- `-y` 的作用是可以让我们跳过一些交互步骤。 +- `-p` 用于指定 MogHA 的安装包。 +- `-d` 是指定安装 MogHA 的具体目录。 +- `--service-name` 是指 MogHA 启动时对应的 systemctl 操作的服务名称,默认为 `mogha`。 +- `--mogha-version` 指定要安装的 MogHA 的具体版本。 + +此外,该命令还提供了其他一些参数,例如: + +- `--skip-check`:如果我们选择了这个参数,就意味着可以跳过对配置文件和需要安装的目标机器的检查环节。 +- `--skip-rollback`:当安装失败时,若选择此参数则可以跳过回滚操作。 +- `--skip-start`:当用户指定了这个参数,那么在完成安装后,MogHA 服务将不会自动启动,我们可以根据实际情况灵活选择启动时机。 +- `--sync-standby`:这个参数让用户能够自定义指定同步备库来进行安装,增加了安装的灵活性。 diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-install-plugin.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-install-plugin.md new file mode 100644 index 0000000000000000000000000000000000000000..a8f821eb5eac4ff3d92b31f180e606fa5824e9ea --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-install-plugin.md @@ -0,0 +1,102 @@ +--- +title: 对集群安装插件 +author: gxk +date: 2024-06-12 +--- + +# 查看集群安装插件信息 + +## 目的 + +为了满足功能多样性需求,MogDB 提供了各种功能丰富的插件。同时,PTK 也支持对这些插件的一键安装,以方便用户能快速使用插件功能。 + +## 插件列表 + +- [postgis](https://docs.mogdb.io/zh/mogdb/latest/postgis-extension) +- [pg_bulkload](https://docs.mogdb.io/zh/mogdb/latest/pg_bulkload-user-guide) +- [pg_prewarm](https://docs.mogdb.io/zh/mogdb/latest/pg_prewarm-user-guide) +- [pg_repack](https://docs.mogdb.io/zh/mogdb/latest/pg_repack-user-guide) +- [pg_trgm](https://docs.mogdb.io/zh/mogdb/latest/pg_trgm-user-guide) +- [wal2json](https://docs.mogdb.io/zh/mogdb/latest/wal2json-user-guide) +- [whale](https://docs.mogdb.io/zh/mogdb/latest/whale) +- [oracle_fdw](https://docs.mogdb.io/zh/mogdb/latest/1-oracle_fdw) +- [mysql_fdw](https://docs.mogdb.io/zh/mogdb/latest/2-mysql_fdw) +- [postgres_fdw](https://docs.mogdb.io/zh/mogdb/latest/3-postgres_fdw) +- [dblink](https://docs.mogdb.io/zh/mogdb/latest/dblink) +- [orafce](https://docs.mogdb.io/zh/mogdb/v3.1/orafce-user-guide) + +## 安装演示 + +安装命令: + +```shell +ptk cluster -n install-plugin [-H|--host HOST] [-p|--pkg PKG_PATH] [-P|--plugin PLUGIN_NAME] [--override] [--skip-check-version] +``` + +参数说明: + +|参数名称|参数类型|说明| +|:------|:------|:----| +|-H\|--host|String Array|指定待安装的主机 IP,默认将安装到集群中的所有主机| +|-p\|--pkg|String|指定插件包路径,可指定本地插件包或URL路径| +|-P\|--plugin|String Array|指定要安装的插件名称, 默认会安装所有插件| +|--override| Bool | 是否覆盖现有插件文件| +|--skip-check-version|Bool|不检查数据库版本是否和插件版本匹配| + +## QA + +### 默认安装的插件是哪个版本? + +PTK 工具根据当前集群的版本号做了插件的适配,若未指定 `-p` 时,则默认插件的版本与当前集群数据库的版本一致;若指定 `-p`,则插件版本为指定路径包的版本号。 + +### 如何查看插件已安装成功? + +1. 可根据上述的安装命令执行是否成功判断是否安装成功。 +2. 可使用[查询集群插件列表](./manage-cluster-list-plugins.md)查询。 + +### 如何启用插件? + +根据如下命令链接至目标数据库: + +```sql +gsql -r -d +``` + +使用如下命令创建扩展: + +```sql +CREATE Extension +``` + +### --override 有什么用?何时应该使用它? + +**作用**:`--override` 表示对于已经安装的插件,如果再次执行安装插件时,会直接覆盖掉原来该插件的相应文件,不再同用户进行逐个交互确认。 + +**何时使用**:可能存在的情况是插件版本号与数据库版本号不一致,从而导致在数据库中不能正常的[启用插件](#如何启用插件),因此在安装的时候会直接选择启用该选项。 + +### --skip-check-version 有什么用?何时应该使用它? + +**作用**:PTK 工具在安装插件时,会解析插件包中的版本号,并判断该版本号与当前数据库的版本号是否匹配,若不匹配则会报错。`--skip-check-version` 的目的则是跳过该验证。 + +**何时使用**: + +1. 想在当前数据的版本号下体验不同版本号的插件。 +2. 某个 MogDB 版本暂时还无对应的插件包发布,则可使用该选项跳过验证安装其他版本的插件。 + +### 已经安装的插件可以卸载吗? + +暂不支持 + +### 已经在库中创建的扩展可以删除吗? + +根据如下命令链接至目标数据库: + +```sql +gsql -r -d +``` + +使用如下命令删除已经创建的扩展: + +```sql +DROP Extension +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-list-clusters.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-list-clusters.md new file mode 100644 index 0000000000000000000000000000000000000000..a1aa3c65257cf1db648b41f7fd9223cda8be9ce1 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-list-clusters.md @@ -0,0 +1,30 @@ +--- +title: 查看集群列表 +author: Yao Qian +date: 2024-05-30 +--- + +# 查看集群列表 + +您可以通过如下命令进行查看集群列表: + +```bash +ptk ls +``` + +在输出的表格中,会展示这些信息: + +- **cluster_name:** 集群名称 +- **id:** 数据库实例的 ID,这个 ID 是在部署集群是 PTK 分配给每个实例的唯一 ID +- **addr:** 数据库实例的监听地址,形式为 `IP:PORT` +- **user:** 运行数据库的操作系统用户名 +- **data_dir:** 数据库实例的数据目录 +- **db_version:** 数据库的版本信息 +- **create_time:** 集群创建时间 +- **comment:** 集群备注,可以在安装集群时通过 `--comment` 参数来指定,也可以在安装好后通过 `ptk cluster modify-comment` 命令进行修改 + +如果您仅需要获取集群的名称,可以通过增加 `-n` 参数即可: + +```bash +ptk ls -n +``` diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-list-plugins.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-list-plugins.md new file mode 100644 index 0000000000000000000000000000000000000000..eac8d03c83adf0e16910aaa52f23d9f385474571 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-list-plugins.md @@ -0,0 +1,67 @@ +--- +title: 查询集群安装插件 +author: gxk +date: 2024-06-12 +--- + +# 查询集群安装插件信息 + +## 目的 + +该命令旨在查询并展示集群下已经安装的插件和已经创建的插件。 + +## 查询演示 + +查询命令: + +```shell +ptk cluster -n list-plugins [-d|--database DATABASE_NAME] +``` + +参数说明: + +|参数名称|参数类型|说明| +|:------|:------|:----| +|-d\|--database| String Array|查询指定数据库的创建插件| + +查询结果样例展示及说明: + +```shell +List of Installed Plugins: + Plugin Name | dn_6001 | dn_6002 +---------------+---------+---------- + mysql_fdw | Yes | Yes + oracle_fdw | Yes | Yes + postgres_fdw | Yes | Yes + dblink | Yes | Yes + pg_bulkload | Yes | Yes + pg_prewarm | Yes | No + pg_repack | Yes | No + pg_trgm | Yes | Yes + postgis | Yes | Yes + wal2json | Yes | Yes + whale | Yes | Yes + +Extension Status of Databases: + Database | Extension(s) +-----------+--------------- + test | whale + postgres | pg_trgm +``` + +- `List of Installed Plugins` 展示安装的插件列表。其中 `Plugin Name` 表示插件名称,`dn_xxxx` 表示某个数据库节点上是否安装了该插件,其中 `Yes` 表示该节点已安装该插件,`No` 表示该节点未安装该插件。 +- `Extension Status of Databases` 展示了数据库中已经创建的插件。其中 `Database` 表示数据库名称,`Extension(s)` 表示对应数据库下已经创建的插件名称。 + +## QA + +### 如何安装插件? + +安装插件可参考该[链接](./manage-cluster-install-plugin.md)。 + +### `Extension Status of Databases` 展示 Cluster Stopped 是什么原因? + +数据库中的已创建的扩展需要链接数据库进行查询,当集群主节点停掉时,便查询不到这些信息,因此需要先启动集群主节点,然后再查询插件列表。 + +### 为什么有些安装的插件未在此处展示? + +这里展示的列表仅展示[官网](https://docs.mogdb.io/zh/mogdb/latest/extension)列出的插件列表,其他插件诸如:[mogila](https://gitee.com/enmotech/mogila), [compat_tools](https://gitee.com/enmotech/compat-tools) 等等,此处不予展示。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-manage.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-manage.md new file mode 100644 index 0000000000000000000000000000000000000000..7fc50c307f42174d33cdcd7bf9e7b323ac9e602d --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-manage.md @@ -0,0 +1,31 @@ +--- +title: 查询集群安装插件 +author: gxk +date: 2024-06-12 +--- + +# 纳管集群 + +## 目的 + +对于一些已经存在的集群,PTK 提供了纳管功能,以使该集群能由 PTK 进行管理。 + +## 前提 + +被纳管的集群需保证 PTK 工具所在节点能正常链接至集群中各个节点。 + +## 纳管命令 + +```shell +ptk manage [--clustername] -H|--host HOST -U|--username USERNAME +``` + +参数说明: + +|参数名称|参数类型|说明| +|:------|:------|:----| +|--clustername|String|指定待纳管集群的名称| +|-H\|--host|String|待纳管集群中任意一个节点的 IP 地址| +|-U\|--username|String|待纳管集群中使用的数据库用户名称| + +纳管成功后,该集群可由 PTK 进行管理。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-modify-comment.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-modify-comment.md new file mode 100644 index 0000000000000000000000000000000000000000..aaf3eefeb4a32f815a9ff05a51910acfd7467788 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-modify-comment.md @@ -0,0 +1,17 @@ +--- +title: 更新集群备注 +author: Bai Kai +date: 2024-06-17 +--- + +# 更新集群备注 + +PTK 在执行 `ls` 指令时,其结果是有展示 `comment` ,在 PTK 对多个集群进行管理时,为了让用户能够明确知晓每套集群的具体作用,用户可以对所管理的集群添加备注,从而便于区分不同的集群。 + +## 修改集群备注的操作 + +```shell +ptk cluster -n modify-comment --comment "some comment" +``` + +- `--comment` 是要修改的备注信息。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-refresh.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-refresh.md new file mode 100644 index 0000000000000000000000000000000000000000..fd75d24c64d240f42f176062c952e1031b18b24a --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-refresh.md @@ -0,0 +1,36 @@ +--- +title: 更新数据库IP +author: gxk +date: 2024-06-18 +--- + +# 更新数据库IP + +## 目的 + +对于一个集群,由于第三方原因导致其内的某一节点 IP 变更,此时 PTK 无法动态感知该变更,因此需要操作人员使用 PTK 对该集群进行手动的 IP 变更,以保证能正常对该集群的管理。 + +## 更新命令 + +命令 + +```shell +ptk cluster -n refresh --replace-ip OLD_IP=NEW_IP +``` + +参数说明: + +|参数名称|参数类型|说明| +|:------|:------|:----| +|--replace-ip|String Array|待更新的 IP 列表,新旧键值对的映射| + +## QA + +### 可以两个节点交换 IP 吗? + +可以。 +命令如下: + +```shell +ptk cluster -n refresh --replace-ip DATANODE_IP1=DATANODE_IP2 --replace-ip DATANODE_IP2=DATANODE_IP1 +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-rename-cluster.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-rename-cluster.md new file mode 100644 index 0000000000000000000000000000000000000000..c9a29db940f3da47b4ddfe0255f7c9d628b4e217 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-rename-cluster.md @@ -0,0 +1,34 @@ +--- +title: 集群重命名 +author: Bai Kai +date: 2024-06-11 +--- + +# 集群重命名 + +## 集群名 + +PTK 在安装集群之前需要创建一个配置文件,其中的 `ClusterName` 字段即用于存储集群名信息。 + +在使用 PTK 过程中,需要通过指定集群名称来对各个集群加以区分,以实现有效管理,故而在 PTK 中集群名字不能重复。 + +自 1.5.0 版本起,PTK 提供了在安装完成后可重新修改集群名字的命令。 + +## 查看集群名字信息 + +在 PTK 使用的过程中,我们可借助 `ptk ls` 命令来展示安装时所填写的集群名字以及集群的基本信息。 + +## 集群重命名 + +通常而言,在创建配置文件并完成集群安装后,集群名字一般不会更改。然而,在某些情况下,当我们管理几套集群时,名字的区分就显得极为重要。为此,我们提供了 `rename` 指令用于重命名集群。其命令格式如下: + +```bash +ptk cluster -n rename -N +``` + +- `` 当前操作的集群名称。 +- ``新集群名称。 + +**注意**:在修改新集群名字时,需留意是否与当前 PTK 所管理的集群名字重复,否则将会有报错提示。 + +当执行完 `rename` 指令后,会有 `rename cluster success` 的日志打印,那就表明修改集群名字成功了。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-restart-db.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-restart-db.md new file mode 100644 index 0000000000000000000000000000000000000000..4018e829d918ea40ea070efe8f995ee29ecf5d13 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-restart-db.md @@ -0,0 +1,41 @@ +--- +title: 重启数据库 +author: Qian Yao +date: 2024-06-12 +--- + +# 重启数据库 + +重启数据库本质上是[**停止数据库**](./manage-cluster-stop-db.md)和[**启动数据库**](./manage-cluster-start-db.md)的组合操作,为了便捷用户使用,PTK 提供了 `restart` 子命令,该命令支持 `start` 和 `stop` 支持的所有参数。 + +## 重启整个集群 + +您可以通过该命令指定集群名称来启动整个集群: + +```bash +ptk cluster -n restart +``` + +## 重启集群内单个实例 + +`-H` 或 `--host` 参数指定实例的 IP + +```bash +ptk cluster -n restart -H +``` + +`-i` 或 `--id` 参数可以指定实例的 ID (ID 可通过 `ptk ls` 查看) + +```bash +ptk cluster -n restart -i +``` + +## 重启所有集群 + +> ! 谨慎使用 + +PTK 是多集群管理软件,所以 PTK 也支持一键重启 PTK 管理的所有集群: + +```bash +ptk cluster restart [-a|--all] +``` diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-role-change.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-role-change.md new file mode 100644 index 0000000000000000000000000000000000000000..65562cd01777c6100fc9929d771059644e5b30f9 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-role-change.md @@ -0,0 +1,92 @@ +--- +title: 角色管理 +author: gxk +date: 2024-06-18 +--- + +# 角色管理 + +对集群内数据库节点的角色进行管理的操作。 + +## 目的 + +为了方便用户对数据库节点的角色进行更灵活的管理,以满足期望。 + +## 注意事项 + +PTK 的角色管理赋予管理人员更灵活的操作,因此可能出现如下的一些情况: + +- 角色变更后集群**无主**情况。 +- 角色变更后集群**多主**情况。 + +管理人员需保证对这些情况的了解且其符合预期。 + +## 提升角色 + +提升线路: + +```text +cascade_standby -> standby -> primary +``` + +说明:提升一个数据库节点的角色时,会按提升线路中的正向路径逐步提升角色。 + +### 提升角色命令 + +命令如下: + +```shell +ptk cluster -n promote [-H|--host HOST] [-i|--id ID] +``` + +参数说明: +参数说明: +|参数名称|参数类型|参数说明| +|:-----|:------|:------| +|-H\|--host|String|待提升角色的数据库节点所在 IP| +|-i\|--id|Integer|待提升角色的数据库节点 ID| + +特别说明:若 `-H`,`-i` 均指定值,仅使用 `-i` 的值执行操作。 + +## 降级角色 + +降级线路: + +```text +primary -> standby -> cascade_standby +``` + +说明:降级一个数据库节点的角色时,会按降级线路中的正向路径逐步降级角色。 + +### 降级角色命令 + +命令如下: + +```shell +ptk cluster -n demote [-H|--host HOST] [-i|--id ID] [--upstream UPSTREAM_HOST] +``` + +参数说明: +|参数名称|参数类型|参数说明| +|:-----|:------|:------| +|-H\|--host|String|待降级角色的数据库节点所在 IP| +|-i\|--id|Integer|待降级角色的数据库节点 ID| +|--upstream|String|待降级角色的数据库节点降级后,其上游节点的 IP| + +特别说明:若 `-H`,`-i` 均指定值,仅使用 `-i` 的值执行操作。若降级一个 `standby` 节点时,需指定参数 `--upstream`。 + +## QA + +### 为什么会出现无主情况?怎样恢复至有主? + +无主原因:对一个集群的主节点进行 `demote` 操作后,会出现无主情况。 +如何恢复:选定一个 `standby` 节点,进行 `promote` 操作可将其提升为主。 + +### 为什么会出现多主情况?怎样恢复至单主? + +多主原因:对一个集群的非主节点进行多次 `promote` 之后,会出现多主情况。 +如何恢复:选定不期望的主节点进行 `demote` 操作,直至剩余一个主节点时停止操作。 + +### 经过角色操作后,会出现一主零备多级联的情况吗? + +不会。PTK 对于 `standby` 节点的提升或降级操作时,均进行了判断,以防止该情况发生。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-scale-in.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-scale-in.md new file mode 100644 index 0000000000000000000000000000000000000000..69a55fd84ae0e416f1d03c1b70cd1d78806665c9 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-scale-in.md @@ -0,0 +1,112 @@ +--- +title: 集群水平缩容 +author: gxk +date: 2024-06-17 +--- + +# 集群缩容 + +通过一系列操作,在原有集群上,减少数据库节点。 + +## 目的 + +出于业务,成本,资源分配,风险等因素的考虑,满足用户对集群进行缩容处理。PTK 为用户提供一键缩容。 + +## 缩容命令 + +```shell +ptk cluster -n scale-in [-H|--host HOST] [-i|--id ID] [--skip-clear-user] [--skip-clear-db] [--force] +``` + +## 缩容前后的拓扑样例 + +- 一主N备M级联 + +假设原集群拓扑结构为: + +```text + standby1 -- cascade_standby1, cascade_standby2 + / +primary + \ + standby2 -- cascade_standby3 +``` + +使用缩容命令删除 `standy2` 后,结构变更为: + +```text + standby1 -- cascade_standby1, cascade_standby2 + / \ +primary \ + \ + standby2 cascade_standby3 +``` + +说明:此时 `standby2` 不在集群中,同时原 `standby2` 下游节点的 upstream 变更为 `standby1`。 + +PTK 逻辑:若缩容目标节点角色为 `standby`,若该节点有下游节点且还有其他 `standby` 节点,则会将缩容节点的所有下游节点 upstream 指向其余的 `standby` 节点。 + +- 一主一备一级联 + +假设原集群拓扑结构为: + +```text +primary -- standby -- cascade_standby +``` + +使用缩容命令删除 `standy` 后,结构变更为: + +```text +primary standby cascade_standby +``` + +说明:此时3个节点直接没有任何关联,均独立。 + +## QA + +### 集群可以扩容吗? + +可以。参考[扩容文档](./manager-cluster-scale-out.md) + +### 一直执行缩容,可以将集群缩为空吗? + +不可以。缩容之后,集群最少会有一个可用的数据节点。 + +若想得到一个空集群,可参考[创建一个空集群](./manage-cluster-init-empty-clsuter.md),或参考[抛弃节点](./manage-cluster-throwout.md)。 + +### 缩容能直接缩主节点吗? + +不可以。缩容后至少会有一个节点存活,该节点为主节点。 + +### 若想缩主节点所在的服务器节点,该如何处理? + +可考虑使用如下步骤完成: + +1. 使用 `switchover` 命令切换主备。 +2. 缩容原主节点所在的节点(现备所在的节点) + +### 对于带 CM 组件的集群,可以缩容吗?若可以,有限制吗? + +可以。 + +**限制**:缩容后的集群数据库节点至少为2个节点。CM 节点至少为2个节点,因为 CM 的仲裁机制需至少保证2节点。 +**补充**:带 CM 组件的集群缩容时,对即将缩容的目标节点,会缩容该节点上的数据库节点和 CM 节点。 + +### --skip-clear-db 有什么用?何时应该使用它? + +**作用**:PTK 在对目标节点缩容时,默认会杀掉该节点上的数据库进程,并清除 DB 的相关文件,重新对剩余节点重写 `postgresql.conf` 文件中的复制流信息。而 `--skip-clear-db` 的作用则是跳过清除 DB 相关文件这一步操作。 +**何时使用**:想保留数据节点的信息时使用。 + +### --skip-clear-user 有什么用?何时应该使用它? + +**作用**:PTK 在对目标节点缩容时,一般情况下会删除掉该节点下的数据库用户。 +**何时使用**:不想删除目标节点的数据库用户时使用。 + +### --force 有什么用?何时应该使用它? + +**作用**:可能存在的情况是待缩容节点由于特殊原因无法正常链接,在执行缩容流程时进行的一些检查不能通过,导致不能缩容就抛出错误。`--force` 的作用则是跳过这些检查。 +**何时使用**:在某些节点链接不上时继续执行缩容任务。 + +### 若当前集群有 CM 组件,且安装了 VIP,缩容后会有影响吗? + +无影响。PTK 针对已经安装了 VIP 的集群,在缩容后会重新刷新 CM-VIP,以保证 CM-VIP 的基本信息正确。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-scale-out.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-scale-out.md new file mode 100644 index 0000000000000000000000000000000000000000..fd98ea3c00de8a181b23b88ce4c28837ed9f2f76 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-scale-out.md @@ -0,0 +1,126 @@ +--- +title: 集群水平扩容 +author: gxk +date: 2024-06-17 +--- + +# 集群扩容 + +通过一系列操作,在原有集群上,增加数据库节点。 + +## 目的 + +出于业务,成本,资源分配,风险等因素的考虑,满足用户对集群进行扩容处理。PTK 为用户提供一键扩容。 + +## 扩容逻辑 + +PTK 在扩容时,会将主节点上的应用目录和工具目录等静态文件进行打包,复制到目标机器上后,解压到对应目录下。 然后使用内核工具初始化一个新的数据目录出来,最后将集群的配置按照新集群的拓扑整体刷新。 + +注意,扩容时采用的是逐个节点扩容的模式,当扩容至某个节点失败时,立即停止继续扩容,按照已完成的集群进行刷新配置。 + +## 扩容流程演示 + +### 创建扩容需要的配置文件 + +使用如下命令创建一个扩容的配置文件 + +```shell +ptk template scale-out > scale-out.yaml +``` + +此时已创建一个扩容的配置文件 scale-out.yaml,请按需修改该配置文件。 + +下面对扩容模板内容进行一下介绍: + +```yaml +# 新增的数据库服务器列表,支持的字段和安装时相同 +db_servers: + - host: "replace host ip here" + # 角色仅支持 "standby" (默认) 或者 "cascade_standby" + role: standby + upstream_host: "" + ssh_option: + port: 22 + user: root + password: "encrypted ssh password by ptk" + +# CM 组件服务器列表 +# 如果扩容前的集群安装了 CM 组件,则需要指定扩容的CM服务器列表, +# 一般情况下 CM 服务器的列表和数据库的相同即可 +# 但如果在新的服务器上仅扩容数据库或者仅扩容CM组件,两个列表内的机器列表可以不一致 +cm_servers: + - host: "replace host ip here" +``` + +### 对集群进行扩容操作 + +执行扩容命令: + +```shell +ptk cluster -n scale-out -c CONFIG.yaml [--build-from BUILD_FROM_HOST] [--skip-create-user] [--skip-check-os] [--skip-check-distro] [--default-guc] [--skip-rollback] [--skip-gen-ptkc] [--cpu CPU_MODEL] [--not-limit-cm-nodes] +``` + +参数说明: +|参数名称|参数类型|参数说明| +|-------|------|-------| +|-c|String|指定扩容时的配置文件| +|--build-from|String|指定扩容时的 cascade_standby 节点进行 build 的数据来源节点,未指定时默认从主库进行 build| +|--skip-create-user|Bool|对扩容的节点跳过创建用户| +|--skip-check-os|Bool|对扩容的节点跳过 OS 相关检查| +|--skip-check-distro|Bool|对扩容的节点跳过 distro 检查| +|--default-guc|Bool|对扩容的节点使用数据库默认参数配置| +|--skip-rollback|Bool|扩容时若报错,跳过回滚| +|--skip-gen-ptkc|Bool|对扩容节点跳过传送 [ptkc](../guide-ptkc-tool.md) 的步骤| +|--cpu|String|指定扩容节点的 CPU Model| +|--not-limite-cm-nodes|Bool|不限制 CM 节点的数量,默认 CM 节点数大于3个时,必须为奇数| + +## 扩容支持列表 + +|原集群情况|扩容条件|支持情况|解决方案| +|--------|-------|-------|------| +|db1,db2 |db3 |支持 | | +|db1+cm1,db2+cm2,db3+cm3|db4+cm4|支持|| +|db1+cm1,db2+cm2,db3+cm3|db4|支持|| +|db1+cm1,db2+cm2,db3+cm3|cm4|支持|| +|db1+cm1,db2+cm2,db3|cm3|不支持|缩容 db3, 扩容 db3+cm3| +|db1+cm1,db2+cm2,cm3|db3|不支持|缩容 cm3, 扩容 db3+cm3| + +## QA + +### 集群可以缩容吗? + +可以。参考[缩容文档](./manager-cluster-scale-in.md) + +### 扩容最高上限是什么? + +最多可至9个节点。 + +### 扩容时角色可以为primary吗? + +不可以 + +### 对于带CM的集群,可以扩容吗?若可以,有限制吗? + +可以。详细支持细节可以参考[扩容支持列表](#扩容支持列表) + +### --skip-rollback 有什么用?何时应该使用它? + +**作用**:PTK 在扩容时,会逐节点进行扩容。若某个节点执行扩容操作时失败,则会在该节点上回滚已经执行过的操作。`--skip-rollback` 的作用则是某节点扩容失败时,不回滚已经执行过的操作。 +**何时使用**:用户想至目标节点上查看扩容失败原因时可使用该选项。 + +### --skip-check-distro 有什么用?何时应该使用它? + +**作用**:PTK 在扩容时,默认会检查待扩容的节点与主库的操作系统是否为同构操作系统。若不一致,则校验失败。`--skip-check-distro` 的作用则是跳过该检查。 +**何时使用**: + +1. PTK 对同构系统判断不全面导致的误判。 +2. 即时是异构系统,但是使用的 MogDB 包一致,可使用该选项跳过校验,但 PTK 不保证扩容成功后数据库节点的可用性和正确性。 + +### --not-limite-cm-nodes 有什么用?何时应该使用它? + +**作用**:PTK 在扩容时,若带CM集群扩容后,CM 节点数量大于3时,会强制校验 CM 节点数量为奇数,目的是防止 CM 集群脑裂而引起的选主问题。使用该参数则可以避免对 CM 节点数量为奇数的强制校验。 +**何时使用**:不建议使用该参数。若一定要使用,需自行承担CM集群脑裂引起的选主问题,从而引起 CM 组件失效的问题。 + +### 若当前集群有 CM 组件,且安装了 VIP,扩容后会有影响吗? + +无影响。PTK 针对已经安装了 VIP 的集群,在扩容后会重新刷新 CM-VIP,以保证 CM-VIP 的基本信息正确。 diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-set-guc.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-set-guc.md new file mode 100644 index 0000000000000000000000000000000000000000..548447443c91030cf64a0b75b6640a23a02f32e2 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-set-guc.md @@ -0,0 +1,37 @@ +--- +title: 设置数据库参数 +author: Bai Kai +date: 2024-06-17 +--- + +# 设置数据库参数 + +PTK 提供了设置数据参数的指令,用户可以自己修改指定参数的值。 + +```shell +ptk cluster set-guc [flags] +``` + +其中,Flags 包含以下具体参数: + +- `-H, --host` :表示数据库服务器的 IP。 +- `-i, --id` :代表数据库服务器的 ID。 +- `-c, --kv` :这里就是需要设置的参数,其格式需满足 "key(参数名)=value(参数值)" 的形式。例如:"password_encryption_type=1" 。 + +## 命令示例 + +### 指定 IP + +-H 或 --host 参数指定实例的 IP + +```shell +ptk cluster -n set-guc -H -c "key=value" +``` + +### 指定 ID + +-i 或 --id 参数可以指定实例的 ID (ID 可通过 ptk ls 查看) + +```shell +ptk cluster -n set-guc -i -c "key=value" +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-set-hba.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-set-hba.md new file mode 100644 index 0000000000000000000000000000000000000000..0719126a525464a3e658dea97c6da1b5be745c2a --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-set-hba.md @@ -0,0 +1,47 @@ +--- +title: 设置数据库HBA +author: Bai Kai +date: 2024-06-17 +--- + +# 设置数据库HBA + +PTK 提供了用于新增数据库的 `pg_hba.conf` 信息的功能。 + +## 前提条件 + +需提前准备好要设置的信息。例如,若要新增一个 host 下的条目,则需准备如下信息: + +```shell +"host all all /32 sha256" +``` + +## 执行命令 + +```shell +ptk cluster set-hba [flags] +``` + +其中,Flags 具体包含以下参数: + +- `-H, --host` :用于指定 IP 列表。 +- `-i, --id` :用于指定 ID 列表。 +- `-v, --value` :表示新增 pg_hba.conf 的条目信息。 + +### 指定 IP 操作示例 + +```shell +ptk cluster -n set-hba -H -v <提前准备好的 pg_hba.conf 条目信息> +``` + +### 指定 ID 操作示例 + +```shell +ptk cluster -n set-hba -i -v <提前准备好的 pg_hba.conf 条目信息> +``` + +### 指定多个 IP 操作示例 + +```shell +ptk cluster -n set-hba -H -H -v <提前准备好的 pg_hba.conf 条目信息> +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-show-config.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-show-config.md new file mode 100644 index 0000000000000000000000000000000000000000..92cd5439db813fcbe54eebe9709409a50b35ef9e --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-show-config.md @@ -0,0 +1,15 @@ +--- +title: 查看集群拓扑配置 +author: Bai Kai +date: 2024-06-17 +--- + +# 查看集群拓扑配置 + +PTK 提供了查看已安装好集群的拓扑配置的功能。 + +只需要指定要查看的集群名字 `` ,执行下面命令即可: + +```shell +ptk cluster -n show-config +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-show-guc.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-show-guc.md new file mode 100644 index 0000000000000000000000000000000000000000..5965ff6c9bd8591f69335402deeeedd5a9030cf8 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-show-guc.md @@ -0,0 +1,23 @@ +--- +title: 查看数据库参数 +author: Bai Kai +date: 2024-06-17 +--- + +# 查看数据库参数 + +PTK 提供了查看数据库的参数信息。 + +通过以下命令查看: + +```shell +ptk cluster -n show-guc -k <参数名> +``` + +举一个例子: + +```shell +ptk cluster -n show-guc -k password_encryption_type +``` + +用户在操作的过程中,只需要明确的指定查看的参数名,然后按照命令格式输入,ptk就会显示相应的参数信息。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-show-hba.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-show-hba.md new file mode 100644 index 0000000000000000000000000000000000000000..0e18d6f6af0a95b7ff6b1f08682fc4fd971f88a8 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-show-hba.md @@ -0,0 +1,31 @@ +--- +title: 查看数据库HBA +author: Bai Kai +date: 2024-06-17 +--- + +# 查看数据库 HBA + +PTK 提供了便捷的方式来查看集群中数据库节点的 **pg_hba.conf** 文件。 + +执行以下命令即可查看: + +```shell + ptk cluster -n show-hba +``` + +该命令直接输出集群中主库下的 `pg_hba.conf` 的信息。 + +若要查看指定节点的 `pg_hba.conf` 信息,可以用以下指令。 + +## 指定节点的 ID + +```shell +ptk cluster -n show-hba -i +``` + +## 指定节点的 IP + +```shell +ptk cluster -n show-hba -H +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-start-db.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-start-db.md new file mode 100644 index 0000000000000000000000000000000000000000..47ee5d9aa2b5bebfbb4b22a4c73800c808a1b1bc --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-start-db.md @@ -0,0 +1,39 @@ +--- +title: 启动数据库 +author: Qian Yao +date: 2024-06-12 +--- + +# 启动数据库 + +## 启动整个集群 + +您可以通过该命令指定集群名称来启动整个集群: + +```bash +ptk cluster -n start +``` + +## 启动集群内单个实例 + +PTK 默认会启动集群内所有实例,您也可以指定具体的某个或多个实例来进行启动: + +`-H` 或 `--host` 参数指定实例的 IP + +```bash +ptk cluster -n start -H +``` + +`-i` 或 `--id` 参数可以指定实例的 ID (ID 可通过 `ptk ls` 查看) + +```bash +ptk cluster -n start -i +``` + +## 启动所有集群 + +PTK 是多集群管理软件,所以 PTK 也支持一键启动 PTK 管理的所有集群: + +```bash +ptk cluster start [-a|--all] +``` diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-status.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-status.md new file mode 100644 index 0000000000000000000000000000000000000000..3eeaad398b503802fd9c3fad6dcba966bb20847a --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-status.md @@ -0,0 +1,60 @@ +--- +title: 查看集群状态 +author: Qian Yao +date: 2024-06-11 +--- + +# 查看集群状态 + +可以通过如下命令查看指定集群的状态信息: + +```shell +ptk cluster -n status +``` + +如果存在多个集群,可以通过不知道集群名称,指定 `-a` 参数来一次性列出所有集群的状态信息: + +```shell +ptk cluster status -a +``` + +PTK 也支持指定 `--detail` 参数来查看状态时列出集群内每个实例的流复制信息: + +```shell +ptk cluster -n status --detail +``` + +如果集群状态列表展示宽度过宽导致折行不便于查看,可以通过增加 `-G` 参数来实现纵向展示: + +```shell +ptk cluster -n status -G +``` + +## 集群状态定义 + +| 状态 | 含义| +| :--- |---| +| Normal | 集群所有实例正常可用 | +| Unavailable | 集群无主不可用, 或者主库不是正常状态 | +| Degraded | 集群可用,但是部分备节点不可用 | +| Stopped | 集群全部节点停止 | +| MultiPrimary | 集群出现多个主实例 | + +## 实例状态定义 + +> 实例状态在和数据库内核定义的列表保持一致基础上,新增 `SSH Disconnect` + +| 状态 | 含义| +| :--- |---| +| Unknown | 未知状态 | +| Normal | 正常 | +| Need repair | 复制断开,待修复 | +| Starting | 实例启动中 | +| Wait promoting | 等待角色提升 | +| Promoting | 角色提升中 | +| Demoting | 角色降级中 | +| Building | 正在重建 | +| Catchup | 正在追赶日志 | +| Coredump | 实例崩溃 | +| Stopped | 实例停止 | +| SSH Disconnect | 实例机器SSH连接失败 | diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-stop-db.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-stop-db.md new file mode 100644 index 0000000000000000000000000000000000000000..eb309f486dc8dac64c438434759c61a061b00483 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-stop-db.md @@ -0,0 +1,41 @@ +--- +title: 停止数据库 +author: Qian Yao +date: 2024-06-12 +--- + +# 停止数据库 + +## 停止整个集群 + +您可以通过该命令指定集群名称来停止整个集群: + +```bash +ptk cluster -n stop +``` + +## 停止集群内单个实例 + +PTK 默认会停止集群内所有实例,您也可以指定具体的某个或多个实例来进行停止: + +`-H` 或 `--host` 参数指定实例的 IP + +```bash +ptk cluster -n stop -H +``` + +`-i` 或 `--id` 参数可以指定实例的 ID (ID 可通过 `ptk ls` 查看) + +```bash +ptk cluster -n stop -i +``` + +## 停止所有集群 + +> ! 谨慎使用 + +PTK 是多集群管理软件,所以 PTK 也支持一键停止 PTK 管理的所有集群: + +```bash +ptk cluster stop [-a|--all] +``` diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-switchover.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-switchover.md new file mode 100644 index 0000000000000000000000000000000000000000..a0adac947f0fdb6b0d836cd5feef2a43ed4c0fce --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-switchover.md @@ -0,0 +1,23 @@ +--- +title: 主备倒换 +author: Qian Yao +date: 2024-06-12 +--- + +# 主备倒换 + +处于常规性运维的需要,你可能想要将主库和某个备库进行主备角色的倒换, MogDB 数据库自带的 gs_ctl 工具提供了 `switchover` 的功能,但 gs_ctl 工具只能在实例所在的用户下执行,为了便于统一集中运维,PTK 也封装了 `switchover` 的集群操作命令,可以通过 PTK 实现任意实例的主备倒换。 + +## 切换命令 + +`-H` 或 `--host` 参数指定实例的 IP + +```bash +ptk cluster -n switchover -H +``` + +`-i` 或 `--id` 参数可以指定实例的 ID (ID 可通过 `ptk ls` 查看) + +```bash +ptk cluster -n switchover -i +``` diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-takeover.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-takeover.md new file mode 100644 index 0000000000000000000000000000000000000000..7acd91953198435cf0b8d450c4b0a3394723f04e --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-takeover.md @@ -0,0 +1,70 @@ +--- +title: 接管节点 +author: Bai Kai +date: 2024-06-12 +--- +# 接管节点 + +在某些特定场景下,PTK 可能无法感知到新节点的加入,进而无法对其进行管理。自 1.5.0 版本起,PTK 提供了接管节点的指令。 + +该指令的主要作用在于,当用户在 PTK 已有的集群中自行手动添加了一个节点,并完善了新节点与集群的关联关系后,此时 PTK 无法感知到新节点的加入,那么就需要使用 `ptk cluster takeover` 这个指令,将用户安装的新节点接管到 PTK 的元数据中,从而实现对该新节点的有效管理。 + +此外,也可以在创建了一个空集群之后,将非 PTK 安装的集群接管到空集群中,以便让 PTK 对其进行管理。 + +## 使用方法 + +当需要接管指定节点时,可执行以下命令: + +```bash +ptk cluster -n takeover [-H|--host ] [-U|--user ] [-i|--identity ] [--appdir ] [--datadir ] [--logdir ] [--tmpdir ] [--tooldir ] +``` + +- `[-H|--host ]` :指定接管节点的主机,必填项。此参数明确了需要被接管的节点所在的主机 IP 地址。 +- `[-U|--user ]` :指定接管节点的用户,必填项。准确指定节点对应的用户,以便进行有效的连接和管理。 +- `[-i|--identity ]` :SSH 私钥路径。这有助于建立更安全的连接方式。 +- `[--appdir ]` :数据库的目录。 +- `[--datadir ]` :数据库的数据目录,明确数据存储的具体位置。 +- `[--logdir ]` :数据库的日志目录,用于存储相关日志信息。 +- `[--tmpdir ]` :数据库的临时目录,处理临时数据的存放区域。 +- `[--tooldir ]` :数据库的工具目录,涉及相关工具的存放位置。 + +需要注意的是,在 `takeover` 命令中仅有两个参数是必填项,其他参数可以根据实际情况选择是否填写。 + +PTK 会依据所填的用户和机器信息进行连接,并进而获取该机器下的数据库信息。 + +其中,当 `-i|--identity` 不填时,PTK 会以交互的方式指导用户输入密码或秘钥,以确保连接的安全性和可靠性。如下: + +```bash +$ ptk cluster -n test takeover -U mog -H +Use the arrow keys to navigate: ↓ ↑ → ← +? [retry: 1] please choose the auth method for connecting mog@: +▸ password + keyfile +``` + +此时选择对应的方式进行填写即可。 + +此外,在实际应用中,用户需要确保所提供的信息准确无误,尤其是主机 IP 和用户信息,这将直接影响到接管操作的成功与否。 + +同时,若对于数据库相关目录进行填写,也需依据实际的部署情形进行合理填写,以确保数据库的正常运行与有效管理。若不填写,则如以下示例,PTK 会自动查出对应目录供用户进行确认。 + +以下是完整示例: + +```bash +$ ptk cluster -n test takeover -U mog -H +✔ [retry: 1] please choose the auth method for connecting mog@: password +✔ please enter the password: ********* +Information about the node (mog@1) to be takeover: + 1 | appdir | /opt/mogdb-mog/app + 2 | datadir | /opt/mogdb-mog/data + 3 | logdir | /opt/mogdb-mog/log + 4 | tmpdir | /opt/mogdb-mog/tmp + 5 | tooldir | /opt/mogdb-mog/tool + 6 | port | 23419 +✔ Do you want to modify them (default=n) [y/n]: n +INFO[2024-06-13T17:08:17.033] update cluster_static_file success +INFO[2024-06-13T17:08:17.111] update metadata success +INFO[2024-06-13T17:08:17.111] takeover success +``` + +在接管过程中,PTK 会自动处理一些可能出现的异常情况,但用户仍需密切关注操作过程,以便及时发现和解决可能出现的问题。通过正确使用接管节点的指令,用户可以更加灵活地管理和扩展数据库集群,满足不同场景下的需求。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-throwout.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-throwout.md new file mode 100644 index 0000000000000000000000000000000000000000..840051b45d299cd8dd9a7d596a7f7e4e9dc3bab7 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-throwout.md @@ -0,0 +1,41 @@ +--- +title: 抛弃节点 +author: Bai Kai +date: 2024-06-14 +--- + +# 抛弃节点 + +## 目的 + +在由 PTK 管理的部分集群中,有时会期望放弃对集群中某一个节点的管理,然而该集群由于数据众多而无法进行重新删除安装。鉴于此种情况,PTK 1.5.0 引入了 `throwout` 指令,用于抛弃指定集群中的某一节点。 + +需特别注意的是,若当前集群中存在非主节点,那么则不能直接抛弃主库。 + +PTK 针对 throwout 设定了一些限制,例如:当前集群为一主一备一级联,此时若要抛弃备库或主库是不被允许的,需先将级联备库抛弃后,方可抛弃备库。然后在抛弃主库。 + +## 使用方法 + +利用 PTK 抛弃指定节点的命令如下: + +```bash +# 指定ip +ptk cluster -n throwout -H +# 指定节点ID +ptk cluster -n throwout -i +``` + +`throwout` 指令相对较为简单,但在使用时其限制条件需加以注意: + +1. 在进行 `throwout` 操作时,需查看指定节点是否存在下游库。 +2. 需确认指定的节点是否处于当前集群。 +在 `throwout` 的使用过程中会有交互,以让用户确认是否要抛弃该节点。如以下示例: + +```bash +$ ptk cluster -n throwout -i +Nodes to be throwout: +- +✔ Are you sure you want to throwout them (default=n) [y/n]: █ +``` + +当然,PTK 提供了 `-y|--yes` 参数,可跳过交互环节。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-uninstall-cm.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-uninstall-cm.md new file mode 100644 index 0000000000000000000000000000000000000000..f6e46584edafcd646f323003233152bbfcaa1c3b --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-uninstall-cm.md @@ -0,0 +1,15 @@ +--- +title: 卸载CM组件 +author: Qian Yao +date: 2024-06-12 +--- + +# 卸载 CM 组件 + +PTK 针对[独立安装CM组件](./manage-cluster-install-cm.md)功能提供了单独卸载 [CM(Cluster Manager)](https://docs.mogdb.io/zh/mogdb/v5.0/14-cm) 组件的功能。 + +卸载命令: + +```bash +ptk cluster -n uninstall-cm +``` diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-uninstall-mogha.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-uninstall-mogha.md new file mode 100644 index 0000000000000000000000000000000000000000..3842dded87322da6b163fee926428431667272a7 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-uninstall-mogha.md @@ -0,0 +1,15 @@ +--- +title: 卸载MogHA服务 +author: Bai Kai +date: 2024-06-17 +--- + +# 卸载MogHA服务 + +卸载MogHA一条指令就可以完成: + +```shell +ptk cluster -n uninstall-mogha +``` + +- **:** 集群名称 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-upgrade.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-upgrade.md new file mode 100644 index 0000000000000000000000000000000000000000..1c53ec8737eb2ce809f9e87ed60ce49ae7d23b2c --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-upgrade.md @@ -0,0 +1,157 @@ +--- +title: 升级数据库 +summary: 升级数据库 +author: Yao Qian +date: 2023-04-12 +--- + +# 升级数据库 + +升级是指在现有集群的基础上,不需要导出数据的情况下,直接对数据库二进制及元数据进行升级到更高的版本。 + +## MogDB 版本支持表 + + + + + + + + +
目标版本
2.0.x3.0.0/3.0.13.0.2+5.0.x
当前版本2.0.x
3.0.x-
5.0.x---
+ +## 注意事项 + +> 1. 如果集群部署 CM 组件,需使用 PTK 1.5.0 或后续版本操作 +> 2. 如果当前集群安装了 compat-tools,为避免和高版本的 whale 插件冲突,需先评估将当前版本的 compat-tools 卸载 +> 3. 由于早期版本的原因,2.0.x 版本升级到 3.0.0/3.0.1 需先升级到 2.1,由于PTK不支持升级到 Preview 版本,所以不支持从 2.0.x 版本升级到 3.0.0/3.0.1 + +## 限制 + +- 不支持 2.0 以前的版本 +- 不支持高版本向低版本升级 +- 不支持升级到 Preview 版本(版本号第二位为1的为 Preview 版本,比如 `3.1.0`) +- 集群流复制参数需开启(`enable_stream_replication`) +- 升级前集群状态需正常 `Normal` + +## 就地升级 + +数据库集群升级包含两个阶段: + +1. 升级:升级失败后可回滚,可重复执行升级命令,支持断点续传 +2. 提交:第一步升级成功后,才能提交,提交后不可回滚 + +在做数据库集群升级前,我们需要先通过一下命令来确认当前数据库集群是否有创建过插件: + +```bash +ptk cluster -n list-plugins +``` + +执行后会输出两个表格,第一个表格代表安装过的插件列表,安装过并不意味着数据库里使用了。 + +第二个表格代表具体的每个数据库中创建过的插件,如果没有创建过任何插件,Extension(s) 字段会为空。 + +我们需要确认第二个表格中 Extension(s) 字段下是否有值,不同的情况升级的方式有些许差别。 + +### 未创建插件的集群升级 + +如果升级前的数据库内没有创建过任何插件,可以直接指定新版本的安装包进行升级: + +```bash +ptk cluster -n upgrade [-y] -p +``` + +### 创建了插件的集群升级 + +如果数据库中使用了插件的话,由于升级后数据库元数据会发生改变,可能会导致升级后插件不可用或者升级失败。 + +所以对于使用了插件的集群,需额外指定以下参数来升级: + +- `--plugin-dir`: 本地目录,该目录下存放提前下载的新版本插件包(!下载的插件包请勿变更文件名) +- `--plugin-upgrade-patch`: 插件升级所需的 SQL 补丁包(目标版本为 **MogDB 5.0.2或更新**时,无需指定此参数) + +```bash +ptk cluster -n upgrade [-y] -p --plugin-dir +``` + +执行上述命令后,PTK 会完成升级的完整操作,升级后集群已经以新版本运行,此时您可以在数据库上进行验证操作,如果发现问题可以通过 `upgrade-rollback` 命令进行回滚,PTK 会将集群回滚为旧版本的状态。 + +```bash +ptk cluster -n upgrade-rollback +``` + +如果升级过程中存在报错中断,您可以通过人为介入来解决,当解决了问题后,可以通过重新执行升级指令继续完成升级 + +### 提交 + +提交升级,开启集群读写状态,删除旧版本的备份文件,提交后**集群无法再回滚** + +```bash +ptk cluster -n upgrade-commit +``` + +## 滚动升级 + +在 PTK 1.4.0 版本开始,支持了滚动升级的能力,但由于滚动升级过程中,始终是针对备库进行升级,不会直接升级主库,所以如果升级过程无法提交任何SQL,升级过程主库仍然可以保持读写状态,故滚动升级存在以下两个限制条件: + +1. 升级前后数据库的内核版本需保持一致,如果不一致则涉及需要执行升级SQL,所以暂无法实现; + + > 内核版本可通过 `ptk candidate db` 输出的 `Number` 列查看(需 1.4.0 以上版本) + +2. 不存在需要升级的插件; + +### 滚动升级流程 + +![ptk滚动升级](https://cdn-mogdb.enmotech.com/docs-media/ptk/ptk-rolling-upgrade.jpg) + +### 滚动升级操作步骤 + +以一主一备为例,假设初始状态时主库IP为 `IP1`, 备库为 `IP2` + +1. 检查机器状态为 Normal + + ```shell + ptk cluster -n <集群名> status + ``` + +2. 升级集群中的备库 + + 通过 `-H` 参数执行集群内一个备库进行单节点升级,该节点要能够临时切为主提供服务 + + ```shell + ptk cluster -n <集群名> upgrade -p <新版本安装包> -H + ``` + +3. 进行主备倒换 + + 将升级后的备库提升为主库,原主库降为备库 + + ```shell + ptk cluster -n <集群名> switchover -H + ``` + +4. 升级原来的主库 + + ```shell + ptk cluster -n <集群名> upgrade -p <新版本安装包> -H + ``` + +5. (可选) 将主重新切换到原主机器 + + ```shell + ptk cluster -n <集群名> switchover -H + ``` + +6. 提交升级 + + ```shell + ptk cluster -n <集群名> upgrade-commit + ``` + +### 提交 + +当滚动的将集群内所有节点都升级完成后,就可以提交升级,删除旧版本的备份文件,提交后**集群无法再回滚** + +```bash +ptk cluster -n upgrade-commit +``` diff --git a/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-vip.md b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-vip.md new file mode 100644 index 0000000000000000000000000000000000000000..378b368400eea0294102477dc70ec7e793a90907 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/guide/manage-cluster/manage-cluster-vip.md @@ -0,0 +1,57 @@ +--- +title: 管理VIP +author: gxk +date: 2024-06-18 +--- + +# 管理集群 VIP + +此文档仅包含带 CM 组件的集群 VIP 管理。`MogHA` 组件的 VIP 配置参考[该文档](https://docs.mogdb.io/zh/mogha/v2.4/configuration-file#%E6%9C%BA%E6%88%BF%E9%85%8D%E7%BD%AE) + +## VIP 的目的 + +VIP 代表虚拟 IP,其不与特定的服务器或网卡相对应,可以被绑定到任何一个同网段的服务器上,所以使用虚拟 IP 来连接数据库服务,可以保证在数据库发生切换以后,VIP 被绑定到新的主库服务器时,对于业务来说无需变更配置,保证了业务的连续性。 + +## 前提 + +使用 `load-cm-vip` 对集群进行操作时,该集群必须已安装 CM 组件。 + +## 操作 VIP + +PTK 对 VIP 的操作提供了安装,卸载,刷新等功能。 + +操作命令: + +```shell +ptk cluster -n load-cm-vip --action ACTION --vip VIP +``` + +参数说明: + +|参数名称|参数类型|说明| +|:------|:------|:----| +|--action|String|对 cm-vip 的操作类型,当前仅支持 [install,uninstall,refresh]| +|--vip|String|VIP 的值,仅 install 时必填该值| + +## QA + +### 安装 VIP 后,如何查看是否安装成功? + +1. 查看安装命令是否有报错。 +2. 执行 `ptk cluster -n status`。并查看其 `active_vip` 一栏是否符合预期。 + +### load-cm-vip 有 MogDB 的版本限制吗? + +有限制。对于 MogDB>=5.0.4 时,才可执行该命令完成对 VIP 的操作。 + +### 如何通过 CM 组件的命令完成对 VIP 的操作? + +使用 CM 组件命令对 VIP 操作可参考[此文档](https://docs.mogdb.io/zh/mogdb/v5.0/manual-configuration-of-vip) + +### 集群扩缩容会对 VIP 有影响吗? + +不会。使用 PTK 对集群扩缩容后,若已安装了 VIP,则 PTK 会对集群刷新一次 VIP 配置,以保证 CM 组件的配置正确且可用。 + +### 最多支持安装多少个 VIP? + +能安装的 VIP 数量取决于当前集群所使用的网段数量。 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/overview.md b/product/zh/docs-ptk/v2.0/overview.md new file mode 100644 index 0000000000000000000000000000000000000000..885d2ab4fb89554689afe87ad21bb61da186639a --- /dev/null +++ b/product/zh/docs-ptk/v2.0/overview.md @@ -0,0 +1,85 @@ +--- +title: PTK 使用文档 +summary: PTK 使用文档 +author: Yao Qian +date: 2023-04-05 +--- + +# 关于PTK + +PTK (Provisioning Toolkit)是使用 Golang 针对 MogDB 数据库开发的一款命令行运维工具,旨在帮助用户更便捷地部署和管理 MogDB 数据库集群。 + +## 使用场景 + +- 开发人员快速启动多个本地 MogDB 环境 +- 用户通过 PTK 快速安装部署 MogDB +- DBA 日常运维使用 +- 第三方运维平台集成 + +## 推荐部署架构 + +PTK 的定位是一个**中心化多集群**管理软件,作为一个中控软件的角色,通过 SSH 的方式远程管理多个数据库集群,所以,我们推荐您将PTK部署在单独的一台控制服务器上,然后将数据库部署到数据库专属的服务器上,如下图。当然,PTK也支持本地部署,您可以根据您的机器情况自行安排安装位置。 + +*(注:PTK依赖本地元数据来进行集群管理,不同操作系统用户安装的PTK相互独立不可见)* + +``` + +-----------+ + | PTK | + +-----------+ + /---ssh-----/ | \---ssh----\ + / ssh \ + / | \ + +-----------+ +-----------+ +-----------+ + | MogDB | | MogDB | | MogDB | + +-----------+ +-----------+ +-----------+ +``` + +## PTK 支持部署 MogDB 的操作系统 + +> 最新列表请通过 `ptk candidate os` 查看 + +*(注:该表格列出的操作系统为PTK测试能够部署成功 MogDB 的数据库,且常规的 CRUD 操作运行正常。除非表格中说明经过完全的兼容性测试,否则请在生产部署前自行进行充分的业务验证)* + +| ID | 操作系统 | 推荐使用的安装包 | PTK测试过的操作系统版本 | 经过完全兼容性测试的MogDB数据库版本 +|----------|----------------------------------------------|------------------|----------------------|----------------------------- +| 1007010 | CentOS Linux 7 (Core) (x86_64) | CentOS | 7.6.1810 | all versions +| 1008010 | CentOS 8 (x86_64) | openEuler | 8.0.1905 | +| 1008020 | CentOS 8 (arm64) | openEuler | 8.0.1905 | +| 1120010 | openEuler 20 (x86_64) | openEuler | 20.03 | < 5.0.0 || > 5.0.1 +| 1120020 | openEuler 20 (arm64) | openEuler | 20.03 | < 5.0.0 || > 5.0.1 +| 1122010 | openEuler 22 (x86_64) | openEuler | 22.03 | +| 1122020 | openEuler 22 (arm64) | openEuler | 22.03 | +| 1210010 | Kylin V10 (x86_64) | kylin | V10 (Tercel) | all versions +| 1210020 | Kylin V10 (arm64) | kylin | V10 (Tercel) | all versions +| 1320010 | UOS 20 A (x86_64) | openEuler | 1050a | +| 1320020 | UOS 20 A (arm64) | openEuler | 1050a | +| 1420010 | UOS 20 D/E (x86_64) | openEuler | 1040d/1050d/1050e | +| 1420020 | UOS 20 D/E (arm64) | openEuler | 1040d/1050d | +| 1518010 | Ubuntu 18.04.6 LTS (Bionic Beaver) (x86_64) | CentOS | 18.04.6 | +| 1518020 | Ubuntu 18.04.6 LTS (Bionic Beaver) (arm64) | openEuler | 18.04.6 | +| 1520010 | Ubuntu 20 LTS (Focal Fossa) (x86_64) | CentOS | 20.04.3 | +| 1520020 | Ubuntu 20 LTS (Focal Fossa) (arm64) | openEuler | 20.04.5 | +| 1522010 | Ubuntu 22 LTS (Jammy Jellyfish) (x86_64) | CentOS | 22.04 | +| 1522020 | Ubuntu 22 LTS (Jammy Jellyfish) (arm64) | openEuler | 22.04.1 | +| 1607010 | Red Hat Enterprise Linux 7 (x86_64) | CentOS | 7.5 (Maipo) | +| 1608010 | Red Hat Enterprise Linux 8 (Ootpa) (x86_64) | openEuler | 8.5 | +| 1608020 | Red Hat Enterprise Linux 8.2 (Ootpa) (arm64) | openEuler | 8.2 | +| 1609010 | Red Hat Enterprise Linux 9.0 (Plow) (x86_64) | openEuler | 9.0 | +| 1609020 | Red Hat Enterprise Linux 9.0 (Plow) (arm64) | openEuler | 9.0 | +| 1702010 | EulerOS 2 (x86_64) | CentOS | 2.0-SP3 | +| 1702020 | EulerOS 2 (arm64) | openEuler | 2.0-SP3 | +| 1812010 | SLES 12SP5 (x86_64) | CentOS | 12SP5 | +| 1815010 | SUSE Linux Enterprise Server 15 SP4 (x86_64) | CentOS | 15SP4 | +| 1907010 | Oracle Linux 7 (x86_64) | CentOS | 7.9 (Maipo) | +| 1908010 | Oracle Linux 8 (x86_64) | openEuler | 8.6 (Ootpa) | +| 2008010 | Rocky Linux 8 (Green Obsidian) (x86_64) | openEuler | 8.5 | +| 2107010 | NeoKylin V7 (x86_64) | CentOS | V7Update6 | +| 2222010 | FusionOS 22 (x86_64) | openEuler | 22.0.2 | +| 2222020 | FusionOS 22 (arm64) | openEuler | 22.0.2 | +| 2310010 | Debian GNU/Linux 10 (buster) (x86_64) | CentOS | 10 (buster) | +| 2310020 | Debian GNU/Linux 10 (buster) (arm64) | openEuler | 10 (buster) | +| 2311010 | Debian GNU/Linux 11 (bullseye) (x86_64) | CentOS | 11 (bullseye) | +| 2311020 | Debian GNU/Linux 11 (bullseye) (arm64) | openEuler | 11 (bullseye) | +| 2407010 | Anolis OS Linux 7 (x86_64) | CentOS | 7.9 GA (kernel:RHCK) | +| 2408010 | Anolis OS 8 (x86_64) | openEuler | 8.6 GA (kernel:RHCK) | +| 2408020 | Anolis OS 8 (arm64) | openEuler | 8.6 GA (kernel:ANCK) | diff --git a/product/zh/docs-ptk/v2.0/quick-start/demo-db.md b/product/zh/docs-ptk/v2.0/quick-start/demo-db.md new file mode 100644 index 0000000000000000000000000000000000000000..1ae11d0bc3912608b4872ab31d034922306a2a3f --- /dev/null +++ b/product/zh/docs-ptk/v2.0/quick-start/demo-db.md @@ -0,0 +1,130 @@ +--- +title: ptk demo +summary: ptk demo +author: qian.yao +date: 2023-04-12 +--- + +# 快速部署 MogDB 单实例集群 + +在 PTK 所在的机器上无需提供配置文件的情况下,可以通过 `ptk demo` 命令快速部署一个单实例的 MogDB 数据库并自动安装相关的组件。 + +> 注:demo 安装过程依赖网络进行安装包的下载 + +## 演示 + +
+ +## 目的 + +- 为用户提供一个快速体验 MogDB 集群的方式 +- 提供A兼容模式的库,供 `Oracle` 兼容性测试 +- 提供PG兼容模式的库,供 `PostgreSQL` 兼容性测试 + +## 前提 + +目前仅限 linux 操作系统使用 + +在执行前请确保端口 **26000** 空闲,如果需要使用其他端口,可以通过 `--port` 选项进行指定。 + +## 安装的MogDB是什么版本? + +默认为最新的LTS版本 + +## 安装哪些插件? + +针对A模式的 `oracle_compatibility` 库,安装的插件列表如下: + +- [whale](https://docs.mogdb.io/zh/mogdb/v3.0/whale) +- [orafce](https://docs.mogdb.io/zh/mogdb/v3.0/orafce-user-guide) +- [compat_tools](https://gitee.com/enmotech/compat-tools) +- [mogila](https://gitee.com/enmotech/mogila) + +## 安装后的信息说明 + +``` +Deploy Status: + + cluste_name | host | user | port | status | message +--------------+-----------------+------+-------+---------------+---------- + demo_SWW | 192.168.122.104 | demo | 26000 | start_success | success +``` + +部署状态信息: + +- cluster_name: 集群名称 +- host: 实例IP +- user: 运行的系统用户 +- port: 运行的端口 +- status: 部署状态 +- message: 状态描述 + +``` +Database Detail: + + item | value +--------------+------------------------- +user_password | Demo&Fth + db_password | Demo&Fth + app_dir | /home/demo/demodb/app + data_dir | /home/demo/demodb/data + tool_dir | /home/demo/demodb/tool + tmp_dir | /home/demo/demodb/tmp +``` + +数据库信息: + +- db_password: 数据库初始密码 +- app_dir: 数据库应用目录 +- data_dir: 数据库数据目录 +- tool_dir: 数据库工具目录 +- tmp_dir: 数据库临时文件目录 + +``` +Mode Compatibility: + + mode | database | plugins | other +-------+------------------------+-----------------------+------------------------------------- + PG | postgres_compatibility | none | + A | oracle_compatibility | whale[success] | + | | orafce[success] | + | | compat_tools[success] | + | | mogila[success] | db user: mogdb, password: Demo&SWW + +Plugin Install Details: + mode | plugin | status | reference | error +-------+--------------+---------+-------------------------------------------------------+-------- + A | whale | success | https://docs.mogdb.io/zh/mogdb/v3.0/whale | + | orafce | success | https://docs.mogdb.io/zh/mogdb/v3.0/orafce-user-guide | + | compat_tools | success | https://gitee.com/enmotech/compat-tools | + | mogila | success | https://gitee.com/enmotech/mogila | +``` + +兼容性数据库信息: + +- mode: 兼容模式 +- database: 数据库名称 +- plugins: 该数据库中的插件列表 +- other: 备注信息 + +## 连接数据库 + +如果 ptk 用户是在 root 下安装的,可直接切换到数据库用户下,通过 gsql 进行连接测试。 + +如果您和本示例中一样是在普通用户下安装的,数据库会安装到PTK所在的当前用户下,所以需要重新登录或者先执行 `source ~/.bashrc` 使环境变量生效,再通过 gsql 连接测试。 + +```shell +$ gsql -r +MogDB=# \l + List of databases + Name | Owner | Encoding | Collate | Ctype | Access privileges | Compatibility +------------------------+-------+----------+---------+-------+-------------------+--------------- + oracle_compatibility | demo | UTF8 | C | C | | A + postgres | demo | UTF8 | C | C | | A + postgres_compatibility | demo | UTF8 | C | C | | PG + template0 | demo | UTF8 | C | C | =c/demo +| A + | | | | | demo=CTc/demo | + template1 | demo | UTF8 | C | C | =c/demo +| A + | | | | | demo=CTc/demo | +(5 rows) +``` diff --git a/product/zh/docs-ptk/v2.0/quick-start/install-ptk.md b/product/zh/docs-ptk/v2.0/quick-start/install-ptk.md new file mode 100644 index 0000000000000000000000000000000000000000..b4924d2ac6d174cfa912ed51df394df9ab558259 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/quick-start/install-ptk.md @@ -0,0 +1,50 @@ +--- +title: 软件安装 +summary: 软件安装 +author: Yao Qian +date: 2022-05-30 +--- + +# 安装 PTK + +PTK 是一个可以独立运行的二进制文件,除了 CPU 架构外,对运行的操作系统没有额外的依赖,所以可以将 PTK 二进制放置到任何位置运行。 + +虽然 PTK 可以和数据库集群放到一起运行,但我们推荐您单独准备一台控制服务器来安装 PTK,和运行数据库的服务器隔离开单独管理,通过该控制服务器去部署管理数据库集群,这样可以避免数据库实例机器故障影响到 PTK 不可用。 + +PTK 的安装很简单,可以通过**在线**或**离线**两种方式任选一种进行安装。 + +## 在线安装 + +> 注:命令行安装方式不支持 Windows 系统 + +在终端中,执行以下指令即可自动完成安装: + +```shell +curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install.sh | sh +``` + +该指令会自动将 PTK 安装在用户的家目录 `$HOME/.ptk` 目录下,该目录以后会作为 PTK 工具的工作目录, +其产生的缓存文件、数据文件以及集群的配置信息,备份信息等文件均会存储到该目录下。 +同时,安装指令会自动将 `$HOME/.ptk/bin` 的路径加入到对应 SHELL Profile 文件(安装日志的末尾会显示)的 PATH 环境变量中, +这样在用户登录到服务器后就可以直接使用 `ptk` 指令了。 + +执行安装完成后,用户重新打开终端即可激活 `ptk` 命令。 + +## 离线安装 + +如果您的服务器无法直接访问互联网或者是需要在 Windows 系统上使用 PTK 工具,此时可以通过手动方式进行安装。 + +请按照以下操作步骤进行安装: + +1. 先从下面链接页面下载对应服务器架构的安装包: + + [🔗 https://www.mogdb.io/downloads/ptk/all](https://www.mogdb.io/downloads/ptk/all) + +2. 将安装包上传到目标服务器上解压即可 + + ```shell + mkdir -p $HOME/.ptk/bin + tar -xvf <安装包> -C $HOME/.ptk/bin + echo "export PATH=$HOME/.ptk/bin:$PATH" >> $HOME/.bashrc + source $HOME/.bashrc + ``` diff --git a/product/zh/docs-ptk/v2.0/reference/ref-config.md b/product/zh/docs-ptk/v2.0/reference/ref-config.md new file mode 100644 index 0000000000000000000000000000000000000000..df512b74356c5f7946f043a974a98638f4bd4626 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/reference/ref-config.md @@ -0,0 +1,886 @@ +--- +title: 配置文件 +author: Yao Qian +date: 2024-06-01 +--- + +# 配置文件 + +PTK 的拓扑配置文件采用 [YAML格式](../yaml-grammar.md)。 + +该文件介绍了拓扑配置文件的所有参数。 + +在安装数据库集群时,需用户提供一个描述集群拓扑的配置文件来告诉 PTK 应该按照什么结构来部署集群。 + +PTK 提供了交互式创建配置文件的功能,通过运行下面的指令可以进入交互流程: + +```shell +ptk template create +``` + +你只需要按照终端提示的步骤逐步完成配置,最终会在当前文件夹下生成 config.yaml 文件。 +另外,如果想要不使用交互式创建,直接生成一个默认配置的文件,可以运行命令: + +```shell +ptk template > config.yaml +``` + +运行后可以生成一个 config.yaml 的文件,需用户根据自己的实际情况修改文件里面的字段值。 + +在非交互式修改时,配置文件中的系统用户密码 (user_password),数据库密码 (db_password),SSH密码 (ssh_option.password) 或密钥口令 (ssh_option.passphrase) 等敏感字段, + +必须使用 PTK 提供的加密命令进行加密后填写: + +```shell +ptk encrypt PASSWORD +``` + +--- + +## Config + +Config 数据库集群拓扑配置信息 + +**示例**: + +- 简单配置示例 + +```yaml +# 集群级别的配置信息,其中 `db_port` 和 `ssh_option` 字段是 **可重用字段** +global: + cluster_name: cluster_simple # 集群名称,PTK管理的集群的唯一标识 + db_password: pTk6MTIxOGMxOTk8QT1CPT4+PXlnYW1DdHpXb2hCX3c3UW0wWXVkNlZwMGRCakpxRXd1WWdwQ0xDUWVrb0U= # 数据库的初始用户密码,若配置文件中未填写,会在安装时通过交互式要求输入 +# 集群内的数据库实例服务器配置信息 +db_servers: + - host: # 数据库实例服务器 IP (仅支持 IPv4) + - host: # 数据库实例服务器 IP (仅支持 IPv4) +# 集群内的CM服务部署机器列表 +cm_servers: [] +``` + +- 复杂配置示例 + +```yaml +# 集群级别的配置信息,其中 `db_port` 和 `ssh_option` 字段是 **可重用字段** +global: + cluster_name: cluster_complex # 集群名称,PTK管理的集群的唯一标识 + user: omm # 运行数据库的操作系统用户名 + group: omm # 运行数据库的操作系统用户组 + db_password: pTk6MTIxOGMxOTk8QT1CPT4+PXlnYW1DdHpXb2hCX3c3UW0wWXVkNlZwMGRCakpxRXd1WWdwQ0xDUWVrb0U= # 数据库的初始用户密码,若配置文件中未填写,会在安装时通过交互式要求输入 + base_dir: /opt/mogdb # 数据库安装的基础目录,一般建议指定到配置文件中 ssh 用户可访问的目录下的路径,让PTK自动创建。 + # 额外新增 HBA 条目列表 + extra_hba_conf: + - type: host # 连接类型,支持 local/host/hostssl/hostnossl + database: all # 指定这条记录所匹配的数据库名称 + user: all # 指定这条记录匹配哪些数据库用户名 + address: # 必填,指定这个记录匹配的客户端机器地址。 + method: sha256 # 指定当一个连接匹配这个记录时,要使用的认证方法。 + # MogDB 高可用组件 CM 配置信息,若不使用 CM 组件,则无需填写该字段 + cm_option: + dir: /opt/mogdb/cm # CM 安装目录 + cm_server_port: 15300 # cm server 监听端口 + db_service_vip: "" # 数据库提供服务的虚拟IP +# 集群内的数据库实例服务器配置信息 +db_servers: + - host: # 数据库实例服务器 IP (仅支持 IPv4) + db_port: 27000 # 数据库端口 + role: primary # 数据库实例角色,若不填,PTK 会随机选择一个实例作为主库,其余自动为备库 + az_name: BJ # Available Zone (可用区) 名称 + az_priority: 1 # 可用区使用的优先级,数值越小优先级越高, 最小为 1 + # SSH 登录信息,登录用户需为 **root** 或者具有 sudo 权限的用户 + ssh_option: + port: 22 # SSH 服务端口 + user: root # SSH 登录用户 + password: pTk6LIBsPVplOpmxQToCPT9+PXlnYW1DdHpXb2hCX3c3UW0wWXVkNlZwMGRCakpxRXd1WWdwQ0xDUWVrb0U= # SSH 登录用户密码 + conn_timeout: 5m0s # SSH 登录连接超时时间,支持单位 m(分),s(秒) + exec_timeout: 5m0s # SSH 执行单条命令时的超时时间,支持单位 m(分),s(秒) + - host: # 数据库实例服务器 IP (仅支持 IPv4) + db_port: 27000 # 数据库端口 + role: standby # 数据库实例角色,若不填,PTK 会随机选择一个实例作为主库,其余自动为备库 + az_name: BJ # Available Zone (可用区) 名称 + az_priority: 1 # 可用区使用的优先级,数值越小优先级越高, 最小为 1 + # SSH 登录信息,登录用户需为 **root** 或者具有 sudo 权限的用户 + ssh_option: + port: 22 # SSH 服务端口 + user: root # SSH 登录用户 + key_file: ~/.ssh/id_rsa # SSH 登录密钥文件路径 + conn_timeout: 5m0s # SSH 登录连接超时时间,支持单位 m(分),s(秒) + exec_timeout: 5m0s # SSH 执行单条命令时的超时时间,支持单位 m(分),s(秒) + - host: # 数据库实例服务器 IP (仅支持 IPv4) + db_port: 27000 # 数据库端口 + role: cascade_standby # 数据库实例角色,若不填,PTK 会随机选择一个实例作为主库,其余自动为备库 + upstream_host: # 当实例角色为 cascade_standby 时,该字段表示要跟随的上游备库 IP + az_name: SH # Available Zone (可用区) 名称 + az_priority: 2 # 可用区使用的优先级,数值越小优先级越高, 最小为 1 +# 集群内的CM服务部署机器列表 +cm_servers: + - host: # CM Server 服务器 IP (仅支持 IPv4) + port: 15300 # CM Server 监听端口 + role: "" + - host: # CM Server 服务器 IP (仅支持 IPv4) + port: 15300 # CM Server 监听端口 + role: "" +``` + +### global + +**类型**: Global + +**描述**: 集群级别的配置信息,其中 `db_port` 和 `ssh_option` 字段是 **可重用字段**

**可重用字段**
如果实例级别设置了该字段,则对应实例使用实例级别的值;
如果实例级别未配置该字段,则继承 global 级别的字段的值。 + +**新增于**: v0.1 + +### db_servers + +**类型**: []DBServer + +**描述**: 集群内的数据库实例服务器配置信息 + +**新增于**: v0.1 + +### cm_servers + +**类型**: []CMServer + +**描述**: 集群内的CM服务部署机器列表 + +**新增于**: v0.5 + +--- + +## Global + +Global 定义配置文件中全局参数 + +Appears in: + +- Config.global + +### cluster_name + +**类型**: string + +**描述**: 集群名称,PTK管理的集群的唯一标识 + +**新增于**: v0.1 + +### user + +**类型**: string + +**描述**: 运行数据库的操作系统用户名
如果想一套主备在同一个服务器上部署,需在实例级别设置不同的用户来隔离环境
默认为:"omm" + +**新增于**: v0.1 + +### group + +**类型**: string + +**描述**: 运行数据库的操作系统用户组
默认和操作系统用户同名 + +**新增于**: v0.1 + +### user_password + +**类型**: string + +**描述**: 运行数据库的操作系统用户密码
该字段不支持明文填写,需使用 ptk encrypt 加密
默认为空,不设置 + +**新增于**: v0.1 + +### db_password + +**类型**: string + +**描述**: 数据库的初始用户密码,若配置文件中未填写,会在安装时通过交互式要求输入
该字段不支持明文填写,需使用 ptk encrypt 加密 + +**新增于**: v0.1 + +### db_port + +**类型**: int + +**描述**: 数据库的运行端口
如果在单个服务器上部署主备,需在实例级别设置不同的端口号
默认值: 26000 + +**新增于**: v0.1 + +### base_dir + +**类型**: string + +**描述**: 数据库安装的基础目录,一般建议指定到配置文件中 ssh 用户可访问的目录下的路径,让PTK自动创建。
如果 PTK 在执行安装时使用的为非 root 用户的话,普通用户没有权限在 /opt 目录下创建目录,所以默认值 `/opt/mogdb` 会出现无权创建的问题,需用户指定一个执行用户可访问的路径。
指定该目录后,app_dir,data_dir,log_dir和tool_dir 参数中若未配置的,PTK 会自动在该安装目录下会创建对应的目录;
无特殊要求情况下,我们推荐用户在安装时仅设置该参数即可
注意:若在单机上部署集群时,需在实例级别设置不同的安装目录
默认值: "/opt/mogdb" + +**新增于**: v0.1 + +### app_dir + +**类型**: string + +**描述**: 数据库部署文件、启动脚本和配置文件的存放路径
默认值: "${base_dir}/app" + +**新增于**: v0.1 + +### data_dir + +**类型**: string + +**描述**: 数据库数据存储目录
默认值: "${base_dir}/data" + +**新增于**: v0.1 + +### log_dir + +**类型**: string + +**描述**: 数据库运行日志和操作日志存储目录
默认值: "${base_dir}/log" + +**新增于**: v0.1 + +### tool_dir + +**类型**: string + +**描述**: 数据库工具目录
默认值: "${base_dir}/tool" + +**新增于**: v0.1 + +### tmp_dir + +**类型**: string + +**描述**: 数据库临时目录
默认值: 如果base_dir 不为空,值为 ${base_dir}/tmp, 否则为 /tmp + +**新增于**: v0.1 + +### core_file_dir + +**类型**: string + +**描述**: [v0.7及后面版本废弃] 该参数已废弃,不再生效,请切换超级用户后手动设置 `kernel.core_pattern` + +**新增于**: v0.1 + +### ssh_option + +**类型**: SSHOption + +**描述**: SSH 登录信息
不设置时为本地执行 + +**新增于**: v0.1 + +### gs_initdb_opts + +**类型**: []string + +**描述**: 用户自定义配置 gs_initdb 初始化数据库时的参数。
特别地, 如果用户未配置 locale 参数, PTK 默认会设置 no-locale
支持的参数列表请查看 gs_initdb 工具[文档](https://docs.mogdb.io/zh/mogdb/v3.0/5-gs_initdb) + +**示例**: + +- gs_initdb_opts 填写示例 + +```yaml +gs_initdb_opts: + - --locale=LOCALE + - -E=UTF-8 +``` + +**新增于**: v0.3 + +### extra_hba_conf + +**类型**: []HBAConf + +**描述**: 额外新增 HBA 条目列表 + +**新增于**: v1.5 + +### cm_option + +**类型**: CMOption + +**描述**: MogDB 高可用组件 CM 配置信息,若不使用 CM 组件,则无需填写该字段
仅在数据库版本 3.0 及以上生效 + +**新增于**: v0.4 + +### dss_option + +**类型**: DSSOption + +**描述**: MogDB 资源池化安装配置信息,非资源池化安装,无需填写该字段 + +**新增于**: v1.1.0 + +### env_map + +**类型**: map[string]string + +**描述**: 用户可根据需要增加特定的环境变量,在 global 中设置会对所有实例生效,
实例级别可单独设置,如果存在相同的 key,实例级的会覆盖 global 中的值 + +**新增于**: v1.2.0 + +--- + +## HBAConf + +HBAConf HBA 条目配置 + +Appears in: + +- Global.extra_hba_conf + +**示例**: + +- hba config 示例 + +```yaml +type: host # 连接类型,支持 local/host/hostssl/hostnossl +database: all # 指定这条记录所匹配的数据库名称 +user: all # 指定这条记录匹配哪些数据库用户名 +address: # 必填,指定这个记录匹配的客户端机器地址。 +method: sha256 # 指定当一个连接匹配这个记录时,要使用的认证方法。 +``` + +### type + +**类型**: string + +**描述**: 连接类型,支持 local/host/hostssl/hostnossl
具体含义请参考 MogDB 文档: [client-access-authentication](https://docs.mogdb.io/zh/mogdb/v5.0/1-client-access-authentication#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E5%8F%82%E8%80%83)
默认值: host + +**新增于**: v1.5.0 + +### database + +**类型**: string + +**描述**: 指定这条记录所匹配的数据库名称
默认值: all + +**新增于**: v1.5.0 + +### user + +**类型**: string + +**描述**: 指定这条记录匹配哪些数据库用户名
默认值: all + +**新增于**: v1.5.0 + +### address + +**类型**: string + +**描述**: 必填,指定这个记录匹配的客户端机器地址。
如果只设置一个IPv4或IPv6地址,未配置 CIDR 掩码,则默认针对 IPv4 使用 32 的 CIDR 掩码,针对 IPv6 使用 128 的 CIDR 掩码 + +**新增于**: v1.5.0 + +### method + +**类型**: string + +**描述**: 指定当一个连接匹配这个记录时,要使用的认证方法。
默认值: sha256 + +**新增于**: v1.5.0 + +### option + +**类型**: string + +**描述**: 在 method 域的后面,可以是形如 name=value 的域,它们指定认证方法的选项 + +**新增于**: v1.5.0 + +--- + +## DSSOption + +Appears in: + +- Global.dss_option + +### dir + +**类型**: string + +**描述**: DSS 安装目录
默认值: $base_dir/dss + +**新增于**: v1.1.0 + +### dss_port + +**类型**: int + +**描述**: dssserver 进程监听端口
默认值: 26010 + +**新增于**: v1.1.0 + +### dms_port + +**类型**: int + +**描述**: 数据库内部 dms 模块通信端口
默认值: 26020 + +**新增于**: v1.1.0 + +### shm_key + +**类型**: int + +**描述**: 共享内存KEY,范围 [1, 64],如果单个机器上部署多个 DSS 集群时,需确保该值不同
默认值: 1 + +**新增于**: v1.1.0 + +### log_level + +**类型**: int + +**描述**: DSS日志级别,范围 [0, 4087]
默认值: 519 + +**新增于**: v1.1.0 + +### data_vg_name + +**类型**: string + +**描述**: 数据卷组名
默认值: data + +**新增于**: v1.1.0 + +### data_vg_path + +**类型**: string + +**描述**: 数据卷路径 + +**新增于**: v1.1.0 + +### cm_voting_vg_path + +**类型**: string + +**描述**: CM 投票卷路径 + +**新增于**: v1.1.0 + +### cm_share_vg_path + +**类型**: string + +**描述**: CM 共享卷路径 + +**新增于**: v1.1.0 + +### inst_vg_map + +**类型**: map[string]string + +**描述**: 每个数据库实例的私有卷路径字典,需完整配置所有实例。
配置规则:{IP: vg_path, ...} + +**示例**: + +- inst_vg_map example + +```yaml +inst_vg_map: + 1.0.0.1: /dev/sdb + 1.0.0.2: /dev/sdc +``` + +**新增于**: v1.1.0 + +### enable_ssl + +**类型**: bool + +**描述**: 是否开启 ssl 认证
默认值: off
可选值: on/off + +**新增于**: v1.1.0 + +### inter_connect_type + +**类型**: string + +**描述**: 内部 MES 通信协议类型
默认值: TCP
可选值: TCP/RDMA + +**新增于**: v1.1.0 + +### ss_guc_config + +**类型**: map[string]string + +**描述**: 资源池化 GUC 参数配置
可选值参考 [openGauss 文档](https://docs.opengauss.org/zh/docs/5.0.0/docs/DatabaseReference/%E8%B5%84%E6%BA%90%E6%B1%A0%E5%8C%96%E5%8F%82%E6%95%B0.html) + +**新增于**: v1.1.0 + +--- + +## CMOption + +Appears in: + +- Global.cm_option + +### dir + +**类型**: string + +**描述**: CM 安装目录
默认值: $base_dir/cm + +**新增于**: v0.4 + +### cm_server_port + +**类型**: int + +**描述**: cm server 监听端口
默认值: 15300 + +**新增于**: v0.4 + +### db_service_vip + +**类型**: string + +**描述**: 数据库提供服务的虚拟IP + +**新增于**: v0.4 + +### cm_server_conf + +**类型**: map[string]string + +**描述**: cm_server.conf 中支持的配置参数, PTK 不对参数的准确性和有效性做校验 + +**示例**: + +- cm server conf + +```yaml +cm_server_conf: + key: value +``` + +**新增于**: v0.4 + +### cm_agent_conf + +**类型**: map[string]string + +**描述**: cm_agent.conf 中支持的配置参数, PTK 不对参数的准确性和有效性做校验 + +**示例**: + +- cm agent conf + +```yaml +cm_agent_conf: + key: value +``` + +**新增于**: v0.4 + +--- + +## CMServer + +CMServer CM服务配置信息 + +Appears in: + +- Config.cm_servers + +### host + +**类型**: string + +**描述**: CM Server 服务器 IP (仅支持 IPv4) + +**新增于**: v0.5 + +### ha_ips + +**类型**: []string + +**描述**: 数据库冗余IP,和当前 host 对应的 db_server 中的 ha_ips 保持一致 + +**新增于**: v1.1.0 + +### port + +**类型**: int + +**描述**: CM Server 监听端口
默认使用 global.cm_option.cm_server_port + +**新增于**: v0.5 + +### ssh_option + +**类型**: SSHOption + +**描述**: SSH 登录信息,登录用户需为 **root** 或者具有 sudo 权限的用户
不设置时为本地执行 + +**新增于**: v0.5 + +--- + +## serverFlag + +--- + +## DBServer + +DBServer 集群内的数据库实例服务器配置信息 + +Appears in: + +- Config.db_servers + +### dn_name + +**类型**: string + +**描述**: 一个集群中唯一标识数据实例的名称,该值将会写入配置 application_name
默认值:dn_ + +**新增于**: v1.0 + +### host + +**类型**: string + +**描述**: 数据库实例服务器 IP (仅支持 IPv4) + +**新增于**: v0.1 + +### user + +**类型**: string + +**描述**: 运行数据库的操作系统用户名
如果想一套主备在同一个服务器上部署,该字段需设置为不同的用户
默认和 global.user 配置一致 + +**新增于**: v0.5 + +### group + +**类型**: string + +**描述**: 运行数据库的操作系统用户组
默认和 global.group 配置一致 + +**新增于**: v0.5 + +### user_password + +**类型**: string + +**描述**: 运行数据库的操作系统用户密码
该字段不支持明文填写,需使用 ptk encrypt 加密
默认和 global.user_password 配置一致 + +**新增于**: v0.5 + +### db_port + +**类型**: int + +**描述**: 数据库端口
默认为空,复用全局的端口配置 26000 + +**新增于**: v0.1 + +### ha_ips + +**类型**: []string + +**描述**: 数据库冗余IP,目前最多配置一个冗余IP,如果配置了该字段,所有实例都需要配置 + +**新增于**: v0.1 + +### ha_port + +**类型**: int + +**描述**: 数据库主备实例日志复制端口,值固定只能为数据库端口加1,该字段无需配置 + +**新增于**: v0.1 + +### role + +**类型**: string + +**描述**: 数据库实例角色,若不填,PTK 会随机选择一个实例作为主库,其余自动为备库 + +**可选值**: + +- primary +- standby +- cascade_standby + +**新增于**: v0.1 + +### upstream_host + +**类型**: string + +**描述**: 当实例角色为 cascade_standby 时,该字段表示要跟随的上游备库 IP + +**新增于**: v0.1 + +### az_name + +**类型**: string + +**描述**: Available Zone (可用区) 名称
默认值:"AZ1" + +**新增于**: v0.1 + +### az_priority + +**类型**: int + +**描述**: 可用区使用的优先级,数值越小优先级越高, 最小为 1
默认值:1 + +**新增于**: v0.1 + +### xlog_dir + +**类型**: string + +**描述**: 数据库 Xlog 日志目录设置
默认为空,若需配置,值不能为数据目录的子目录 + +**新增于**: v0.1 + +### db_conf + +**类型**: map[string]string + +**描述**: 用户根据个性化需要配置数据库参数和值,该字段配置的内容将会在数据库启动前写入到 postgresql.conf 文件中 + +**示例**: + +- db config example + +```yaml +db_conf: + key: value +``` + +**新增于**: v0.1 + +### env_map + +**类型**: map[string]string + +**描述**: 用户可根据需要针对该实例增加特定的环境变量 + +**新增于**: v1.2.0 + +### ssh_option + +**类型**: SSHOption + +**描述**: SSH 登录信息,登录用户需为 **root** 或者具有 sudo 权限的用户
不设置时为本地执行 + +**新增于**: v0.1 + +--- + +## SSHOption + +SSHOption SSH 登录认证信息,支持密码和密钥两种方式,二者需至少设置一种 + +Appears in: + +- Global.ssh_option +- CMServer.ssh_option +- DBServer.ssh_option +- SSHOption.proxy + +**示例**: + +```yaml +host: +port: 22 +user: root +key_file: ~/.ssh/id_rsa +``` + +### host + +**类型**: string + +**描述**: 要连接的目标服务器 IP
当该机器为跳板机时必填;
当为数据库所在机器时可以留空,会继承 db_server 的 IP
默认为空 + +**新增于**: v0.1 + +### port + +**类型**: int + +**描述**: SSH 服务端口
默认值:22 + +**新增于**: v0.1 + +### user + +**类型**: string + +**描述**: SSH 登录用户
默认值:root + +**新增于**: v0.1 + +### password + +**类型**: string + +**描述**: SSH 登录用户密码
该字段不支持明文填写,需使用 ptk encrypt 加密后填写 + +**示例**: + +- ssh 密码示例 + +```yaml +password: pTk6MTIxOGMxOTk8QT1CPT4+PXlnYW1DdHpXb2hCX3c3UW0wWXVkNlZwMGRCakpxRXd1WWdwQ0xDUWVrb0U= +``` + +**新增于**: v0.1 + +### key_file + +**类型**: string + +**描述**: SSH 登录密钥文件路径
默认为空 + +**示例**: + +- ssh密钥示例 + +```yaml +key_file: ~/.ssh/id_rsa +``` + +**新增于**: v0.1 + +### passphrase + +**类型**: string + +**描述**: SSH 登录密钥文件口令
该字段不支持明文填写,需使用 ptk encrypt 加密后填写
默认为空 + +**新增于**: v0.1 + +### conn_timeout + +**类型**: Duration + +**描述**: SSH 登录连接超时时间,支持单位 m(分),s(秒)
默认值: "1m" + +**新增于**: v0.1 + +### exec_timeout + +**类型**: Duration + +**描述**: SSH 执行单条命令时的超时时间,支持单位 m(分),s(秒)
默认值: "10m" + +**新增于**: v0.1 + +### proxy + +**类型**: SSHOption + +**描述**: 跳板服务器登录信息,如果目标服务器无法直连时,支持通过中间跳板机方式连接 + +**新增于**: v0.1 diff --git a/product/zh/docs-ptk/v2.0/reference/ref-environment.md b/product/zh/docs-ptk/v2.0/reference/ref-environment.md new file mode 100644 index 0000000000000000000000000000000000000000..f59142ab89bf587212ad8890c773a317da2536d9 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/reference/ref-environment.md @@ -0,0 +1,34 @@ +--- +title: 环境变量 +author: Yao Qian +date: 2024-06-01 +--- + +# 环境变量 + +PTK 在运行是会读取一些特定的环境变量值来影响运行逻辑。 + +可以通过 `ptk env` 命令来查看 PTK 支持的所有环境变量以及对应生效的值。 + +如果想查看具体某个环境变量的值,可以通过 `ptk env ` 来查看,例如: + +* 查看 PTK 元数据目录 + +```bash +ptk env PTK_HOME +``` + +## 支持的环境变量列表 + +PTK 会在运行期间读取下表中的环境变量,您可以通过 `export` 对环境变量进行修改来改变 PTK 的行为 + +| 环境变量名 | 含义 | 说明 | +|:----------|:--------|:-----| +| `PTK_HOME` | PTK 存储元数据的根目录,默认为 `$HOME/.ptk` || +| `PTK_DATA_DIR` | PTK 存储集群元数据的目录,默认为 `$PTK_HOME/data` || +| `PTK_SSH_CONNECT_TIMEOUT` | 执行器在和目标服务器建立 ssh 链接时建链超时时间,默认为 1 分钟| 单位支持 h(时)/m(分)/s(秒),例如 "2m20s" | +| `PTK_CMD_EXECUTE_TIMEOUT` | 执行器在执行 shell 命令时等待返回的超时时间,默认为 10 分钟 | 单位支持 h(时)/m(分)/s(秒),例如 "2m20s" | +| `PTK_LOG_PATH` | 执行日志输出的文件路径,也可以通过命令行参数 `--log-file` 指定,设置了该环境变量的话,在 PTK 执行期间除了在终端输出外,额外会写入到日志文件中。PTK 内部自己在运行期间默认也会记录一个日志文件在 `$PTK_HOME/log` 目录下,这个不受该环境变量控制。| | +| `PTK_NO_CHECK_VERSION` | PTK 默认会在每次命令运行的同时联网检查是否有新版本的 PTK 发布,您可以通过设置该环境变量为 `true`,则可以禁止 PTK 版本检查 | | +| `PTK_NOT_LIMIT_CM_NODES` | PTK 在部署 MogDB 数据库并且同时部署 CM 集群时,会检查CM的节点个数,当CM个数大于3节点时,默认强制限定只能部署奇数个 CM server 节点,以满足多数派选举要求,所以当部署4节点集群时,会要求用户选择一个节点不部署CM server。用户可以设置该参数为 `true`,来关闭该限制。当然,也可以在安装时通过命令行参数 `--not-limit-cm-nodes` 来实现同样的效果 || +| `PTK_ENABLE_TIMEOUT_WHEN_BUILD_DB` | PTK 在对备库进行 `build` 重建操作时,默认不设置执行命令的超时时间(`PTK_CMD_EXECUTE_TIMEOUT` 不生效),这样是为了某些大数据量场景下,单次build的时间成功很高,如果超时退出会导致需要重新构建。如果设置了该参数则可以使 `PTK_CMD_EXECUTE_TIMEOUT` 生效| | diff --git a/product/zh/docs-ptk/v2.0/reference/ref-metadata.md b/product/zh/docs-ptk/v2.0/reference/ref-metadata.md new file mode 100644 index 0000000000000000000000000000000000000000..6f9561e828fc5914baf6108ac059de40fd96899a --- /dev/null +++ b/product/zh/docs-ptk/v2.0/reference/ref-metadata.md @@ -0,0 +1,24 @@ +--- +title: 元数据 +author: Yao Qian +date: 2024-06-01 +--- + +# 元数据 + +PTK 是通过操作系统用户进行隔离的,不同用户下的 PTK 是两个独立的实例。主要的原因是由于 PTK 的运行依赖本地存储的元数据。 + +PTK 的元数据是 PTK 进行多集群管理的根基,在元数据中存储了可执行文件、集群信息,缓存包,日志文件等等重要信息,所以请妥善管理,如果元数据丢失,PTK 将丢失与集群的联系能力。 + +## 元数据目录 + +默认的元数据根目录存储于 `$HOME/.ptk`, 可以通过 `ptk env PTK_HOME` 命令进行查看。 + +| 文件 | 类型 | 说明 | 备注 | +|:-----|:-----|:-----|:-----| +| `bin` | 目录 | 二进制目录,其中存放 `ptk` 可执行文件 || +| `data` | 目录| 集群数据目录,其中保存 PTK 管理的所有集群配置信息,每个集群都会存储到该目录下的以集群名称命名的目录中 | | +| `cache` | 目录| 缓存目录,其中存放 PTK 自动下载的一些安装包,主要目的是针对同名文件避免重复下载,该目录可以根据需要清理,不影响 PTK 运行 | | +| `log` | 目录| 日志目录,其中存放 PTK 执行期间的 debug 日志,但该目录仅报错 PTK 执行失败的日志,执行成功后会自动删除 | | +| `metadata.yml` | 文件| 元数据描述文件 | | +| `history` | 文件| 执行历史文件,文件的行格式为: `时间戳,执行命令,日志路径` | PTK 1.5.0+ 版本支持 | diff --git a/product/zh/docs-ptk/v2.0/reference/ref-recommend-guc.md b/product/zh/docs-ptk/v2.0/reference/ref-recommend-guc.md new file mode 100644 index 0000000000000000000000000000000000000000..70d4ea28e082c6590905a9eb917a539f2dd4d45c --- /dev/null +++ b/product/zh/docs-ptk/v2.0/reference/ref-recommend-guc.md @@ -0,0 +1,141 @@ +--- +title: 数据库推荐参数 +author: Yao Qian +date: 2024-06-01 +--- + +# 数据库推荐参数 + +## 推荐参数说明 + +PTK 在安装 MogDB 数据库时,默认会根据服务器的配置进行数据库参数自动优化修改,具体会对哪些参数修改,不同的版本不尽相同,您可以通过这个命令来进行查看: + +```bash +# MogDB-VERSION 替换为具体的 MogDB 版本号 +ptk rec-guc + +# 您也可以通过同时指定两个版本号来进行对比差异(最多支持同时指定两个版本号) +ptk rec-guc +``` + +如果您不希望 PTK 做参数优化,可以在安装数据库集群时指定 `--default-guc` 参数即可,指定了该参数后,PTK 在安装时除了配置[必要参数](#必要参数)外,其他参数保持数据库默认值。 + +## 注意 + +1. PTK 仅针对 MogDB 和 Uqbar 数据库做数据库参数优化,其他同类型数据库安装时采用默认参数。 +2. 如果在配置文件中 [`db_conf`](./ref-config.md#db_conf) 字段配置了和[优化参数](#优化参数)中同名参数,`db_conf` 中配置的会生效 +3. 当部署数据库的服务器内存小于 **4G** 时,所有的[优化参数](#优化参数)会保持数据库默认值。 + +## 必要参数 + +> 当部署的集群中只有一个数据库实例时,会在必要参数中增加 `most_available_sync=on`,来开启最大可用模式。 + +|参数|值| +|:--|:--| +|[local_bind_address](https://docs.mogdb.io/zh/mogdb/v3.1/1-connection-settings#local_bind_address)|PTK配置文件中 db_servers 的 host 字段| +|[port](https://docs.mogdb.io/zh/mogdb/v3.1/1-connection-settings#port)|PTK配置文件中 db_servers 的 db_port 字段| +|[application_name](https://docs.mogdb.io/zh/mogdb/v3.1/1-connection-settings#application_name)| PTK 为实例分配的节点名, 例如 db_6001| +|[available_zone](https://docs.mogdb.io/zh/mogdb/v3.1/1-sending-server#available_zone)|PTK配置文件中 db_servers 的 az_name| +|[unix_socket_directory](https://docs.mogdb.io/zh/mogdb/v3.1/1-connection-settings#unix_socket_directory)|PTK配置文件中的 tmp_dir| +|[unix_socket_permissions](https://docs.mogdb.io/zh/mogdb/v3.1/1-connection-settings#unix_socket_permissions)|0700| +|[log_file_mode](https://docs.mogdb.io/zh/mogdb/v3.1/1-logging-destination#log_file_mode)|0600| +|[ssl](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#ssl)|off| +|[ssl_cert_file](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#ssl_cert_file)|server.crt| +|[ssl_key_file](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#ssl_key_file)|server.key| +|[ssl_ca_file](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#ssl_ca_file)|cacert.pem| +|[log_directory](https://docs.mogdb.io/zh/mogdb/v3.1/1-logging-destination#log_directory)|PTK配置文件中的 $log_dir 下 pg_log/$application_name| +|[audit_directory](https://docs.mogdb.io/zh/mogdb/v3.1/1-audit-switch#audit_directory)|PTK配置文件中的 $log_dir 下 pg_audit/$application_name| +|[listen_addresses](https://docs.mogdb.io/zh/mogdb/v3.1/1-connection-settings#listen_addresses)|*| +|[max_wal_senders](https://docs.mogdb.io/zh/mogdb/v3.1/1-sending-server#max_wal_senders)|16| + +## 优化参数 + +### 第一部分:与内存大小相关的参数(假设内存大小为 N,单位GB) + +- 当4 < N <= 8 时 + +|参数|值| +|:--|:--| +|[max_connections](https://docs.mogdb.io/zh/mogdb/v3.1/1-connection-settings#max_connections)|500| +|[max_prepared_transactions](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#max_prepared_transactions)|500| +|[max_process_memory](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#max_process_memory)|(0.6*N)GB| +|[shared_buffers](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#shared_buffers)|(0.2*N)GB| +|[work_mem](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#work_mem)|16MB| +|[maintenance_work_mem](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#maintenance_work_mem)|512MB| +|[wal_buffers](https://docs.mogdb.io/zh/mogdb/v3.1/1-settings#wal_buffers)|128MB| + +- 当 8 < N <= 64 时 + +|参数|值| +|:--|:--| +|[max_connections](https://docs.mogdb.io/zh/mogdb/v3.1/1-connection-settings#max_connections)|1000| +|[max_prepared_transactions](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#max_prepared_transactions)|1000| +|[max_process_memory](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#max_process_memory)|(0.7*N)GB| +|[shared_buffers](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#shared_buffers)|(0.2*N)GB| +|[work_mem](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#work_mem)|32MB| +|[maintenance_work_mem](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#maintenance_work_mem)|1GB| +|[wal_buffers](https://docs.mogdb.io/zh/mogdb/v3.1/1-settings#wal_buffers)|512MB| + +- 当 N > 64 时 + +|参数|值| +|:--|:--| +|[max_connections](https://docs.mogdb.io/zh/mogdb/v3.1/1-connection-settings#max_connections)|3000| +|[max_prepared_transactions](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#max_prepared_transactions)|3000| +|[max_process_memory](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#max_process_memory)|(0.8*N)GB| +|[shared_buffers](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#shared_buffers)|(0.3*N)GB| +|[work_mem](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#work_mem)|64MB| +|[maintenance_work_mem](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#maintenance_work_mem)|2GB| +|[wal_buffers](https://docs.mogdb.io/zh/mogdb/v3.1/1-settings#wal_buffers)|1GB| + +### 第二部分:固定优化参数列表 + +|参数|值| +|:--|:--| +|[remote_read_mode](https://docs.mogdb.io/zh/mogdb/v3.1/18-fault-tolerance#remote_read_mode)|non_authentication| +|[password_encryption_type](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#password_encryption_type)|1| +|[password_reuse_time](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#password_reuse_time)|0| +|[password_lock_time](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#password_lock_time)|0| +|[password_effect_time](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#password_effect_time)|0| +|[session_timeout](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#session_timeout)|0| +|[modify_initial_password](https://docs.mogdb.io/zh/mogdb/v3.1/2-security-and-authentication#modify_initial_password)|off| +|[wal_level](https://docs.mogdb.io/zh/mogdb/v3.1/1-settings#wal_level)|logical| +|[full_page_writes](https://docs.mogdb.io/zh/mogdb/v3.1/1-settings#full_page_writes)|off| +|[wal_log_hints](https://docs.mogdb.io/zh/mogdb/v3.1/1-settings#wal_log_hints)|off| +|[xloginsert_locks](https://docs.mogdb.io/zh/mogdb/v3.1/16-lock-management#xloginsert_locks)|48| +|[advance_xlog_file_num](https://docs.mogdb.io/zh/mogdb/v3.1/21-developer-options#advance_xlog_file_num)|10| +|[wal_keep_segments](https://docs.mogdb.io/zh/mogdb/v3.1/1-sending-server#wal_keep_segments)|1024| +|[most_available_sync](https://docs.mogdb.io/zh/mogdb/v3.1/2-primary-server#most_available_sync)|on| +|[catchup2normal_wait_time](https://docs.mogdb.io/zh/mogdb/v3.1/2-primary-server#catchup2normal_wait_time)|0| +|[enable_slot_log](https://docs.mogdb.io/zh/mogdb/v3.1/1-sending-server#enable_slot_log)|on| +|[max_replication_slots](https://docs.mogdb.io/zh/mogdb/v3.1/1-sending-server#max_replication_slots)|32| +|[wal_receiver_timeout](https://docs.mogdb.io/zh/mogdb/v3.1/3-standby-server#wal_receiver_timeout)|10s| +|[sync_config_strategy](https://docs.mogdb.io/zh/mogdb/v3.1/2-primary-server#sync_config_strategy)|none_node| +|[log_line_prefix](https://docs.mogdb.io/zh/mogdb/v3.1/3-logging-content#log_line_prefix)|'%m %u %d %r %p %S'| +|[log_checkpoints](https://docs.mogdb.io/zh/mogdb/v3.1/3-logging-content#log_checkpoints)|on| +|[vacuum_cost_limit](https://docs.mogdb.io/zh/mogdb/v3.1/4-cost-based-vacuum-delay#vacuum_cost_limit)|1000| +|[autovacuum_max_workers](https://docs.mogdb.io/zh/mogdb/v3.1/14-automatic-vacuuming#autovacuum_max_workers)|10| +|[autovacuum_naptime](https://docs.mogdb.io/zh/mogdb/v3.1/14-automatic-vacuuming#autovacuum_naptime)|20s| +|[autovacuum_vacuum_cost_delay](https://docs.mogdb.io/zh/mogdb/v3.1/14-automatic-vacuuming#autovacuum_vacuum_cost_delay)|10| +|[autovacuum_vacuum_scale_factor](https://docs.mogdb.io/zh/mogdb/v3.1/14-automatic-vacuuming#autovacuum_vacuum_scale_factor)|0.05| +|[autovacuum_analyze_scale_factor](https://docs.mogdb.io/zh/mogdb/v3.1/14-automatic-vacuuming#autovacuum_analyze_scale_factor)|0.02| +|[autovacuum_vacuum_threshold](https://docs.mogdb.io/zh/mogdb/v3.1/14-automatic-vacuuming#autovacuum_vacuum_threshold)|200| +|[autovacuum_analyze_threshold](https://docs.mogdb.io/zh/mogdb/v3.1/14-automatic-vacuuming#autovacuum_analyze_threshold)|200| +|[autovacuum_io_limits](https://docs.mogdb.io/zh/mogdb/v3.1/14-automatic-vacuuming#autovacuum_io_limits)|104857600| +|[instr_unique_sql_count](https://docs.mogdb.io/zh/mogdb/v3.1/26-query#instr_unique_sql_count)|200000| +|[enable_wdr_snapshot](https://docs.mogdb.io/zh/mogdb/v3.1/27-system-performance-snapshot#enable_wdr_snapshot)|on| +|[log_min_duration_statement](https://docs.mogdb.io/zh/mogdb/v3.1/2-logging-time#log_min_duration_statement)|200| +|[track_activity_query_size](https://docs.mogdb.io/zh/mogdb/v3.1/1-query-and-index-statistics-collector#track_activity_query_size)|2048| +|[enable_instr_rt_percentile](https://docs.mogdb.io/zh/mogdb/v3.1/26-query#enable_instr_rt_percentile)|off| +|[cstore_buffers](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#cstore_buffers)|16MB| +|[local_syscache_threshold](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#local_syscache_threshold)|32MB| +|[standby_shared_buffers_fraction](https://docs.mogdb.io/zh/mogdb/v3.1/1-memory#standby_shared_buffers_fraction)|1| +|[checkpoint_segments](https://docs.mogdb.io/zh/mogdb/v3.1/2-checkpoints#checkpoint_segments)|1024| +|[checkpoint_completion_target](https://docs.mogdb.io/zh/mogdb/v3.1/2-checkpoints#checkpoint_completion_target)|0.8| +|[max_files_per_process](https://docs.mogdb.io/zh/mogdb/v3.1/3-kernel-resource-usage#max_files_per_process)|100000| +|[behavior_compat_options](https://docs.mogdb.io/zh/mogdb/v3.1/2-platform-and-client-compatibility#behavior_compat_options)|display_leading_zero| +|[lc_messages](https://docs.mogdb.io/zh/mogdb/v3.1/2-zone-and-formatting#lc_messages)|en_US.UTF-8| +|[lc_monetary](https://docs.mogdb.io/zh/mogdb/v3.1/2-zone-and-formatting#lc_monetary)|en_US.UTF-8| +|[lc_numeric](https://docs.mogdb.io/zh/mogdb/v3.1/2-zone-and-formatting#lc_numeric)|en_US.UTF-8| +|[lc_time](https://docs.mogdb.io/zh/mogdb/v3.1/2-zone-and-formatting#lc_time)|en_US.UTF-8| +|[enable_opfusion](https://docs.mogdb.io/zh/mogdb/v3.1/4-other-optimizer-options#enable_opfusion)|off| diff --git a/product/zh/docs-ptk/v2.0/reference/ref-support-mogdb.md b/product/zh/docs-ptk/v2.0/reference/ref-support-mogdb.md new file mode 100644 index 0000000000000000000000000000000000000000..2146258cacf756c0187f2b2466bdd4548b7aaad7 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/reference/ref-support-mogdb.md @@ -0,0 +1,35 @@ +--- +title: 对 MogDB 版本的支持 +author: Yao Qian +date: 2024-06-01 +--- + +# 对 MogDB 版本的支持 + +> 注:下表中给出了 PTK 集成 MogDB 对应版本的下载链接以及对应推荐配置的版本,使用新版本的 PTK 能够支持用户仅指定 MogDB 版本就可以自动下载安装包部署,但旧版本的 PTK 仍然可以通过 `-p` 参数指定安装包进行部署。 + +| MogDB版本 | PTK最低版本 | +|-----------|---------| +| 5.0.7 | 1.4.7+ | +| 5.0.6 | 1.3.3+ | +| 5.0.5 | 1.2.0+ | +| 5.0.4 | 1.1.3+ | +| 5.0.3 | 1.0.10+ | +| 5.0.2 | 1.0.9+ | +| 5.0.1 | 1.0.4+ | +| 5.0.0 | 1.0.0+ | +| 3.1.1 | 1.3.0+ | +| 3.1.0 | 0.5.0+ | +| 3.0.7 | 1.2.0+ | +| 3.0.6 | 1.1.0+ | +| 3.0.5 | 1.0.2+ | +| 3.0.4 | 0.7.0+ | +| 3.0.3 | 0.5.0+ | +| 3.0.2 | 0.5.0+ | +| 3.0.1 | 0.5.0+ | +| 3.0.0 | 0.5.0+ | +| 2.1.1 | 0.4.0+ | +| 2.0.4 | 0.5.0+ | +| 2.0.3 | 0.4.0+ | +| 2.0.1 | 0.4.0+ | +| 2.0.0 | 0.4.0+ | diff --git a/product/zh/docs-ptk/v2.0/release-notes/release-0xx.md b/product/zh/docs-ptk/v2.0/release-notes/release-0xx.md new file mode 100644 index 0000000000000000000000000000000000000000..6a2098bf8cbf2f6afc7d4fb0eaf2e00d72e58bfa --- /dev/null +++ b/product/zh/docs-ptk/v2.0/release-notes/release-0xx.md @@ -0,0 +1,150 @@ +--- +title: v0发布记录 +summary: v0发布记录 +author: Yao Qian +date: 2024-01-02 +--- + +## 0.x 发布记录 + +### 0.8.0 (2023.05.26) + +#### 新功能 + +- 支持PTK的元数据导出和合并功能,便于两个PTK实例合并 +- 新增 cluster inspect 功能,支持查看集群元数据 +- 新增数据库实例级别集群工具 ptkc + +#### 功能优化及Bug修复 + +- 集群重建(build)和扩容(scale-out)支持从备库进行重建 +- 支持 ssh 连接失败时交互更新密码或密钥 + +### 0.7.0 (2023.04.14) + +#### 新功能 + +- 支持 MogDB 数据库版本升级功能 +- 新增 promote/demote 命令,支持角色变更功能 +- 新增 manage 命令,支持纳管已有集群 +- 支持普通ssh用户安装和运维数据库 +- 集群启动和重启支持指定角色 +- 更新软件默认安装版本: MogDB 3.0.4,MogHA 2.4.8 + +#### 功能优化及Bug修复 + +- demo 和 template -l 命令根据执行用户动态决定数据库运行用户 +- switchover 支持快速切换参数 +- 更新终端交互形式 +- 优化对于 UOS 系统发行版的判断 +- 优化 start 指令,增加主库角色校验 +- 优化全局中断信号处理流程 +- 优化系统检查项,增加 (A19) 用户 ulimit 设置检查 + +### 0.6.0 (2023.01.13) + +#### 新功能 + +- 支持 MogDB 3.1 数据库及插件的安装 +- 新增 demo 命令,快速本地部署MogDB示例数据库,并配备大部分插件 +- cluster 新增 build 子命令,支持重建指定数据库 +- 新增 meta 命令 +- checkos 新增 selinux 检查 (A18) + +#### 功能优化及Bug修复 + +- 优化系统参数检查,支持生成永久关闭THP建议脚本 +- 完善 MogHA 的安装,增加配置文件检验,支持区分模式安装等 +- 优化扩缩容在不同场景下的处理 +- 增加对于集群写操作的互斥锁 +- 优化集群状态查询,支持部分实例机器连接不上的场景 +- 优化带CM的集群相关操作 +- 修复部分已知的Bug + +### 0.5.0 (2022.11.11) + +#### 新功能 + +- 支持 MogDB-3.0.3,Uqbar-1.1.0 的安装 +- 支持单机多实例部署 +- 支持启用 CM 组件的集群在线扩缩容 +- 新增 exec 指令 +- 元数据新增日志记录功能 +- 内置 pssh 模块,解耦 om 依赖 + +#### 功能优化及Bug修复 + +- 优化扩缩容流程 +- 优化安装流程 +- 优化中断信号处理 +- 修复部分已知的bug + +### 0.4.0 (2022.09.16) + +#### 新功能 + +- cluster指令新增 failover/switchover 切换功能 +- cluster指令新增 show-hba/show-guc/show-config 指令,用户可方便地查看集群配置信息 +- cluster指令新增 MogHA 的安装功能 +- cluster指令新增 shell 指令,提供快速运行shell命令或脚本到集群服务器的能力 +- cluster指令新增 refesh 指令,便于用户更新集群配置,目前开放替换IP功能 +- 新增 register 指令,允许用户自己注册系统类型 +- candidate指令新增 cpu 指令,查看PTK支持的CPU架构列表 +- 集群扩容新增 copy 模式 +- 集群操作(启、停、查询)支持操作全部集群 +- 支持 MogDB 3.0.1 以上CM两节点安装 +- 支持飞腾CPU检测 +- 兼容 openGauss 安装 + +#### 功能优化及Bug修复 + +- 优化执行过程中断信号的检测和处理 +- 优化遇到信号量不足错误时的输出,给出修复建议 +- 修复az优先级配置错误导致CM启动失败的问题 +- 其他已知bug的修复 + +### 0.3.0(2022.07.31) + +#### 新功能 + +- 支持扩缩容 +- 支持插件安装 +- 自动根据环境尝试修复动态库依赖 +- 集群列表结果新增版本信息 +- 新增安装包 md5 校验 +- 支持 download 指令 +- 新增集群备注功能 + +#### 功能优化及Bug修复 + +- 修复存在IB网卡时,网络检查的错误 +- 修复 suse 修复脚本指令错误 +- 其他已知问题修复及优化 + +### 0.2.0 (2022.06.30) + +#### 新功能 + +- 新增 candidate 指令 +- 新增 cm 安装支持 +- 系统检查自动生成修复脚本 +- 增加默认设置推荐数据库参数 + +#### Bug修复 + +- 优化安装流程 +- 修复checkos中多个检查项的问题 +- 兼容多种压缩包格式自动探测 +- 其他已知Bug修复 + +### 0.1.0 (2023.05.30) + +#### 新功能 + +- 实现系统检查 +- 实现数据库集群的安装和卸载 +- 实现集群管理功能:启动、停止、查询以及重启 +- 实现密码加密功能 +- 实现模板生成功能 +- 适配不同操作系统安装 +- 实现 ptk 自升级功能 diff --git a/product/zh/docs-ptk/v2.0/release-notes/release-10x.md b/product/zh/docs-ptk/v2.0/release-notes/release-10x.md new file mode 100644 index 0000000000000000000000000000000000000000..b616c2017d3ad43c4443fc46cd817f90bfdfe74f --- /dev/null +++ b/product/zh/docs-ptk/v2.0/release-notes/release-10x.md @@ -0,0 +1,72 @@ +--- +title: v10发布记录 +summary: v10发布记录 +author: Yao Qian +date: 2024-01-02 +--- + +## 1.0 发布记录 + +### 1.0.12 (2024.04.14) + +- [修复] 修复安装CM时覆盖lib库问题 + +### 1.0.11 (2023.11.10) + +- [修复] DBUser 执行器具有 sudo 权限时,checkos 报 ExecuteError 的问题 + +### 1.0.10 (2023.10.27) + +- [新增] 增加 MogDB 5.0.3 版本的支持 +- [工程] 安装时 MogDB 默认版本升级为 5.0.3, MogHA 默认版本升级为 2.4.13 + +### 1.0.9 (2023.09.28) + +- [新增] 增加 MogDB 5.0.2 版本的支持 +- [工程] 升级安装时 MogDB 默认版本到 5.0.2 + +### 1.0.8 (2023.09.15) + +- [修复] 屏蔽升级回滚时插件升级相关逻辑,修复 nil panic 错误 +- [修复] 更新 mogila 到最新版本 +- [修复] 修复 ptkc 在带CM的集群下 ssh 报错的问题 +- [优化] 处理 psutil.so 时优先使用 python3 命令检测版本,如果版本不对时,使用 python3.6/3.7 检测 +- [优化] ptk download 增加 --dryrun 参数,日志中增加下载链接信息 +- [优化] 优化系统检查生成的修复脚本,当修复命令执行错误时,提示错误语句,然后继续执行后续修复语句 +- [优化] 取消 gs_ctl build 操作的执行超时设置,一直等待到完成 +- [新增] 增加 MogDB 3.0.6 版本支持 + +### 1.0.7 (2023.09.01) + +- [修复] 带CM安装时,DB节点数大于CM节点数是,仅DB节点om_monitor 找不到 cm_agent 配置 (#2006) +- [修复] 修复 “upload success” 翻译错误 + +### 1.0.6 (2023.08.30) + +- [修复] 设置 cm 的配置 enable_ssl 是否启用逻辑错误 +- [优化] 保持 PTK 启动 om_monitor 的命令和 crontab 中的命令一致 + +### 1.0.5 (2023.08.27) + +- [修复] 检查端口时,过滤掉伪实例 + +### 1.0.0 (2023.07.14) + +#### 新功能 + +- 新增 kerberos 服务的安装和卸载 +- 新增 cache 命令,支持查看 PTK 缓存文件列表 +- 集群的子命令新增 --id 参数,允许通过 ID 来操作实例 +- 新增 candidate plugin 命令 +- 新增兼容系统 Anolis OS + +#### 功能优化及Bug修复 + +- 安装 CM 集群时默认自动生成 ssl 证书 +- 插件安装指定安装包时自动解析包内插件的名称 +- 针对 3.0.x 版本升级增加段页式压缩包的存在性检查 +- 更新支持的数据库版本列表,更新默认版本为 MogDB 5.0.0 +- 更新交互框架,支持通过管道符提交回答 +- 日志信息国际化 +- 统一集群内 pgxc_node_name 的值 +- 修复了部分已知的 BUG diff --git a/product/zh/docs-ptk/v2.0/release-notes/release-11x.md b/product/zh/docs-ptk/v2.0/release-notes/release-11x.md new file mode 100644 index 0000000000000000000000000000000000000000..4d3df185c2a13f2dcd87197442440b476a8a266c --- /dev/null +++ b/product/zh/docs-ptk/v2.0/release-notes/release-11x.md @@ -0,0 +1,59 @@ +--- +title: v11发布记录 +summary: v11发布记录 +author: Yao Qian +date: 2024-01-02 +--- + +## 1.1 发布记录 + +### 1.1.5 (2023.12.11) + +- [修复] (1.1.4 引入)普通用户自己给自己安装数据库时阻塞的问题 + +### 1.1.4 (2023.12.8) + +- [修复] 修复数据库密码包含 $ 等特殊字符被解析的问题 +- [修复] 修复数据库包文件名包含特殊字符在本地安装失败的问题 +- [优化] 资源池化部署场景下,取消对 CM 的网关参数限制 +- [优化] 安装非恩墨的数据库产品时,不进行参数优化 +- [更新] 更新内置软件许可协议 + +### 1.1.3 (2023.11.30) + +- [新增] 集群升级前,增加发行版时间检测 +- [新增] 增加 MogDB 5.0.4 版本的支持 + +### 1.1.2 (2023.11.24) + +- [修复] 安装过程文件权限问题 +- [修复] cluster refresh 替换 IP 后登录失败的问题 +- [优化] 通用命令的执行增加补偿机制 +- [优化] 插件升级未指定本地插件目录时自动从网络下载 + +### 1.1.1 (2023.11.20) + +- [修复] 元数据合并被其他 PTK 管控的数据库集群后导致原 PTK ssh 认证失效的问题 +- [修复] 非 root 的 sudo 用户场景下 ssh 命令转义问题 +- [修复] 普通用户安装数据库时报没有 sudo 权限的错误 +- [修复] 集群内存在单 CM 节点时 ptkc 报错的问题 +- [修复] 纳管集群后没有创建报错认证信息的问题 + +### 1.1.0 (2023.11.17) + +- [新增] 支持资源池化部署和卸载 +- [新增] 支持对安装了插件的集群升级(MogDB 5.0.2 及以上版本支持) +- [新增] 安装时增加 hostname 校验 +- [新增] 新增安装参数 --skip-check-package,支持跳过对于安装包 md5 和 sha256 的检查 +- [新增] 支持部署 CM 集群的 vip (MogDB 5.0.4 及以上版本支持) +- [新增] ptkc 支持 CM 集群的 swichover +- [新增] CM 集群当节点大于3节点时,限制 cms 节点个数为奇数 +- [优化] 支持集群内部分节点 ssh 不可达时,其余节点可操作 +- [优化] 去除对于 sshd AcceptEnv 配置的依赖 +- [优化] 优化 python3 版本校验逻辑 +- [优化] 优化飞腾CPU的检测规则 +- [优化] 扩容时 az 信息未指定时,默认取当前集群存在的信息 +- [安全] 收缩安装后数据库相关文件的权限 +- [修复] 修复 gs_checkperf 执行时找不到文件的错误 +- [修复] 修复纳管 CM 集群相关的问题 +- [修复] 修复系统检查时偶现的 nil panic 问题 diff --git a/product/zh/docs-ptk/v2.0/release-notes/release-12x.md b/product/zh/docs-ptk/v2.0/release-notes/release-12x.md new file mode 100644 index 0000000000000000000000000000000000000000..4001678f599ec32016ec7474148a1eacb1e975ab --- /dev/null +++ b/product/zh/docs-ptk/v2.0/release-notes/release-12x.md @@ -0,0 +1,28 @@ +--- +title: v12发布记录 +summary: v12发布记录 +author: Yao Qian +date: 2024-01-02 +--- + +## 1.2 发布记录 + +### 1.2.0 (2023.12.30) + +**新增和优化** + +- 新增 collect 命令,用于反馈问题时收集基础的现场环境信息 +- 新增 rec-guc 命令,支持本地查看对于不同 MogDB 版本,PTK 优化的参数列表 +- 新增 cluster set-guc 命令,支持配置 postgresql.conf +- 新增 cluster set-hba 命令,支持配置 pg_hba.conf +- 新增 cluster load-cm-vip 命令,支持在线更新 VIP (MogDB cm 场景) +- status 命令支持展示 vip 功能 +- 支持双网段配置 +- 支持 MogDB 资源池化安装流程 +- 优化集群升级时插件处理流程 +- 升级默认 MogDB 版本到 5.0.5, MogHA 版本到 2.4.16 + +**修复** + +- 修复各种 ssh 和 db 用户组合场景下的权限使用问题 +- 修复其他已知的问题 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/release-notes/release-13x.md b/product/zh/docs-ptk/v2.0/release-notes/release-13x.md new file mode 100644 index 0000000000000000000000000000000000000000..9afad26f793df26d8e74ae6e534d21c17cc0b9b1 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/release-notes/release-13x.md @@ -0,0 +1,71 @@ +--- +title: v13发布记录 +summary: v13发布记录 +author: Yao Qian +date: 2024-02-18 +--- + +## 1.3 发布记录 + +### 1.3.5 (2024.4.7) + +**修复** + +- 去除调试日志中包含数据库密码等敏感信息的日志 + +### 1.3.4 (2024.4.3) + +**新增** + +- encrypt 命令支持 --stdin 参数,支持通过管道传参 + +### 1.3.3 (2024.3.28) + +**新增和优化** + +- 新增 MogDB 5.0.6 支持 +- 扩缩容后增加 CM reload 步骤重试机制 +- 优化升级参数 `--parallel`, 设置默认值10 + +### 1.3.2 (2024.3.13) + +**优化** + +- 调试日志脱敏处理 +- 新增全局参数 `--disable-debug-log`,支持不生成调试日志 + +**修复** + +- 修复升级到 MogDB 3.0.2 之前的版本时强制要求指定插件补丁参数的问题 + +### 1.3.1 (2024.2.21) + +**优化** + +- 升级时集群状态检查超时时间采用 `PTK_CMD_EXECUTE_TIMEOUT` 环境变量 +- 端口占用错误中增加端口的说明 + +**修复** + +- 修复refresh命令在互换IP场景的bug + +### 1.3.0 (2024.2.6) + +**新增和优化** + +- 新增命令 `gen-cert-files`,支持生成 ssl 认证文件 +- 集群状态输出表格中新增 uptime 字段,显示实例启动的时间 +- 集群状态支持纵向格式显示 +- 集群升级命令新增 `--mode` 参数,支持 `replace` (默认) 和 `cover` +- 集群升级时,同步更新 OM 组件 +- 优化集群升级时对于插件的升级流程 +- 完善系统检查命中的时间一致性校验 +- ls 和 status 命令支持双 IP 场景的显示 +- 优化 refresh 命令,取消部分限制并支持 CM 集群 +- 在所有子命令的帮助说明中增加了支持的版本和使用示例 +- 变更 MogHA 默认安装版本为 2.4.18 + +**修复** + +- 修复双IP场景下 build 导致 panic 的问题 +- 修复其他已知的问题 \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/release-notes/release-14x.md b/product/zh/docs-ptk/v2.0/release-notes/release-14x.md new file mode 100644 index 0000000000000000000000000000000000000000..8159144fd179bf1d16a111dab00f9e0b94b69c1a --- /dev/null +++ b/product/zh/docs-ptk/v2.0/release-notes/release-14x.md @@ -0,0 +1,135 @@ +--- +title: v14发布记录 +summary: v14发布记录 +author: Yao Qian +date: 2024-04-09 +--- + +# 1.4 发布记录 + +## 1.4.7 (2024-05-30) + +**Features** + +- 新增 MogDB 5.0.7 版本支持 + +## 1.4.6 (2024-05-28) + +**Bug Fixes** + +- **ca:** 修改ssl证书默认的密钥长度为3072bits,有效期为20年 + +## 1.4.5 (2024-05-14) + +**Bug Fixes** + +- **install:** 安装CM回退为解压覆盖方式 +- **scale-out:** 修复使用数据库用户扩容时创建authdb问题 + +## 1.4.4 (2024-05-10) + +**Bug Fixes** + +- **cmvip:** 挂载cm-vip时判断条件错误 +- **demo:** 修复卸载demo集群时未删除用户问题 +- **upgrade:** 修复升级后py_pstree.py被覆盖问题 + +## 1.4.3 (2024-04-30) + +**Bug Fixes** + +- **demo:** 修复demo命令安装时未指定blocksize报错 +- **install:** 修复安装失败未回滚实例数据问题 +- **load-cm-vip:** 修复重复挂载vip的问题 +- **status:** 查询cm vip状态时若cm_resource.json文件不存在,则跳过 +- **upgrade:** 修复运行回滚SQL时数据内核版本错误 +- **upgrade:** 增加3.0.*升级至5.1.*/5.2.*的插件适配规则 + +**Features** + +- **install:** 支持从Server安装包直接安装 + +## 1.4.2 (2024-04-24) + +**Bug Fixes** + +- **scaleout:** 修复双IP场景扩容后postgresql.conf中的replconninfo不正确导致启动失败问题 +- **install:** 修复解析非标准格式数据库版本导致安装死锁 + +**BREAKING CHANGE** + +- **status:** ls 和 cluster status 在显示版本信息时,由原来空格连接转为短横线连接,保持和数据库 version.cfg 文件中一致。 + +示例: + +``` +# 旧版本样式 +... | db_version | ... +... +------------------------------+ ... +... | MogDB 5.0.6 (build 8b0a6ca8) | ... + +# 变更后样式 +... | db_version | ... +... +------------------------------+ ... +... | MogDB-5.0.6 (build 8b0a6ca8) | ... +``` + +由于修复了非标准版本格式的安装问题,所以在展示非标准格式的版本信息时同样会保持和 version.cfg 中风格一致,才有短横线连接 + +示例: + +``` + +# 非标准格式版本样式,openGauss 金融版本举例 +... | db_version | ... +... +------------------------------------------+ ... +... | openGauss-Finance-5.0.1 (build 8b0a6ca8) | ... +``` + +## 1.4.1 (2024-04-11) + +**Bug Fixes** + +- **antidep:** 修复升级判断相关函数未初始化导致panic的问题 +- **install:** 支持跳过安装包二进制检查 +- **rolling:** 滚动升级并发导致上传包不正确问题 +- **tui:** 升级promptui版本修复某些场景panic的问题 +- **upgrade:** 升级时解析包的判断条件问题 +- **upgrade:** 升级时打开support_extended_features + +**Style Change** + +- **errx:** 50102 错误增加文件名提示 + +## 1.4.0 (2024.4.9) + +**新增特性:** + +- 新增在已有集群上额外单独安装 CM 组件或单独卸载 CM 组件 +- 支持MogDB向同内核版本(version.cfg文件中第二行数字)的高版本滚动升级 +- 支持 protect_standby 角色检测 +- 升级流程增加补丁信息表检查 +- 新增资源池化场景对磁盘的检查 +- candidate db 输出中新增内核版本和版本发布日期 +- cluster upgrade-rollback 增加 --parallel 参数 +- encrypt 命令支持 --stdin 参数和 --disable-prompt 参数,支持通过管道传递要加密的文本 + +**功能优化:** + +- 调整 load-cm-vip 命令的适用范围,不支持 MogDB 5.0.4 之前的版本 +- 更新 MogHA 默认版本到 2.4.20 +- 安全:对日志中包含明文密码相关的日志进行脱敏处理 +- 安装前增加对于安装包里二进制的检查,提前识别架构是否匹配 +- 调整下载文件的超时时间,由 PTK_CMD_EXECUTE_TIMEOUT 环境变量决定 +- ls 和 cluster status 命令支持升级中的状态显示 +- postgresql.conf 中 replconninfo 参数去除废弃字段 localservice 和 remoteservice +- 安装、扩容时增加对双网段的检查 +- 交互输入IP类型数据时支持逗号分隔输入多个IP + +**问题修复:** + +- 修复某些场景下存在ssh登录失效的问题 +- 修复缩容时删除 hba 条目过度匹配的问题 +- 修复停止集群失败时输出停止成功的问题 +- 修复当安装包中没有OM包时的报错问题 +- 修复其他已知的BUG \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/release-notes/release-15x.md b/product/zh/docs-ptk/v2.0/release-notes/release-15x.md new file mode 100644 index 0000000000000000000000000000000000000000..6fc7609ae67c36fe61d6d21a2d144afdbded70bb --- /dev/null +++ b/product/zh/docs-ptk/v2.0/release-notes/release-15x.md @@ -0,0 +1,58 @@ +--- +title: v1.5发布记录 +summary: v1.5发布记录 +author: Yao Qian +date: 2024-06-04 +--- + +# 1.5 发布记录 + +## 1.5.2 (2024-06-18) + +**Bug Fixes** + +- **upgrade:** 修复 wal2json 插件不升级的问题 +- **metadata:** 修复保护备(protect_standby)角色会持久化到元数据的问题 +- **instance:** 修复探测保护备的正则表达式 + +## 1.5.1 (2024-06-13) + +**Features** + +- **demo:** 新增 `--base-dir` 参数,支持用户指定安装目录 +- **demo:** 优化日志最后的 Summary 格式 + +**Bug Fixes** + +- **checkos** 修复配置文件中未配置角色时报错 +- **demo** 在 PG 库中安装 mogila,更新内置 compat-tools 到最新版 + +## 1.5.0 (2024-06-06) + +**Features** + +- **takeover:** 支持对现有集群接管一个已经运行中的实际同属一个集群的节点(仅新增PTK的元数据) +- **throwout:** 支持对现有集群放弃管理一个节点(仅删除PTK的元数据) +- **rename:** 支持对现有集群重命名集群名 +- **init-cluster:** 支持创建空集群 +- **manage:** 支持纳管没有 cluster_static_config 文件的集群 +- **install:** 支持直接从内核安装包安装数据库 +- **upgrade:** 支持部署了CM的数据库集群版本升级(CM版本不升级) +- **upgrade:** 默认升级模式由 replace 改为 cover 覆盖方式 +- **config:** 配置文件 global 域新增 extra_hba_conf 字段,支持配置额外的 hba 条目 +- **status:** 支持显示 CM 组件的版本号 +- **install:** 如果安装 CM 组件,强制检查已存在用户可打开文件数目 +- **metadata:** 新增 history 文件记录执行历史命令 + +**Bug Fixes** + +- **status:** 查询vip状态时,若cm_resource.json不存在,则不显示 +- **upgrade:** 修复带插件升级时,在非 postgres 库安装插件未识别的问题 +- **checkos:** 修复资源池化场景磁盘检查命令 +- **checkos:** 修复已存在用户 ulimit 参数未检查的问题 +- **checkos:** 修复内存检查的修复命令导致脚本执行报错的问题 +- **checkos:** 修复存在重复 IP 字符串的多网卡场景获取网卡错误问题 +- **demote:** 修复降级备节点时未正确修改 upstream 的问题 +- **prune:** 修复无法 Ctrl C 中断的问题 +- **status,switchover:** 修复级联备未刷新元数据的 upstream 问题 +- 修复和优化其他若干内部问题 diff --git a/product/zh/docs-ptk/v2.0/release-notes/release.md b/product/zh/docs-ptk/v2.0/release-notes/release.md new file mode 100644 index 0000000000000000000000000000000000000000..72d48a247f120285a94c783b99dd486a8c42fe4a --- /dev/null +++ b/product/zh/docs-ptk/v2.0/release-notes/release.md @@ -0,0 +1,20 @@ +--- +title: 发布记录 +summary: 发布记录 +author: Yao Qian +date: 2023-11-14 +--- + +## PTK 下载地址 + +[🔗 https://www.mogdb.io/downloads/ptk/all](https://www.mogdb.io/downloads/ptk/all) + +## PTK 发布记录 + +- [v1.5 版本发布记录](./release-15x.md) +- [v1.4 版本发布记录](./release-14x.md) +- [v1.3 版本发布记录](./release-13x.md) +- [v1.2 版本发布记录](./release-12x.md) +- [v1.1 版本发布记录](./release-11x.md) +- [v1.0 版本发布记录](./release-10x.md) +- [v0.x 版本发布记录](./release-0xx.md) diff --git a/product/zh/docs-ptk/v2.0/samples/samples-db-cluster.md b/product/zh/docs-ptk/v2.0/samples/samples-db-cluster.md new file mode 100644 index 0000000000000000000000000000000000000000..e681d5e199b3a170a15babc83e5237c1151a5165 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/samples/samples-db-cluster.md @@ -0,0 +1,83 @@ +--- +title: 主备集群 +author: Yao Qian +date: 2024-06-14 +--- + +# 主备集群 + +## 一主一备 + +```yaml +global: + # 集群名 + cluster_name: c1 + # 操作系统用户名 + user: omm + # 系统用户密码 + user_password: "" # ptk encrypt password + # 数据库密码 + db_password: "" # ptk encrypt password + # 数据库端口 + db_port: 26000 + # 数据库安装基础目录 + base_dir: /data/mogdb + +db_servers: + - host: + # 数据库角色,支持: primary, standby, cascade_standby + role: primary + # SSH connection configuration + ssh_option: + port: 22 + user: root + password: "" # ptk encrypt password + key_file: "" + passphrase: "" + - host: + role: standby + ssh_option: + port: 22 + user: root + password: "" # ptk encrypt password + key_file: "" + passphrase: "" +``` + +## 一主两备一级联 + +```yaml +global: + # 集群名 + cluster_name: shockley + # 操作系统用户名 + user: vimiix + # 系统用户密码 + user_password: "" # ptk encrypt password + # 数据库密码 + db_password: "" # ptk encrypt password + # 数据库端口 + db_port: 26000 + # 数据库安装基础目录 + base_dir: /data/mogdb + # SSH 登录信息,这里我们演示所有数据库服务器的登录信息均相同 + # 所以仅需在 global 里配置一份即可 + ssh_option: + port: 22 + user: root + password: "" # ptk encrypt password + key_file: "" + passphrase: "" + +db_servers: + - host: + role: primary + - host: + role: standby + - host: + role: standby + - host: + role: cascade_standby + # 当前级联备的上游备库IP + upstream_host: +``` diff --git a/product/zh/docs-ptk/v2.0/samples/samples-double-ip.md b/product/zh/docs-ptk/v2.0/samples/samples-double-ip.md new file mode 100644 index 0000000000000000000000000000000000000000..b8edcb9524c973534e1cfe28dea3c58dc37b9df9 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/samples/samples-double-ip.md @@ -0,0 +1,43 @@ +--- +title: 主备集群 +author: Yao Qian +date: 2024-06-14 +--- + +# 主备集群 + +## 一主一备 + +```yaml +global: + # 集群名 + cluster_name: c1 + # 操作系统用户名 + user: omm + # 系统用户密码 + user_password: "" # ptk encrypt password + # 数据库密码 + db_password: "" # ptk encrypt password + # 数据库端口 + db_port: 26000 + # 数据库安装基础目录 + base_dir: /data/mogdb + # SSH connection configuration + ssh_option: + port: 22 + user: root + password: "" # ptk encrypt password + key_file: "" + passphrase: "" + +db_servers: + - host: + # 冗余 IP,目前仅支持最多配置 1 个 + ha_ips: + - + role: primary + - host: + ha_ips: + - + role: standby +``` diff --git a/product/zh/docs-ptk/v2.0/samples/samples-dss-cluster.md b/product/zh/docs-ptk/v2.0/samples/samples-dss-cluster.md new file mode 100644 index 0000000000000000000000000000000000000000..d23fcd38de7765fe99d68d5260cb14e5ccbbe8aa --- /dev/null +++ b/product/zh/docs-ptk/v2.0/samples/samples-dss-cluster.md @@ -0,0 +1,40 @@ +--- +title: 资源池化配置 +author: Yao Qian +date: 2024-06-14 +--- + +# 资源池化配置 + +```yaml +global: + cluster_name: c1 + user: omm + db_password: pTk6Y2I1OWFiZjI8RT1FPUE9RFZfVTUzTy0zUlR5TDZUTmh1STE4VkQ0T2RDYXBNMThoSlNhZDY3UHB4WVE= + db_port: 26000 + base_dir: /data/mogdb + cm_option: + dir: /data/mogdb/cm + cm_server_port: 15300 + dss_option: + dir: /data/mogdb/dss + dss_port: 26010 + dms_port: 26020 + data_vg_name: data + data_vg_path: /dev/data_shared + inst_vg_map: + 172.23.1.28: /dev/data_private_28 + 172.23.1.45: /dev/data_private_45 + cm_share_vg_path: /dev/cm_shared + cm_voting_vg_path: /dev/cm_vote + enable_ssl: on + ssh_option: + port: 22 + user: root + password: pTk6ZDJmZjZlZjI8RT1FPUE9RUs4WEh1OUJRQURfM29GUjZyb3gzZGU3LVRmLTM3Mm5ySmZ5anJXVkNOTUE= +db_servers: + - host: 172.23.1.28 + role: primary + - host: 172.23.1.45 + role: standby +``` diff --git a/product/zh/docs-ptk/v2.0/samples/samples-index.md b/product/zh/docs-ptk/v2.0/samples/samples-index.md new file mode 100644 index 0000000000000000000000000000000000000000..892d9bd338b7e3335465c69c104b8c6e444ee038 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/samples/samples-index.md @@ -0,0 +1,17 @@ +--- +title: 配置文件示例 +author: Yao Qian +date: 2024-06-01 +--- + +# 配置文件示例 + +PTK 在部署集群时,需要提供一个描述目标集群拓扑结构的配置文件,本章将给出常用的几个拓扑配置文件示例,您可以直接复制内容到本地文件中,修改IP后直接进行安装使用。如果需要更多个性化的配置,可以参考[配置文件手册](../reference/ref-config.md)进行修改使用。 + +## 示例 + +- [本地单实例](./samples-local-single.md) +- [远程单实例](./samples-remote-single.md) +- [主备集群](./samples-db-cluster.md) +- [双网段](./samples-double-ip.md) +- [资源池化](./samples-dss-cluster.md) diff --git a/product/zh/docs-ptk/v2.0/samples/samples-local-single.md b/product/zh/docs-ptk/v2.0/samples/samples-local-single.md new file mode 100644 index 0000000000000000000000000000000000000000..c8a52687c801e108a6917158a1409fcbd26bfb72 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/samples/samples-local-single.md @@ -0,0 +1,21 @@ +--- +title: 本地单实例示例 +author: Yao Qian +date: 2024-06-01 +--- + +# 本地单实例 + +```yaml +global: + # 集群名称 + cluster_name: c1 + # 操作系统用户名 + user: omm + # 数据库监听端口 + db_port: 26000 + # 数据库安装目录 + base_dir: <安装目录> +db_servers: + - host: 127.0.0.1 +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/samples/samples-remote-single.md b/product/zh/docs-ptk/v2.0/samples/samples-remote-single.md new file mode 100644 index 0000000000000000000000000000000000000000..7200350473e5c2b5d457cd314c75d716150b635d --- /dev/null +++ b/product/zh/docs-ptk/v2.0/samples/samples-remote-single.md @@ -0,0 +1,29 @@ +--- +title: 远程单实例示例 +author: Yao Qian +date: 2024-06-01 +--- + +# 远程单实例 + +```yaml +global: + # 集群名称 + cluster_name: c1 + # 操作系统用户名 + user: omm + # 数据库监听端口 + db_port: 26000 + # 数据库安装目录 + base_dir: <安装目录> +db_servers: + - host: <目标ip> + # ssh 连接登录信息 + ssh_option: + # ssh 端口 + port: 22 + # ssh 登录用户 + user: root + # ptk encrypt 加密后的 ssh 密码的密文 + password: +``` \ No newline at end of file diff --git a/product/zh/docs-ptk/v2.0/toc.md b/product/zh/docs-ptk/v2.0/toc.md new file mode 100644 index 0000000000000000000000000000000000000000..d601668f3e220153ed9a46e60412160cfba3f225 --- /dev/null +++ b/product/zh/docs-ptk/v2.0/toc.md @@ -0,0 +1,159 @@ + + +# 文档 + +## PTK 文档目录 + ++ [关于PTK](./overview.md) ++ 快速入门 + + [安装PTK](./quick-start/install-ptk.md) + + [部署示例数据库](./quick-start/demo-db.md) ++ 使用指南 + + [准备配置文件](./guide/guide-prepare-config.md) + + [检查系统环境](./guide/guide-checkos.md) + + [部署数据库集群](./guide/guide-install-cluster.md) + + 管理数据库集群 + + [查看集群列表](./guide/manage-cluster/manage-cluster-list-clusters.md) + + [查看集群状态](./guide/manage-cluster/manage-cluster-status.md) + + [启动数据库](./guide/manage-cluster/manage-cluster-start-db.md) + + [停止数据库](./guide/manage-cluster/manage-cluster-stop-db.md) + + [重启数据库](./guide/manage-cluster/manage-cluster-restart-db.md) + + [重建数据库](./guide/manage-cluster/manage-cluster-build-db.md) + + [主备倒换](./guide/manage-cluster/manage-cluster-switchover.md) + + [故障切换](./guide/manage-cluster/manage-cluster-failover.md) + + [查看数据库插件](./guide/manage-cluster/manage-cluster-list-plugins.md) + + [安装数据库插件](./guide/manage-cluster/manage-cluster-install-plugin.md) + + [升级数据库](./guide/manage-cluster/manage-cluster-upgrade.md) + + [数据库集群扩容](./guide/manage-cluster/manage-cluster-scale-out.md) + + [数据库集群缩容](./guide/manage-cluster/manage-cluster-scale-in.md) + + [查看数据库HBA](./guide/manage-cluster/manage-cluster-show-hba.md) + + [新增数据库HBA](./guide/manage-cluster/manage-cluster-set-hba.md) + + [查看数据库参数](./guide/manage-cluster/manage-cluster-show-guc.md) + + [设置数据库参数](./guide/manage-cluster/manage-cluster-set-guc.md) + + [查看集群拓扑配置](./guide/manage-cluster/manage-cluster-show-config.md) + + [查看集群元信息](./guide/manage-cluster/manage-cluster-inspect.md) + + [更新集群备注](./guide/manage-cluster/manage-cluster-modify-comment.md) + + [更换数据库IP](./guide/manage-cluster/manage-cluster-refresh.md) + + [变更数据库角色](./guide/manage-cluster/manage-cluster-role-change.md) + + [安装CM组件](./guide/manage-cluster/manage-cluster-install-cm.md) + + [卸载CM组件](./guide/manage-cluster/manage-cluster-uninstall-cm.md) + + [管理虚拟IP](./guide/manage-cluster/manage-cluster-vip.md) + + [安装MogHA服务](./guide/manage-cluster/manage-cluster-install-mogha.md) + + [卸载MogHA服务](./guide/manage-cluster/manage-cluster-uninstall-mogha.md) + + [集群重命名](./guide/manage-cluster/manage-cluster-rename-cluster.md) + + [创建空集群](./guide/manage-cluster/manage-cluster-init-empty-clsuter.md) + + [抛弃节点](./guide/manage-cluster/manage-cluster-throwout.md) + + [接管节点](./guide/manage-cluster/manage-cluster-takeover.md) + + [纳管数据库集群](./guide/manage-cluster/manage-cluster-manage.md) + + [卸载数据库集群](./guide/guide-uninstall-cluster.md) + + [收集运行环境信息](./guide/guide-collectos.md) + + [下载MogDB安装包](./guide/guide-download-package.md) + + [加密敏感信息](./guide/guide-encrypt.md) + + [PTK自升级](./guide/guide-self-upgrade.md) + + [PTKC工具](./guide/guide-ptkc-tool.md) ++ 使用参考 + + [环境变量](./reference/ref-environment.md) + + [元数据](./reference/ref-metadata.md) + + [配置文件](./reference/ref-config.md) + + [数据库推荐参数](./reference/ref-recommend-guc.md) + + [对MogDB版本的支持](./reference/ref-support-mogdb.md) ++ [配置文件示例](./samples/samples-index.md) + + [本地单实例](./samples/samples-local.md) + + [远程单实例](./samples/samples-remote-single.md) + + [主备集群](./samples/samples-db-cluster.md) + + [双网段](./samples/samples-double-ip.md) + + [资源池化](./samples/samples-dss-cluster.md) ++ 命令介绍 + + [ptk](./commands/ptk.md) + + [ptk completion](./commands/ptk-completion.md) + + [ptk completion powershell](./commands/ptk-completion-powershell.md) + + [ptk completion fish](./commands/ptk-completion-fish.md) + + [ptk completion zsh](./commands/ptk-completion-zsh.md) + + [ptk completion bash](./commands/ptk-completion-bash.md) + + [ptk register](./commands/ptk-register.md) + + [ptk init-cluster](./commands/ptk-init-cluster.md) + + [ptk collect](./commands/ptk-collect.md) + + [ptk rec-guc](./commands/ptk-rec-guc.md) + + [ptk cache](./commands/ptk-cache.md) + + [ptk gen-ptkc](./commands/ptk-gen-ptkc.md) + + [ptk manage](./commands/ptk-manage.md) + + [ptk demo](./commands/ptk-demo.md) + + [ptk meta](./commands/ptk-meta.md) + + [ptk meta merge](./commands/ptk-meta-merge.md) + + [ptk meta dump](./commands/ptk-meta-dump.md) + + [ptk meta prune](./commands/ptk-meta-prune.md) + + [ptk meta home](./commands/ptk-meta-home.md) + + [ptk version](./commands/ptk-version.md) + + [ptk self](./commands/ptk-self.md) + + [ptk self upgrade](./commands/ptk-self-upgrade.md) + + [ptk gen-om-xml](./commands/ptk-gen-om-xml.md) + + [ptk env](./commands/ptk-env.md) + + [ptk gen-static-config](./commands/ptk-gen-static-config.md) + + [ptk cluster](./commands/ptk-cluster.md) + + [ptk cluster rename](./commands/ptk-cluster-rename.md) + + [ptk cluster throwout](./commands/ptk-cluster-throwout.md) + + [ptk cluster takeover](./commands/ptk-cluster-takeover.md) + + [ptk cluster uninstall-cm](./commands/ptk-cluster-uninstall-cm.md) + + [ptk cluster install-cm](./commands/ptk-cluster-install-cm.md) + + [ptk cluster gen-cert-files](./commands/ptk-cluster-gen-cert-files.md) + + [ptk cluster load-cm-vip](./commands/ptk-cluster-load-cm-vip.md) + + [ptk cluster del-kerberos-auth](./commands/ptk-cluster-del-kerberos-auth.md) + + [ptk cluster add-kerberos-auth](./commands/ptk-cluster-add-kerberos-auth.md) + + [ptk cluster uninstall-kerberos-server](./commands/ptk-cluster-uninstall-kerberos-server.md) + + [ptk cluster install-kerberos-server](./commands/ptk-cluster-install-kerberos-server.md) + + [ptk cluster is-in-upgrade](./commands/ptk-cluster-is-in-upgrade.md) + + [ptk cluster upgrade-rollback](./commands/ptk-cluster-upgrade-rollback.md) + + [ptk cluster upgrade-commit](./commands/ptk-cluster-upgrade-commit.md) + + [ptk cluster upgrade](./commands/ptk-cluster-upgrade.md) + + [ptk cluster demote](./commands/ptk-cluster-demote.md) + + [ptk cluster promote](./commands/ptk-cluster-promote.md) + + [ptk cluster refresh](./commands/ptk-cluster-refresh.md) + + [ptk cluster shell](./commands/ptk-cluster-shell.md) + + [ptk cluster modify-comment](./commands/ptk-cluster-modify-comment.md) + + [ptk cluster show-config](./commands/ptk-cluster-show-config.md) + + [ptk cluster set-guc](./commands/ptk-cluster-set-guc.md) + + [ptk cluster show-guc](./commands/ptk-cluster-show-guc.md) + + [ptk cluster set-hba](./commands/ptk-cluster-set-hba.md) + + [ptk cluster show-hba](./commands/ptk-cluster-show-hba.md) + + [ptk cluster scale-out](./commands/ptk-cluster-scale-out.md) + + [ptk cluster scale-in](./commands/ptk-cluster-scale-in.md) + + [ptk cluster uninstall-mogha](./commands/ptk-cluster-uninstall-mogha.md) + + [ptk cluster install-mogha](./commands/ptk-cluster-install-mogha.md) + + [ptk cluster list-plugins](./commands/ptk-cluster-list-plugins.md) + + [ptk cluster install-plugin](./commands/ptk-cluster-install-plugin.md) + + [ptk cluster inspect](./commands/ptk-cluster-inspect.md) + + [ptk cluster failover](./commands/ptk-cluster-failover.md) + + [ptk cluster switchover](./commands/ptk-cluster-switchover.md) + + [ptk cluster build](./commands/ptk-cluster-build.md) + + [ptk cluster status](./commands/ptk-cluster-status.md) + + [ptk cluster restart](./commands/ptk-cluster-restart.md) + + [ptk cluster stop](./commands/ptk-cluster-stop.md) + + [ptk cluster start](./commands/ptk-cluster-start.md) + + [ptk uninstall](./commands/ptk-uninstall.md) + + [ptk ls](./commands/ptk-ls.md) + + [ptk install](./commands/ptk-install.md) + + [ptk exec](./commands/ptk-exec.md) + + [ptk template](./commands/ptk-template.md) + + [ptk template scale-out](./commands/ptk-template-scale-out.md) + + [ptk template mogha](./commands/ptk-template-mogha.md) + + [ptk template create](./commands/ptk-template-create.md) + + [ptk encrypt](./commands/ptk-encrypt.md) + + [ptk checkos](./commands/ptk-checkos.md) + + [ptk download](./commands/ptk-download.md) + + [ptk candidate](./commands/ptk-candidate.md) + + [ptk candidate plugin](./commands/ptk-candidate-plugin.md) + + [ptk candidate cpu](./commands/ptk-candidate-cpu.md) + + [ptk candidate os](./commands/ptk-candidate-os.md) + + [ptk candidate db](./commands/ptk-candidate-db.md) ++ [故障排查](./debug.md) ++ [FAQ](./faq.md) ++ [发布记录](./release-notes/release.md) + + [v1.5](./release-notes/release-15x.md) + + [v1.4](./release-notes/release-14x.md) + + [v1.3](./release-notes/release-13x.md) + + [v1.2](./release-notes/release-12x.md) + + [v1.1](./release-notes/release-11x.md) + + [v1.0](./release-notes/release-10x.md) + + [v0.x](./release-notes/release-0xx.md) ++ [社区](https://www.modb.pro/search?query=ptk) ++ [附录:YAML语法](./appendix/yaml-grammar.md) \ No newline at end of file diff --git a/scripts/build_pdf.sh b/scripts/build_pdf.sh index 5845c78d6f7ca58a19807b4a6bd1943831126628..ef971c00ba48cf2f2a7be952b57c3ec0f3f2bcb3 100755 --- a/scripts/build_pdf.sh +++ b/scripts/build_pdf.sh @@ -176,7 +176,7 @@ declare -A mogHAEnTitle=( \ ["toc"]="MogDB-MogHA-Reference" \ ) -ptkDocsVersions=("v1.1") +ptkDocsVersions=("v2.0") declare -A ptkZnTitle=( \ ["toc"]="MogDB-PTK-指南" \ diff --git a/src/utils/version_config.js b/src/utils/version_config.js index dc0dc7b16b8d67c77eb9e139f8a2a4d6e0327532..fd574887bdaf707301a12c7719a84402c2c6abbc 100644 --- a/src/utils/version_config.js +++ b/src/utils/version_config.js @@ -68,8 +68,13 @@ const allProductVersions = { } }, ptk: { - latestVersion: 'v1.1', + latestVersion: 'v2.0', versions: { + 'v2.0': { + value: 'v2.0', + label: 'v2.0', + disabled: false + }, 'v1.1': { value: 'v1.1', label: 'v1.1', diff --git a/static/cast/ptk-demo-v1.5.cast b/static/cast/ptk-demo-v1.5.cast new file mode 100644 index 0000000000000000000000000000000000000000..d299a3d38bf1a1b4bd858370199696e1978b8b87 --- /dev/null +++ b/static/cast/ptk-demo-v1.5.cast @@ -0,0 +1,138 @@ +{"version": 2, "width": 143, "height": 40, "timestamp": 1718097162, "env": {"SHELL": "/bin/zsh", "TERM": "xterm-256color"}} +[0.032259, "o", "\u001b]0;root@demonstration:~\u0007\u001b[?1034h[root@demonstration ~]# "] +[0.306682, "o", "\u001b[H\u001b[2J[root@demonstration ~]# "] +[0.704607, "o", "p"] +[0.834315, "o", "t"] +[0.910423, "o", "k"] +[1.039993, "o", " "] +[1.311392, "o", "d"] +[1.374871, "o", "e"] +[1.457988, "o", "m"] +[1.546629, "o", "o"] +[2.216703, "o", "\r\n"] +[2.28008, "o", "Cluster Name: \"demo_Fth\"\r\n+--------------+--------------+------------------------------+-------+---------+---------------------------------+----------+\r\n| az(priority) | ip | user(group) | port | role | data dir | upstream |\r\n+--------------+--------------+------------------------------+-------+---------+---------------------------------+----------+\r\n| AZ1(1) | 172.16.0.198 | demo_user_Fth(demo_user_Fth) | 26000 | primary | /home/demo_user_Fth/demodb/data | - |\r\n+--------------+--------------+------------------------------+-------+---------+---------------------------------+----------+\r\n\u001b[?25l\u001b[2K\r\u001b[32m✔\u001b[0m Is cluster config correct (default=n) [y/n]: █\r\n\u001b[J\u001b[2K\r \b"] +[3.959015, "o", "\u001b[J\u001b[2K\ry\u001b[J\u001b[2K\r\u001b[1A\u001b[2K\r\u001b[2K\r\u001b[32m✔\u001b[0m Is cluster config correct (default=n) [y/n]: y█\r\ny\u001b[J\u001b[2K\r \b"] +[4.131455, "o", "\u001b[J\u001b[2K\r \b\u001b[J\u001b[2K\r\u001b[1A\u001b[2K\r\u001b[2K\r\u001b[32m✔\u001b[0m Is cluster config correct (default=n) [y/n]: y█\r\n\u001b[1A\u001b[2K\r\u001b[2K\r\u001b[32m✔\u001b[0m Is cluster config correct (default=n) [y/n]: y\r\n\u001b[?25h\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.811] start check hostname ... \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.815] check hostname success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.815] skip check os \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.815] start check distro ... \r\n"] +[4.160152, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.839] check distro success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.839] start check user ... \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.843] check user success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.843] start check port ... \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.844] checking port 26001 on host 172.16.0.198 (db HA port) ... \r\n"] +[4.168717, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.851] checking port 26000 on host 172.16.0.198 (db listen port) ... \r\n"] +[4.176712, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.859] check port success \r\n"] +[4.180667, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.864] [172.16.0.198][demo_user_Fth] create os user demo_user_Fth, group demo_user_Fth \r\n"] +[4.263199, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.942] [172.16.0.198][demo_user_Fth] set ulimit configs \r\n"] +[4.267576, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.946] start prepare installation package ... \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.946] no package specified, use online package: https://cdn-mogdb.enmotech.com/mogdb-media/5.0.7/CentOS_x86_64/MogDB-5.0.7-CentOS-x86_64-all.tar.gz \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.946] use cache /root/.ptk/cache/MogDB-5.0.7-CentOS-x86_64-all.tar.gz \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.946] installation package is ready \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:46.946] parse installation package ... \r\n"] +[10.254033, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:54.934] db product: MogDB, version: 5.0.7, number: 92.924, commit_id: c4707384 \r\n"] +[10.888835, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:55.568] extract MogDB-5.0.7-CentOS-64bit.tar.gz to dir /tmp/ptk_tmp_1999357673 \r\n"] +[13.937374, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.620] execute command: mogdb --version \r\n"] +[14.166596, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.848] parse installation package success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.848] start complete the configuration ... \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.848] complete the configuration success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.848] save the topology to metadata \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.849] start distribute installation package ... \r\n"] +[14.29178, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.974] distrubite packages success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.974] start install logic nodes ... \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.974] deploy db to demo_user_Fth@172.16.0.198 \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:39:58.974] [172.16.0.198][demo_user_Fth] make user demo_user_Fth's dir(s): /home/demo_user_Fth/demodb \r\n"] +[14.679687, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:59.358] [172.16.0.198][demo_user_Fth] clean user demo_user_Fth's ipc resource \r\n"] +[14.742536, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:59.422] [172.16.0.198][demo_user_Fth] make user demo_user_Fth's dir(s): /home/demo_user_Fth/demodb/tool,/home/demo_user_Fth/demodb/tool/ptk_tool/bin \r\n"] +[14.927439, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:39:59.611] [172.16.0.198][demo_user_Fth] extract MogDB-5.0.7-CentOS-x86_64-all.tar.gz to dir /home/demo_user_Fth/demodb/tool \r\n"] +[16.097032, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:00.776] [172.16.0.198][demo_user_Fth] extract MogDB-5.0.7-CentOS-64bit-om.tar.gz to dir /home/demo_user_Fth/demodb/tool \r\n"] +[16.510863, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:01.192] [172.16.0.198][demo_user_Fth] try to fix psutil python lib \r\n"] +[16.572636, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:01.252] [172.16.0.198][demo_user_Fth] write file /home/demo_user_Fth/demodb/tool/script/py_pstree.py \r\n"] +[16.615113, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:01.294] [172.16.0.198][demo_user_Fth] write file /home/demo_user_Fth/demodb/tool/ptk_tool/bin/README.md \r\n"] +[16.668006, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:01.352] [172.16.0.198][demo_user_Fth] write file /home/demo_user_Fth/demodb/tool/ptk_tool/bin/pscp \r\n"] +[16.726764, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:01.411] [172.16.0.198][demo_user_Fth] write file /home/demo_user_Fth/demodb/tool/ptk_tool/bin/pssh \r\n"] +[16.78206, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:01.466] [172.16.0.198][demo_user_Fth] write file /home/demo_user_Fth/demodb/tool/ptk_tool/bin/task_pool.py \r\n"] +[16.842714, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:01.525] [172.16.0.198][demo_user_Fth] make user demo_user_Fth's dir(s): /home/demo_user_Fth/demodb/app \r\n"] +[16.920208, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:01.600] [172.16.0.198][demo_user_Fth] extract MogDB-5.0.7-CentOS-64bit.tar.gz to dir /home/demo_user_Fth/demodb/app \r\n"] +[19.98301, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:04.663] [172.16.0.198][demo_user_Fth] change mode of /home/demo_user_Fth/demodb/app to 700 \r\n"] +[20.013799, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:04.694] [172.16.0.198][demo_user_Fth] make user demo_user_Fth's dir(s): /home/demo_user_Fth/demodb/app/share/postgresql \r\n"] +[20.110727, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:04.795] [172.16.0.198][demo_user_Fth] copy /home/demo_user_Fth/demodb/tool/script/gspylib/etc/sql/pmk_schema.sql to /home/demo_user_Fth/demodb/app/share/postgresql \r\n"] +[20.130265, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:04.812] [172.16.0.198][demo_user_Fth] copy /home/demo_user_Fth/demodb/tool/script/gspylib/etc/sql/pmk_schema_single_inst.sql to /home/demo_user_Fth/demodb/app/share/postgresql \r\n"] +[20.149807, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:04.832] [172.16.0.198][demo_user_Fth] write file /home/demo_user_Fth/demodb/app/bin/transfer.py \r\n"] +[20.184472, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:04.867] [172.16.0.198][demo_user_Fth] set user demo_user_Fth profiles \r\n"] +[20.366768, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.049] [172.16.0.198][demo_user_Fth] validate and try to fix ld library for gs_initdb \r\n"] +[20.390514, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.075] [172.16.0.198][demo_user_Fth] validate and try to fix ld library for mogdb \r\n"] +[20.422914, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.103] [172.16.0.198][demo_user_Fth] make user demo_user_Fth's dir(s): /home/demo_user_Fth/demodb/log/gs_profile,/home/demo_user_Fth/demodb/log/pg_log,/home/demo_user_Fth/demodb/log/pg_audit,/home/demo_user_Fth/demodb/log/bin,/home/demo_user_Fth/demodb/log/pg_log/dn_6001,/home/demo_user_Fth/demodb/log/pg_audit/dn_6001 \r\n"] +[20.962383, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.644] [172.16.0.198][demo_user_Fth] make user demo_user_Fth's dir(s): /home/demo_user_Fth/demodb/tmp \r\n"] +[21.030188, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.712] [172.16.0.198][demo_user_Fth] save version to upgrade_version \r\n"] +[21.104309, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.788] [172.16.0.198][demo_user_Fth] create file cluster_manual_start \r\n"] +[21.126322, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.806] [172.16.0.198][demo_user_Fth] generate cluster_static_config file \r\n"] +[21.158831, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.841] [172.16.0.198][demo_user_Fth] make user demo_user_Fth's dir(s): /home/demo_user_Fth/demodb/data \r\n"] +[21.2299, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.909] [172.16.0.198][demo_user_Fth] write file /home/demo_user_Fth/demodb/tool/.ptk_deployer \r\n"] +[21.266194, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:05.946] generate certification files \r\n"] +[22.139077, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:06.820] download certification files \r\n"] +[22.483414, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:07.166] certification files setup success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:07.166] initialize db on demo_user_Fth@172.16.0.198 \r\n"] +[22.506639, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:07.186] [172.16.0.198][demo_user_Fth] the database is initializing, please wait a few minutes \r\n"] +[39.185782, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:29.865] [172.16.0.198][demo_user_Fth] config postgresql.conf \r\n"] +[39.251825, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:29.934] [172.16.0.198][demo_user_Fth] config pg_hba.conf \r\n"] +[39.28937, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:29.968] [172.16.0.198][demo_user_Fth] copy ssl files to data dir \r\n"] +[39.310811, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:29.993] logic nodes installed success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:29.993] start build ssh trust ... \r\n"] +[39.493542, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:30.173] ssh trust build success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:30.173] start launch db ... \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:30.173] [172.16.0.198][demo_user_Fth] start db using gs_ctl ... \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:30.173] [172.16.0.198][demo_user_Fth] the database is starting, please wait a few minutes \r\n"] +[31.540724, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.220] [172.16.0.198][demo_user_Fth] start db success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.220] launch db success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.220] clear temp dirs ... \r\n"] +[31.586877, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.266] clear temp dirs success \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.266] time elapsed: 46s \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.266] save the topology to metadata \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.267] generating ptkc ... \r\n"] +[31.708387, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.387] cluster db version: 5.0.7 \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.387] prepare missing plugin packages from internet \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.387] downloading postgres_fdw-1.0-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[31.744667, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.425] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.425] downloading dblink-1.0-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[31.765263, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.445] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.445] downloading pg_bulkload-1.0-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[31.797604, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.481] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.481] downloading pg_prewarm-1.1-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[31.817099, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.500] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:31.500] downloading postgis-2.4.2-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[36.671621, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.351] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.351] downloading wal2json-2.3-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[36.694678, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.374] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.374] downloading whale-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[36.848659, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.530] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.530] downloading mysql_fdw-1.1-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[36.982284, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.665] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.665] downloading pg_repack-1.4.6-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[37.083579, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.766] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.766] downloading pg_trgm-1.0-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[37.133177, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.816] download successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.817] downloading oracle_fdw-1.0-5.0.7-01-CentOS-x86_64.tar.gz ... \r\n"] +[37.224662, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:36.901] download successfully \r\n"] +[38.860837, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:39.541] will install these plugins:\r\n[pg_prewarm, wal2json, whale, pg_repack, pg_trgm, oracle_fdw, postgres_fdw, dblink, pg_bulkload, postgis, mysql_fdw] \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:39.541] [172.16.0.198][demo_user_Fth] upload All-Plugins.tar.gz \r\n"] +[39.155081, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:39.835] [172.16.0.198][demo_user_Fth] make user demo_user_Fth's dir(s): /home/demo_user_Fth/demodb/tool/plugins \r\n"] +[39.261798, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:39.945] [172.16.0.198][demo_user_Fth] extract All-Plugins.tar.gz to dir /home/demo_user_Fth/demodb/tool/plugins \r\n"] +[40.311157, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:40.991] [172.16.0.198][demo_user_Fth] change /home/demo_user_Fth/demodb/tool/plugins owner to demo_user_Fth \r\n"] +[40.328601, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.010] [172.16.0.198][demo_user_Fth] installing plugin [postgres_fdw] ... \r\n"] +[40.367822, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.050] [172.16.0.198][demo_user_Fth] plugin [postgres_fdw] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.050] [172.16.0.198][demo_user_Fth] installing plugin [dblink] ... \r\n"] +[40.415072, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.094] [172.16.0.198][demo_user_Fth] plugin [dblink] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.094] [172.16.0.198][demo_user_Fth] installing plugin [pg_bulkload] ... \r\n"] +[40.46053, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.140] [172.16.0.198][demo_user_Fth] plugin [pg_bulkload] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.140] [172.16.0.198][demo_user_Fth] installing plugin [postgis] ... \r\n"] +[40.52919, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.213] [172.16.0.198][demo_user_Fth] plugin [postgis] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.213] [172.16.0.198][demo_user_Fth] installing plugin [mysql_fdw] ... \r\n"] +[40.575576, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.255] [172.16.0.198][demo_user_Fth] plugin [mysql_fdw] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.255] [172.16.0.198][demo_user_Fth] installing plugin [oracle_fdw] ... \r\n"] +[40.617427, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.299] [172.16.0.198][demo_user_Fth] plugin [oracle_fdw] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.299] [172.16.0.198][demo_user_Fth] installing plugin [pg_prewarm] ... \r\n"] +[40.653672, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.338] [172.16.0.198][demo_user_Fth] plugin [pg_prewarm] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.338] [172.16.0.198][demo_user_Fth] installing plugin [wal2json] ... \r\n"] +[40.69314, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.377] [172.16.0.198][demo_user_Fth] plugin [wal2json] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.377] [172.16.0.198][demo_user_Fth] installing plugin [whale] ... \r\n"] +[40.746449, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.419] [172.16.0.198][demo_user_Fth] plugin [whale] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.419] [172.16.0.198][demo_user_Fth] installing plugin [pg_repack] ... \r\n"] +[40.776686, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.457] [172.16.0.198][demo_user_Fth] plugin [pg_repack] installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.457] [172.16.0.198][demo_user_Fth] installing plugin [pg_trgm] ... \r\n"] +[40.821861, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.501] [172.16.0.198][demo_user_Fth] plugin [pg_trgm] installed successfully \r\n"] +[40.841771, "o", "\u001b[33mplugin [mysql_fdw] is installed, you should manually install so library of mysql client\r\n\u001b[0m\u001b[33mplugin [oracle_fdw] is installed, you should manually install so library of oracle client\r\n\u001b[0m\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.523] All done \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.523] time elapsed: 11s \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:41.523] Start install plugin extension \r\n"] +[42.779669, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:43.459] mode: A, install plugin extension: whale... \r\n"] +[43.311111, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:43.988] mode: A, install plugin extension: whale, installed successfully \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:43.988] mode: A, install plugin extension: compat_tools... \r\n"] +[47.558673, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:48.239] mode: A, install plugin extension: compat_tools, installed successfully \r\n"] +[47.720189, "o", "\u001b[36mINFO\u001b[0m[2024-06-11T16:40:48.392] mode: A, plugin: mogila exec preHook: create user mogdb with login password \"Demo&Fth\"; \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:48.392] mode: A, plugin: mogila exec preHook: grant all privileges to mogdb; \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:48.392] mode: A, plugin: mogila exec preHook: alter user mogdb MONADMIN; \r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:48.393] mode: A, install plugin extension: mogila... \r\n"] +[49.664905, "o", "[actor address category city country customer film film_actor film_category inventory language payment rental staff store] [actor address category city country customer film film_actor film_category inventory language payment rental staff store]\r\n[actor address category city country customer film film_actor film_category inventory language payment rental staff store] [actor address category city country customer film film_actor film_category inventory language payment rental staff store]\r\n\u001b[36mINFO\u001b[0m[2024-06-11T16:40:50.343] mode: A, install plugin extension: mogila, installed successfully \r\nDemo Summary:\r\n\r\nDeploy Status:\r\n\r\n cluste_name | host | user | port | status | message \r\n--------------+--------------+---------------+-------+---------------+----------\r\n demo_Fth | 172.16.0.198 | demo_user_Fth | 26000 | start_success | success \r\n\r\nDatabase Detail:\r\n\r\n item | value \r\n----------------+----------------------------------\r\n user_passwor"] +[49.665525, "o", "d | Demo&Fth \r\n db_password | Demo&Fth \r\n base_dir | /home/demo_user_Fth/demodb \r\n app_dir | /home/demo_user_Fth/demodb/app \r\n data_dir | /home/demo_user_Fth/demodb/data \r\n tool_dir | /home/demo_user_Fth/demodb/tool \r\n tmp_dir | /home/demo_user_Fth/demodb/tmp \r\n\r\nMode Compatibility:\r\n\r\n mode | database | plugins | other \r\n-------+------------------------+-----------------------+-------------------------------------\r\n PG | postgres_compatibility | \u001b[32mnone\u001b[0m | \r\n A | oracle_compatibility | whale[\u001b[32msuccess\u001b[0m] | \r\n | | compat_tools[\u001b[32msuccess\u001b[0m] | \r\n | | mogila[\u001b[32msuccess\u001b[0m] | db user: mogdb, password: Demo&Fth \r\n\r\nPlugin Install Details:\r\n m"] +[49.666281, "o", "ode | plugin | status | reference | error \r\n-------+--------------+---------+-------------------------------------------+--------\r\n A | whale | \u001b[32msuccess\u001b[0m | \u001b[32mhttps://docs.mogdb.io/zh/mogdb/v3.0/whale\u001b[0m | \r\n | compat_tools | \u001b[32msuccess\u001b[0m | \u001b[32mhttps://gitee.com/enmotech/compat-tools\u001b[0m | \r\n | mogila | \u001b[32msuccess\u001b[0m | \u001b[32mhttps://gitee.com/enmotech/mogila\u001b[0m | \r\n\u001b[0m\u001b]0;root@demonstration:~\u0007[root@demonstration ~]# "] +[51.84888, "o", "s"] +[51.91337, "o", "u"] +[52.081948, "o", " "] +[52.305981, "o", "-"] +[52.904952, "o", " "] +[53.227546, "o", "d"] +[53.299962, "o", "e"] +[53.45418, "o", "m"] +[53.508643, "o", "o"] +[53.98051, "o", "_"] +[54.304827, "o", "u"] +[54.446345, "o", "s"] +[54.525894, "o", "e"] +[54.81037, "o", "r"] +[55.470379, "o", "_"] +[56.532367, "o", "F"] +[56.903305, "o", "t"] +[57.120399, "o", "h"] +[57.707218, "o", "\r\n"] +[57.737434, "o", "\u001b]0;demo_user_Fth@demonstration:~\u0007\u001b[?1034h[demo_user_Fth@demonstration ~]$ "] +[58.302499, "o", "g"] +[58.576316, "o", "s"] +[58.608874, "o", "q"] +[58.741013, "o", "l"] +[58.963138, "o", " "] +[59.239327, "o", "-"] +[59.538894, "o", "r"] +[59.826613, "o", "\r\n"] +[59.847939, "o", "gsql ((MogDB 5.0.7 build c4707384) compiled at 2024-05-24 10:51:53 commit 0 last mr 1804 )\r\n"] +[59.849972, "o", "Non-SSL connection (SSL connection is recommended when requiring high-security)\r\nType \"help\" for help.\r\n\r\nMogDB=# "] +[61.092334, "o", "\\"] +[61.447327, "o", "l"] +[61.786241, "o", "\r\n"] +[61.786318, "o", " List of databases\r\n Name | Owner | Encoding | Collate | Ctype | Access privileges | Compatibility \r\n------------------------+---------------+----------+---------+-------+---------------------------------+---------------\r\n oracle_compatibility | demo_user_Fth | UTF8 | C | C | | A\r\n postgres | demo_user_Fth | UTF8 | C | C | | A\r\n postgres_compatibility | demo_user_Fth | UTF8 | C | C | | PG\r\n template0 | demo_user_Fth | UTF8 | C | C | =c/demo_user_Fth +| A\r\n | | | | | demo_user_Fth=CTc/demo_user_Fth | \r\n template1 | demo_user_Fth | UTF8 | C | C | =c/demo_user_Fth +| A\r\n | | | | "] +[61.786516, "o", " | demo_user_Fth=CTc/demo_user_Fth | \r\n(5 rows)\r\n\r\nMogDB=# "] +[63.301066, "o", "^C\r\nMogDB=# "] +[63.748645, "o", "\\q\r\n\u001b]0;demo_user_Fth@demonstration:~\u0007[demo_user_Fth@demonstration ~]$ "] +[63.792445, "o", "\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m \r \r"]