HomeMogDBMogDB StackUqbar
v1.1

Documentation:v1.1

Supported Versions:

Other Versions:

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

  1. 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
  2. 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>
Copyright © 2011-2024 www.enmotech.com All rights reserved.