v2.0
- About PTK
- Quick Start
- Guidance
- Preparing Configuration File
- Checking the System
- Deploy Database Cluster
- Manage Clusters
- Show Cluster List
- Show Cluster Status
- Start Database
- Stop Database
- Restart Database
- Rebuild Database
- Switchover
- Failover
- Show Plugin Information
- Install Plugins
- Upgrade Database
- Scale-out Cluster
- Scale-in Cluster
- Show Database HBA
- Set Database HBA
- Show Database Parameters
- Set Database Parameters
- Show Cluster Topology Configuration
- Show Cluster Meta Information
- Update Cluster Comment
- Update Database IP
- Role Management
- Install CM
- Uninstall CM
- Manage Cluster VIP
- Install MogHA Service
- Uninstall MogHA Service
- Rename Cluster
- Create Empty Cluster
- Throw Out A Node
- Takeover A Node
- Manage Cluster
- Uninstall Database Cluster
- Collect OS Information
- Download MogDB Installer
- Encrypt Sensitive Information
- Upgrade PTK
- PTKC
- Compatible With Higher Versions of MogDB
- Reference
- Samples of Configuration Files
- Commands
- 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
- Troubleshooting
- FAQ
- Release Notes
- Community
- Appendix: YAML Syntax
Environment Variables
The PTK reads the values of some specific environment variables that affect the runtime logic.
You can use the ptk env
command to view all the environment variables supported by PTK and the corresponding values in effect.
If you want to see the value of a specific environment variable, you can use the ptk env <KEY>
command, for example:
- View the catalog of PTK metadata
ptk env PTK_HOME
List of supported environment variables
PTK reads the environment variables in the table below during runtime. You can change the behavior of PTK by modifying the environment variables with export
.
Environment Variable Name | Description | Note |
---|---|---|
PTK_HOME |
The root directory where PTK stores metadata, by default $HOME/.ptk . |
|
PTK_DATA_DIR |
The directory where PTK stores cluster metadata, by default $PTK_HOME/data . |
|
PTK_SSH_CONNECT_TIMEOUT |
The timeout for the executor to establish an SSH link with the target server, default is 1 minute. | In h(hour)/m(minute)/s(second), e.g. “2m20s”. |
PTK_CMD_EXECUTE_TIMEOUT |
Timeout for the executor to wait for a return from executing shell commands, default 10 minutes. | In h(hour)/m(minute)/s(second), e.g. “2m20s”. |
PTK_LOG_PATH |
The path to the file used to output the execution log. It can also be specified with the command line parameter --log-file . If this environment variable is set, it will be written to the log file in addition to the terminal output during the execution of PTK. By default, PTK itself will also record a log file in the $PTK_HOME/log directory during the runtime, which is not controlled by this environment variable. |
|
PTK_NO_CHECK_VERSION |
By default, PTK will check if there is a new version of PTK released when running a command. Set this environment variable to true to disable PTK version checking. |
|
PTK_NOT_LIMIT_CM_NODES |
PTK checks the number of CM nodes when deploying a MogDB database and deploying a CM cluster at the same time. when the number of CM nodes is greater than 3, by default, it forces to limit the deployment of only an odd number of CM server nodes to satisfy the majority election requirement, so when deploying a 4-node cluster, it will ask the user to select a node without deploying a CM server. the user can disable the restriction by setting the parameter to true . Of course, the same effect can also be achieved at installation time with the command line parameter --not-limit-cm-nodes . |
|
PTK_ENABLE_TIMEOUT_WHEN_BUILD_DB |
When PTK rebuilds a standby node with the build command, the timeout for executing the command is not set by default (i.e., PTK_CMD_EXECUTE_TIMEOUT does not take effect). This is because, in some high-volume data scenarios, executing a build can be very costly, and exiting after the timeout can result in the need to rebuild. If this parameter is set, PTK_CMD_EXECUTE_TIMEOUT will take effect. |