HomeMogDBMogDB StackUqbar
v2.0

Documentation:v2.0

Supported Versions:

Other Versions:

PTKC

Overview

PTKC is a database instance level operation and maintenance tool that PTK generates separately after deploying a database cluster. PTK generates a copy of PTKC under the operating system user running the database on each server.

PTKC does not rely on any metadata , rely entirely on the environment variables of operating environment and database static configuration files and other information to identify the cluster , so you can copy directly to any cluster instance to use , but also through the PTK independent generation :

ptk gen-ptkc

The tool is supported since PTK V0.8.

Supported Subcommands

  • start: Start the cluster or instance
  • stop: Stop the cluster or instance
  • restart: Restart the cluster or instance
  • build: Rebuild a specified instance
  • status: Show status of db instance or cluster
  • show-guc: Print database parameters
  • show-hba: Print pg_hba.conf content of database
  • failover: Promote a standby server to primary.
  • switchover: Promote a standby server to primary and demote primary server to standby

Comparison Among ptkc, gs_ctl, and gs_om

Function ptkc gs_ctl gs_om
Query the database status Support for cluster and instance Support for the local instance only Support for cluster and instance
Start a database Support for cluster and instance Support for the local instance only Support for cluster and instance
Stop a database Support for cluster and instance Support for the local instance only Support for cluster and instance
Restart a database Support for cluster and instance Support for the local instance only Support for cluster and instance
Rebuild a database Supported on the local and remote servers Support for the local instance only Supported on the local and remote servers
Specify an upstream node to rebuild a database Supported Supported Not supported
Failover Supported on the local and remote servers Support for the local instance only Not supported
Switchover Supported on the local and remote servers Support for the local instance only Not supported
Query database parameters Supported on the local and remote servers Not supported Not supported
View HBA information Supported on the local and remote servers Not supported Not supported

ptkc Usage

PTKC usage is kept consistent with PTK usage. PTK is a multi-cluster management tool and PTKC is a single-cluster O&M tool. Therefore, the PTKC instructions are more simple than those of PTK.

Note: PTKC itself does not store any metadata and completely depends on the existing status file to parse cluster information. Because the current status information does not include the system user information, PTKC does not support such scenarios as multiple nodes, multiple users, and multiple instances on a single server.

The following shows some examples. For more commands, run ptkc -h.

  • Query the Cluster Status

    ptkc status
  • Restart a Cluster

    ptkc restart
  • Perform Primary/Standby Switchover

    ptkc switchover -H <IP>
  • Query Database Parameters

    ptkc show-guc -k port
  • Show pg_hba.conf content

    ptkc show-hba
Copyright © 2011-2024 www.enmotech.com All rights reserved.