- 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
Configuration Samples
Simple Configuration of Single Instance on the Local Node
global:
cluster_name: cluster_1
user: omm
db_port: 26000
base_dir: /opt/mogdb
db_servers:
- host: 127.0.0.1
Customized Configuration of Single Instance on a Remote Node
global:
cluster_name: cluster_2
user: mogdb
db_port: 26000
# Edit the configuration file after the database password is encrypted. The encryption method is ptk encrypt <your_password>.
# The password needs to be a 8 to 16 string, including uppercase and lowercase letters, and special characters.
db_password: pTk6MTIxOGMxOTk8QT1CPT4+PXlnYW1DdHpXb2hCX3c3UW0wWXVkNlZwMGRCakpxRXd1WWdwQ0xDUWVrb0U=
base_dir: /opt/mogdb
# Customize the data directory.
data_dir: /data/mogdb_data
db_servers:
- host: "192.168.100.100" # Replace the IP address of the target machine.
# Customize the gs_initdb parameters.
gs_initdb_opts:
- --encoding=UTF-8
- --dbcompatibility=A
# Customize the parameters in postgresql.conf.
db_conf:
wal_level: logical
most_available_sync: on
ssh_option:
port: 22
user: root
# Enter a password or provide a key file.
password: "" # ptk encrypt <ssh_password>
key_file: ~/.ssh/id_rsa
Configuration of a Single Node with Multiple Instances
Deployment of a single server with multiple instances is used for individual test or learning only. In this deployment mode, multiple database instances in a cluster share the IP address, and therefore some PTK functions are limited.
For deployment of a single server with multiple instances, different database instances on the single server must be specified with different system users, ports, and installation directories. Different users can be used for isolating environment variables of instances.
The listening ports of different instances on a single server must be separated by at least 50 because the database depends on part ports for communication in a cluster.
global:
cluster_name: cluster_3
db_servers:
- host: 127.0.0.1
user: mogdb1
db_port: 26000
base_dir: /home/mogdb1
- host: 127.0.0.1
user: mogdb2
db_port: 27000
base_dir: /home/mogdb2
Configuration of One Primary Node, One Standby Node, and One Cascaded Standby Node
Different Servers with the Same SSH Configuration
global:
cluster_name: cluster_4
user: mogdb
db_port: 26000
base_dir: /opt/mogdb
# SSH information needs to be configued only in global configuration.
ssh_option:
port: 22
user: root
# Enter a password or provide a key file.
password: "" # ptk encrypt <ssh_password>
key_file: ~/.ssh/id_rsa
db_servers:
- host: 192.168.100.100
role: primary
- host: 192.168.100.101
role: standby
- host: 192.168.100.102
role: cascade_standby
Different Servers with Different SSH Configurations
global:
cluster_name: cluster_5
user: mogdb
db_port: 26000
base_dir: /opt/mogdb
db_servers:
- host: 192.168.100.100
role: primary
ssh_option:
port: 22
user: root
# Enter a password or provide a key file.
password: "" # ptk encrypt <ssh_password>
key_file: ~/.ssh/id_rsa
- host: 192.168.100.101
role: standby
ssh_option:
port: 22
user: root
# Enter a password or provide a key file.
password: "" # ptk encrypt <ssh_password>
key_file: ~/.ssh/id_rsa
- host: 192.168.100.102
role: standby
ssh_option:
port: 22
user: root
# Enter a password or provide a key file.
password: "" # ptk encrypt <ssh_password>
key_file: ~/.ssh/id_rsa
Configuration of Using a Jump Server for Database Servers that Cannot Be Connected Directly
ssh_option
in both global and db_servers configurations supports server connection using a jump server.
global:
cluster_name: cluster_6
user: mogdb
db_port: 26000
base_dir: /opt/mogdb
ssh_option:
port: 22
user: root
# Enter a password or provide a key file.
password: "" # ptk encrypt <ssh_password>
key_file: ~/.ssh/id_rsa
# This part describes configuration of jump server connection. The above describes the target server configuration.
proxy:
host: 192.168.200.100 # IP address of a jump server
port: 22
user: root
password: "" # ptk encrypt <proxy_ssh_password>
key_file: ~/.ssh/id_rsa
db_servers:
- host: 192.168.100.100
role: primary
- host: 192.168.100.101
role: standby
- host: 192.168.100.102
role: standby
Configuration of Resource Pooling Installation
global:
cluster_name: c1
user: omm
group: omm
db_password: pTk6Y2I1OWFiZjI8RT1FPUE9RFZfVTUzTy0zUlR5TDZUTmh1STE4VkQ0T2RDYXBNMThoSlNhZDY3UHB4WVE=
db_port: 26000
base_dir: /data/mogdb
cm_option:
dir: /data/mogdb/cm
cm_server_port: 15300
db_service_vip: ""
dss_option:
dir: /data/mogdb/dss
dss_port: 26010
dms_port: 26020
data_vg_name: data
data_vg_path: /dev/data_shared
inst_vg_map:
172.23.1.28: /dev/data_private_28
172.23.1.45: /dev/data_private_45
cm_share_vg_path: /dev/cm_shared
cm_voting_vg_path: /dev/cm_vote
enable_ssl: on
db_servers:
- host: 172.23.1.28
role: primary
- host: 172.23.1.45
role: standby
ssh_option:
port: 22
user: root
password: pTk6ZDJmZjZlZjI8RT1FPUE9RUs4WEh1OUJRQURfM29GUjZyb3gzZGU3LVRmLTM3Mm5ySmZ5anJXVkNOTUE=