- Overview
- Quick Start
- Install PTK
- Usage
- Configuration
- Config Samples
- Commands
- ptk
- ptk completion
- ptk register
- 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 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
- Troubleshooting
- FAQ
- Release Note
- GPTK - Graphical Deployment Tool
- Community
- Appendix: YAML Syntax
PTK Metadata
During installation, PTK automatically creates a metadata directory $HOME/.ptk
in the root directory under an installation user. The metadata directory is used for storing data required for PTK running. Please handle the files in this directory with caution.
Viewing the Metadata Directory
Single PTK v0.6, ptk meta home
can be used to obtain the metadata directory of PTK. It is convenient for integrating PTK into a third-party script or system.
The metadata directory of PTK is the .ptk
folder in the root directory under an installation user by default. You can customize the directory using PTK_HOME
. PTK itself is stateless. If PTK_HOME
is specified, the clusters you can see in PTK_HOME
are different.
Clearing Invalid Cluster Metadata
Typically, the life cycle of a database is managed using PTK. You do not need to consider cluster metadata.
However, in some scenarios, cluster metadata is needed. For example, you create a cluster using PTK but the cluster instance or data has been deleted by other users or programs. In this case, PTK considers that the cluster is still existing but it cannot be managed by PTK.
In this case, PTK provides meta prune
to clear metadata.
ptk meta prune -n <CLUSTER_NAME> [--force]
Additionally, ptk meta prune
provides the --force
option to forcibly clear metadata. Typically, if the cluster is normal, PTK does not allow you to clear metadata. If you are sure to clear metadata and do not need PTK to manage a specified cluster, you can specify the --force
option to clear metadata.
Metadata Export and Merge
PTK performing installation as different users will generate two instances which are independent of each other. To merge two instances under the two users, export metadata, and then merge metadata to merge two PTK instances into a user for management.
Procedure
-
Export metadata
Run the following command as the user under which the PTK metadata is to be exported. A GZIP package in the
ptk_meta_*.tar.gz
format will be generated.ptk meta dump --all
-
Merge metadata
Switch to the user under which the PTK instance is to be merged, upload the metadata package generated in the previous step to the user, and run the following command to merge the PTK metadata.
ptk meta merge -p <ptk_meta_*.tar.gz>