v2.0
- 关于PTK
 - 快速入门
 - 使用指南
 - 使用参考
 - 配置文件示例
 - 命令介绍
- ptk
 - ptk completion
 - ptk view-static-config
 - ptk init-cluster
 - ptk collect
 - ptk rec-guc
 - ptk cache
 - ptk gen-ptkc
 - ptk manage
 - ptk demo
 - ptk meta
 - ptk version
 - ptk self
 - ptk gen-om-xml
 - ptk env
 - ptk gen-static-config
 - ptk cluster
- ptk cluster createdb
 - ptk cluster uninstall-compat-tools
 - ptk cluster install-compat-tools
 - ptk cluster install-mogila
 - ptk cluster rename
 - ptk cluster throwout
 - ptk cluster takeover
 - ptk cluster uninstall-cm
 - ptk cluster install-cm
 - ptk cluster gen-cert-files
 - ptk cluster load-cm-vip
 - ptk cluster del-kerberos-auth
 - ptk cluster add-kerberos-auth
 - ptk cluster uninstall-kerberos-server
 - ptk cluster install-kerberos-server
 - ptk cluster is-in-upgrade
 - ptk cluster upgrade-rollback
 - ptk cluster upgrade-commit
 - ptk cluster upgrade
 - ptk cluster demote
 - ptk cluster promote
 - ptk cluster refresh
 - ptk cluster shell
 - ptk cluster modify-comment
 - ptk cluster show-config
 - ptk cluster set-guc
 - ptk cluster show-guc
 - ptk cluster set-hba
 - ptk cluster show-hba
 - ptk cluster scale-out
 - ptk cluster scale-in
 - ptk cluster uninstall-mogha
 - ptk cluster install-mogha
 - ptk cluster list-plugins
 - ptk cluster install-plugin
 - ptk cluster inspect
 - ptk cluster failover
 - ptk cluster switchover
 - ptk cluster build
 - ptk cluster status
 - ptk cluster restart
 - ptk cluster stop
 - ptk cluster start
 
 - ptk uninstall
 - ptk ls
 - ptk install
 - ptk exec
 - ptk template
 - ptk encrypt
 - ptk checkos
 - ptk download
 - ptk candidate
 
 - 故障排查
 - FAQ
 - 发布记录
 - 社区
 - 附录:YAML语法
 
重建数据库
如果集群内的备库或级联备库出现了不可自动修复的数据等问题,我们有时需要通过和其他实例同步数据来重建数据库来修复这个实例,此时您可以通过 PTK 来重建指定的实例。
重建指定实例
我们在重建某个实例时必须通过 -H 或 -i 来指定实例进行操作。
-H 或 --host 参数指定实例的 IP
ptk cluster -n <CLUSTER_NAME> build -H <IP>-i 或 --id 参数可以指定实例的 ID (ID 可通过 ptk ls 查看)
ptk cluster -n <CLUSTER_NAME> build -i <ID>从指定实例同步数据
默认情况下将和主库进行数据库同步来重建备库,但这样会给主库带来IO压力,进而可能影响业务的性能。此时您可以通过 --build-from 参数来指定其他的实例 IP 来重建:
ptk cluster -n <CLUSTER_NAME> build -H <IP> --build-from <IP>