diff --git a/product/en/docs-ptk/v0.5/config.md b/product/en/docs-ptk/v0.5/config.md index 7a62689ebb3310ef8b540bc1888ac9c17c865f1a..131551c1aa1975232245e8861996b47a8dde3b62 100644 --- a/product/en/docs-ptk/v0.5/config.md +++ b/product/en/docs-ptk/v0.5/config.md @@ -75,7 +75,7 @@ global: db_servers: - host: 10.1.1.100 # IP address of the database instance server (only supporting IPv4) db_port: 27000 # Database port - # IP addresses of the standby database servers (Note: it does not include the IP addresses of other nodes in the cluster) + # - name: db HA ip list example ha_ips: - 10.1.1.200 ha_port: 27001 # Log transfer port of primary/standby database instances diff --git a/product/en/docs-ptk/v0.5/usage/usage-help.md b/product/en/docs-ptk/v0.5/usage/usage-help.md index 499f4fe66ac9180d5516d4a5fce1d8e580ed40a8..e3d3901959814984ddf486a36db0daa572eaab25 100644 --- a/product/en/docs-ptk/v0.5/usage/usage-help.md +++ b/product/en/docs-ptk/v0.5/usage/usage-help.md @@ -56,7 +56,7 @@ You can run `ptk -v` to view PTK version. ```shell $ ptk -v -PTK Version: v0.5.0 +PTK Version: v0.4.0 Go Version: go1.17.1 Build Date: 2022-09-14T09:32:14Z Git Hash: a9xa9e diff --git a/product/en/docs-ptk/v0.6/config-samples.md b/product/en/docs-ptk/v0.6/config-samples.md new file mode 100644 index 0000000000000000000000000000000000000000..cd732f379b5ad404c6b2bc869d9bac281c56340e --- /dev/null +++ b/product/en/docs-ptk/v0.6/config-samples.md @@ -0,0 +1,172 @@ +--- +title: Configuration Examples +summary: Configuration Examples +author: Yao Qian +date: 2021-11-09 +--- + +# Configuration Examples + +## Simple Configuration of Single Instance on the Local Node + +```yaml +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 + +```yaml +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 . + # 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 + 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. + +```yaml +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 + +```yaml +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 + 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 + +```yaml +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 + 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 + 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 + 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. + +```yaml +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 + 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 + 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 +``` diff --git a/product/en/docs-ptk/v0.6/config.md b/product/en/docs-ptk/v0.6/config.md new file mode 100644 index 0000000000000000000000000000000000000000..923a0f8a09128184c776007c64854a6da9a9be7c --- /dev/null +++ b/product/en/docs-ptk/v0.6/config.md @@ -0,0 +1,658 @@ +--- +title: Configuration File +summary: Configuration File +author: Yao Qian +date: 2021-09-14 +--- + +# Configuration File + +The PTK configuration file is in the YAML format. + +This document introduces all configuration parameters required for cluster installation. + +To install a database cluster, you need to provide a configuration file used for describing the cluster topology. It will be used in most PTK subcommands. + +PTK provides an interactive way of creating a configuration file. You can run the following command to enter the interactive process. + +```shell +ptk template create +``` + +After finishing configuration according to the terminal prompts, a `config.yaml` file will generate in the current folder. + +Additionally, if you do not need to create a configuration file in the interactive way, run the following command to generate a default configuration file `config.yaml`. You need to configure parameters based on actual requirements. + +```shell +ptk template > config.yaml +``` + +When you do not create the configuration file in an interactive way, you are advised to encrypt the system user password, database password, SSH password, or key password by running the PTK encryption command before writing the password into the configuration file. + +```shell +ptk encrypt PASSWORD +``` + +--- + +## Configuration + +The following shows how to configure database cluster topology information. + +**Example**: + +- Simple configuration + +```yaml +# Cluster configuration information, in which db_port and ssh_option are reusable fields +global: + cluster_name: DefaultCluster # Cluster name that is the unique identifier of a cluster + db_password: pTk6MTIxOGMxOTk8QT1CPT4+PXlnYW1DdHpXb2hCX3c3UW0wWXVkNlZwMGRCakpxRXd1WWdwQ0xDUWVrb0U= # Initial database user password. If this password is not specified in the configuration file, it needs to be entered during database installation according to the terminal prompts. +# Configuration information of database instance servers in a cluster +db_servers: + - host: 10.1.1.100 # IP address of the database instance server (only supporting IPv4) + - host: 10.1.1.101 # IP address of the database instance server (only supporting IPv4) +# CM server list in a cluster +cm_servers: [] +``` + +- Complex configuration + +```yaml +# Cluster configuration information, in which db_port and ssh_option are reusable fields +global: + cluster_name: CustomCluster # Cluster name that is the unique identifier of a cluster + user: omm # System username for running a database + group: omm # System user group for running a database + db_password: pTk6MTIxOGMxOTk8QT1CPT4+PXlnYW1DdHpXb2hCX3c3UW0wWXVkNlZwMGRCakpxRXd1WWdwQ0xDUWVrb0U= # Initial database user password. If this password is not specified in the configuration file, it needs to be entered during database installation according to the terminal prompts. + base_dir: /opt/mogdb # Base directory of database installation. If it is not configured in app_dir, data_dir, log_dir, and tool_dir, PTK will create these directories in the current directory. + # MogDB HA component CM configuration information. If the CM component is not used, leave this field empty. + cm_option: + dir: /opt/mogdb/cm # CM installation directory + cm_server_port: 15300 # Listening port of the CM server + db_service_vip: "" # Virtual IP address for the database to provide service. +# Configuration information of database instance servers in a cluster +db_servers: + - host: 10.1.1.100 # IP address of the database instance server (only supporting IPv4) + db_port: 27000 # Database port + # description: | + ha_ips: + - 10.1.1.200 + ha_port: 27001 # Log replication port of primary/standby database instances. The value is fixed at a database port plus 1. + role: primary # Database instance role. If it is not specified, PTK will choose an instance randomly to make it a primary instance and the others will be standby instances. + az_name: BJ # AZ name + az_priority: 1 # AZ priority. The lower the value, the higher the priority. + # SSH login information. The login user should be root or a user who has the sudo permission. + ssh_option: + port: 22 # SSH login user + user: root # Password of the SSH login user + password: pTk6LIBsPVplOpmxQToCPT9+PXlnYW1DdHpXb2hCX3c3UW0wWXVkNlZwMGRCakpxRXd1WWdwQ0xDUWVrb0U= # SSH login key file path + conn_timeout: 5m0s # Timeout for performing a single command in SSH. The supported unit can be minute and second. + exec_timeout: 5m0s # Login information of a jump server. If the target server cannot be directly connected, a jump server can be used for connection. + - host: 10.1.1.101 # IP address of the database instance server (only supporting IPv4) + db_port: 27000 # Database port + # description: | + ha_ips: + - 10.1.1.201 + ha_port: 27001 # Log replication port of primary/standby database instances. The value is fixed at a database port plus 1. + role: standby # Database instance role. If it is not specified, PTK will choose an instance randomly to make it a primary instance and the others will be standby instances. + az_name: BJ # AZ name + az_priority: 1 # AZ priority. The lower the value, the higher the priority. + # SSH login information. The login user should be root or a user who has the sudo permission. + ssh_option: + port: 22 # SSH login user + user: root # Password of the SSH login user + key_file: ~/.ssh/id_rsa # SSH login key file password + conn_timeout: 5m0s # Timeout for performing a single command in SSH. The supported unit can be minute and second. + exec_timeout: 5m0s # Login information of a jump server. If the target server cannot be directly connected, a jump server can be used for connection. + - host: 10.1.1.102 # IP address of the database instance server (only supporting IPv4) + db_port: 27000 # Database port + # description: | + ha_ips: + - 10.1.1.202 + ha_port: 27001 # Log replication port of primary/standby database instances. The value is fixed at a database port plus 1. + role: cascade_standby # Database instance role. If it is not specified, PTK will choose an instance randomly to make it a primary instance and the others will be standby instances. + upstream_host: 10.1.1.101 # When the instance role is cascade_standby, this field indicates the IP address of the upstream standby server. + az_name: SH # AZ name + az_priority: 2 # AZ priority. The lower the value, the higher the priority. +# CM server list in a cluster +cm_servers: + - host: 10.1.1.100 # IP address of the CM server (only IPv4 is supported.) + port: 0 # Listening port of the CM server + role: "" + - host: 10.1.1.101 # IP address of the CM server (only IPv4 is supported.) + port: 25300 # Listening port of the CM server + role: "" +``` + +### Global + +**Data type**: Global + +**Description**: Cluster configuration information, in which `db_port` and `ssh_option` are **reusable fields**.

**Reusable fields** + +- If this field is set in instance-level configuration, the instance-level configuration prevails. +- If this field is not set in instance-level configuration, the global-level configuration prevails. + +**Added in**: v0.1 + +### db_servers + +**Data type**: DBServer + +**Description**: Configuration information of database instance servers in a cluster + +**Added in**: v0.1 + +### cm_servers + +**Data type**: []CMServer + +**Description**: CM server list in a cluster + +**Added in**: v0.5 + +--- + +## Global + +Global defines global parameters in a configuration file. + +Appears in: + +- Config.global + +### cluster_name + +**Data type**: String + +**Description**: Cluster name that is the unique identifier of a cluster + +**Added in**: v0.1 + +### user + +**Data type**: String + +**Description**: System username for running a database
The default value is **omm**. + +**Added in**: v0.1 + +### group + +**Data type**: String + +**Description**: System user group for running a database
The value is the same as the system username by default. + +**Added in**: v0.1 + +### user_password + +**Data type**: String + +**Description**: System user password for running a database
The value can be displayed in plain text and ciphertext. It is recommended that the value is encrypted by running `ptk encrypt`.
This field is left blank by default. + +**Added in**: v0.1 + +### db_password + +**Data type**: String + +**Description**: Initial database user password. If this password is not specified in the configuration file, it needs to be entered during database installation according to the terminal prompts.
The value can be displayed in plain text and ciphertext. It is recommended that the value is encrypted by running `ptk encrypt`. + +**Added in**: v0.1 + +### db_port + +**Data type**: Int + +**Description**: Database port
The default value is **26000**. + +**Added in**: v0.1 + +### base_dir + +**Data type**: String + +**Description**: Base directory of database installation. If it is not configured in app_dir, data_dir, log_dir, and tool_dir, PTK will create these directories in the current directory.
The default value is **/opt/mogdb**. + +**Added in**: v0.1 + +### app_dir + +**Data type**: String + +**Description**: Directory for storing database deployment file, startup script, and configuration file
The default value is **/opt/mogdb/app**. + +**Added in**: v0.1 + +### data_dir + +**Data type**: String + +**Description**: Data directory of a database
The default value is **/opt/mogdb/data**. + +**Added in**: v0.1 + +### log_dir + +**Data type**: String + +**Description**: Directory for storing database run logs and operation logs + +**Added in**: v0.1 + +### tool_dir + +**Data type**: String + +**Description**: Database tool directory
The default value is **/opt/mogdb/tool**. + +**Added in**: v0.1 + +### tmp_dir + +**Data type**: String + +**Description**: Temporary directory of a database + +**Default value**: If `base_dir` is not empty, this value is `$base_dir/tmp`. Otherwise, this value is `/tmp`. + +**Added in**: v0.1 + +### core_file_dir + +**Data type**: String + +**Description**: Directory for storing error log files when core dump occurs. After this field is configured, system configuration parameter `kernel.core_pattern` will be modified accordingly. + +This field is left blank by default. Unless the machine is used for only a database, the parameter is left blank. + +**Added in**: v0.1 + +### ssh_option + +**Data type**: SSHOption + +**Description**: SSH login information. The login user needs to be **root** or has sudo permission.
If this field is not configured. The database is installed on the local server where PTK is located. + +**Added in**: v0.1 + +### gs_initdb_opts + +**Data type**: []string + +**Description**: Used for the user to initialize the database.
If the user does not configure the `locale` parameter. PTK will automatically configure no-locale by default.
For details about the supported parameter list, see [gs_initdb](https://docs.mogdb.io/en/mogdb/v3.0/5-gs_initdb) + +**Example**: + +- gs_initdb options example + +```yaml +gs_initdb_opts: + - --locale=LOCALE + - -E=UTF-8 +``` + +**Added in**: v0.3 + +### cm_option + +**Data type**: CMOption + +**Description**: MogDB CM configuration information. If CM is not used, this field can be left blank.
This field takes effect in MogDB 3.0 or later. + +**Added in**: v0.4 + +## CMOption + +Appears in: + +- Global.cm_option + +### dir + +**Data type**: string + +**Description**: CM installation directory + +**Default value**: `$base_dir/cm` + +**Added in**: v0.4 + +### cm_server_port + +**Data type**: int + +**Description**: Listening port of the CM server + +**Default value**: `15300` + +**Added in**: v0.4 + +### db_service_vip + +**Data type**: string + +**Description**: Virtual IP address for the database to provide services + +**Added in**: v0.4 + +### cm_server_conf + +**Data type**: map[string]string + +**Description**: Configuration parameters supported in cm_server.conf. PTK does not verify the accuracy and validity of the parameter. + +**Example**: + +- cm server conf + +```yaml +cm_server_conf: + key: value +``` + +**Added in**: v0.4 + +### cm_agent_conf + +**Data type**: map[string]string + +**Description**: Configuration parameters supported in cm_agent.conf. PTK does not verify the accuracy and validity of the parameter. + +**Example**: + +- cm agent conf + +```yaml +cm_agent_conf: + key: value +``` + +**Added in**: v0.4 + +## CMServer + +CMServer configuration information + +Appears in: + +- Config.cm_servers + +### host + +**Data Type**: string + +**Description**: IP address of the CM server(only IPv4 is supported.) + +**Added in**: v0.5 + +### port + +**Data Type**: int + +**Description**: Listening port of the CM server
`global.cm_option.cm_server_port` is used by default. + +**Added in**: v0.5 + +### ssh_option + +**Data Type**: SSHOption + +**Description**: SSH login information. The login user must be **root** or a user who has the sudo permission.
If this parameter is not set, operation is performed locally. + +**Added in**: v0.5 + +## DBServer + +Configuration information of database instance servers in the DBServer cluster + +Appears in: + +- Config.db_servers + +### host + +**Data type**: String + +**Description**: IP address of the database instance server (only supporting IPv4) + +**Added in**: v0.1 + +### user + +**Data Type**: string + +**Description**: User name of the OS for running the database
If a primary node and a standby node are deployed on the same server, set thi field to a different user.
The configuration is the same as that of `global.user` by default. + +**Added in**: v0.5 + +### group + +**Data Type**: string + +**Description**: User group of the OS for running the database
The configuration is the same as that of `global.group` by default. + +**Added in**: v0.5 + +### user_password + +**Data Type**: string + +**Description**: User password of the OS for running the database
This field does not support a value in plain text. You need to encrypt it using `ptk encrypt`.
The configuration is the same as that of `global.user_password` by default. + +**Added in**: v0.5 + +### db_port + +**Data type**: Int + +**Description**: Database port
The field is left blank by default. The global port 26000 is reused. + +**Added in**: v0.1 + +### base_dir + +**Data Type**: string + +**Description**: Database installation directory. The value of `global.base_dir` is used by default.
If a cluster needs to be deployed on a single server, set different installation directories on different instances. Additionally, only installation directories can be set, and advanced settings, such as customization of `app_dir` and `data_dir`, are not supported.
**Default Value** : **/opt/mogdb** + +**Added in**: v0.5 + +### ha_ips + +**Data type**: String + +**Description**: IP addresses for log replication between the primary and standby database servers. By default, the value is the same as the listening address of the database.
+ +**Added in**: v0.1 + +### ha_port + +**Data type**: Int + +**Description**: Log replication port of primary/standby database instances
The value is fixed at a database port plus 1. + +**Added in**: v0.1 + +### role + +**Data type**: String + +**Description**: Database instance role. If it is not specified, PTK will choose an instance randomly to make it a primary instance and the others will be standby instances. + +**Optional values**: + +- primary +- standby +- cascade_standby + +**Added in**: v0.1 + +### upstream_host + +**Data type**: String + +**Description**: When the instance role is cascade_standby, this field indicates the IP address of the upstream standby server. + +**Added in**: v0.1 + +### az_name + +**Data type**: String + +**Description**: AZ name
The default value is **AZ1**. + +**Added in**: v0.1 + +### az_priority + +**Data type**: Int + +**Description**: AZ priority. The lower the value, the higher the priority.
The default value is **1**. + +**Added in**: v0.1 + +### xlog_dir + +**Data type**: String + +**Description**: Directory for storing database Xlog
This field is left blank by default. If this field is configured, the value cannot be the subdirectory of the data directory. + +**Added in**: v0.1 + +### db_conf + +**Data type**: map[string]string + +**Description**: You can configure the database parameters as you need. This field configuration information will be written into the postgresql.conf file before the database is started. + +**Example**: + +- Database configuration example + +```yaml +db_conf: + key: value +``` + +**Added in**: v0.1 + +### ssh_option + +**Data type**: SSHOption + +**Description**: SSH login information. The login user needs to be **root** or has sudo permission.
If this field is not configured. The database is installed on the local server where PTK is located. + +**Added in**: v0.1 + +--- + +## SSHOption + +SSHOption SSH login supports password and key authentication. You need to choose at least one. + +Appears in: + +- Global.ssh_option +- DBServer.ssh_option +- SSHOption.proxy + +**Example**: + +```yaml +host: 10.1.1.100 +port: 22 +user: root +key_file: ~/.ssh/id_rsa +``` + +### host + +**Data type**: String + +**Description**: IP address of the target server to be connected
This field is mandatory when the host works as a jump server.
When the server has the database installed, this field can be left blank. The IP address of db_server will be used.
This field is left blank by default. + +**Added in**: v0.1 + +### port + +**Data type**: Int + +**Description**: SSH service port
The default value is **22**. + +**Added in**: v0.1 + +### user + +**Data type**: String + +**Description**: SSH login user
The default value is **root**. + +**Added in**: v0.1 + +### password + +**Data type**: String + +**Description**: SSH login user password
The value can be displayed in plain text and ciphertext. It is recommended that the value is encrypted by running `ptk encrypt`. + +**Example**: + +- SSH password example + +```yaml +password: pTk6MTIxOGMxOTk8QT1CPT4+PXlnYW1DdHpXb2hCX3c3UW0wWXVkNlZwMGRCakpxRXd1WWdwQ0xDUWVrb0U= +``` + +**Added in**: v0.1 + +### key_file + +**Data type**: String + +**Description**: Directory for storing SSH login key files
This field is left blank by default. + +**Example**: + +- SSH key file example + +```yaml +key_file: ~/.ssh/id_rsa +``` + +**Added in**: v0.1 + +### passphrase + +**Data type**: String + +**Description**: SSH login key file password
The value can be displayed in plain text and ciphertext. It is recommended that the value is encrypted by running `ptk encrypt`.
This field is left blank by default. + +**Added in**: v0.1 + +### conn_timeout + +**Data type**: Duration + +**Description**: SSH login connection timeout duration. The value unit can be minute or second.
The default value is **1m**. + +**Added in**: v0.1 + +### exec_timeout + +**Data type**: Duration + +**Description**: Timeout duration for executing a single command in SSH mode
The supported unit can be minute and second.
+The default value is **10m**. + +**Added in**: v0.1 + +### proxy + +**Data type**: SSHOption + +**Description**: Jump server login information. If the target server cannot be connected directly, you can use a jump server for connection. q + +**Added in**: v0.1 diff --git a/product/en/docs-ptk/v0.6/debug.md b/product/en/docs-ptk/v0.6/debug.md new file mode 100644 index 0000000000000000000000000000000000000000..1e92a6af4fa45f70e002467193bc18daf0f53820 --- /dev/null +++ b/product/en/docs-ptk/v0.6/debug.md @@ -0,0 +1,36 @@ +--- +title: Troubleshooting +summary: Troubleshooting +author: Yao Qian +date: 2022-05-30 +--- + +## Troubleshooting + +### Error Code Starting with 40xx + +Error code starting with 40XX, such as `PTK-4030` indicates that data in the configuration file is incorrect. You need to modify related information according to the prompt information in the error code and then run the command. + +### Error Code Starting with 50xxx + +Error code starting with 50XX, such as `PTK-50000` indicates that the error occurs during PTK running. + +The specific categories are as follows. + +```wiki +- 500XX Program error or unknown error +- 501XX Cluster and metadata error +- 502XX File or folder error +- 503XX System user or group error +- 504XX Disk error +- 505XX Memory error +- 506XX Network error +- 507XX Firewall error +- 508XX Other system error +- 509XX gs_ctl operation error +- 510XX Environment variable error +``` + +You can query the related system or running parameters as required. + +If a program crashes or there are bugs, report them to PTK developers for fixing or upgrade. \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/faq.md b/product/en/docs-ptk/v0.6/faq.md new file mode 100644 index 0000000000000000000000000000000000000000..c5f10371b4e1c6e74cd60e9c3b2d457a03db0446 --- /dev/null +++ b/product/en/docs-ptk/v0.6/faq.md @@ -0,0 +1,120 @@ +--- +title: FAQs +summary: FAQ +author: Yao Qian +date: 2022-05-30 +--- + +## FAQs + +### Does PTK Support Installation Using a Non-Root User? + +Yes. The following two points need to be considered. + +1. If PTK is independently deployed on a management server, and the database is remotely installed using SSH, PTK can be installed under any user. +2. If PTK and the database instances are deployed on the same server, and PTK is owned by a common user, the PTK user needs to have the sudo permission because the database deployed using PTK depends on the sudo permission. + +### Does a Database Support Installation and Management by a Non-Root SSH User? + +Yes. The condition is that the SSH user needs to have the sudo permission. + +Configuration method of sudo permission: + +Add the following content to the `/etc/sudoers` file on the target server. + +> Make sure that the content is not followed by any other rules, avoiding being overwritten. + +``` +username ALL=(ALL) NOPASSWD:ALL +``` + +### What Can I Do If the Database Initialization Error "undefined symbol: EVP_KDF_ctrl" Is Reported? + +The installation package is not matched with the host OS. This error typically occurs in the scenario where a CentOS 7 installation package is installed on a system with the high glibc version. + +The solution is to replace the installation package with an openEuler package. + +### What Can I Do If the Error "can not combine with 'abrt-hook-ccpp'" Is Reported? + +You can use the abrt(automatic bug report too) service agent to dump the core file. This may lead to core file loss or database downtime. + +*[What is the abrt service](https://abrt.readthedocs.io/en/latest/howitworks.html)* + +You can fix this bug by modifying the `kernel.core_pattern` parameter. + +```shell +# The value can be customized based on the actual requirement. +sysctl -w kernel.core_pattern=/var/log/coredump/%e.%p.%u.%t.core +``` + +### Do I Need to Pre-Install Python3? + +Yes. + +Python 3.6 or Python 3.7 needs to be pre-installed because the psutil (python system and process utilities) dynamic library in the OM package supports only this two versions. + +> PTK and MogDB themselves do not depend on Python3 but gs_om and gs_guc do. Therefore, Python needs to be pre-installed to make sure that the environment meets the requirement. + +### Can I Install a Database on an Operating System that Is Not Supported by PTK? + +Yes. + +PTK itself provides a completed and general installation process. It automatically judges the database installation package to be downloaded based on the customer system by default. However, PTK cannot determine the installation package that is really needed when the operating system or operating system version is not supported by PTK. In this case, you can use the `-p` parameter in the `ptk install` command to specify an installation package. In view of the fact that the installation is not tested, it may fail. This is normal. + +When you try to choose an installation package to adapt to your system, you can comply with the following rules: + +1. Make judgment based on the CPU command set architecture. + + ```shell + uname -m + ``` + + For `arm64/aarch64`, use the openEuler arm64 installation package. + + For `x86_64`, perform the following operation make judgment. + +2. Make judgment based on the glibc version. + + ```shell + getconf GNU_LIBC_VERSION + ``` + + If the glibc version is 2.17 or earlier than 2.17, use the centos7 x86_64 installation package. Otherwise, use the openEuler x86_64 installation package. + +### Is gs_om Still Supported After a Database Is Installed Using PTK? + +Yes. + +The cluster installed using PTK is compatible with gs_om. After the database is installed, gs_om dependent static files generate automatically. + +> **Note**: `gs_om` needs user SSH mutual-trust between nodes. After the database is installed using PTK, user SSH mutual-trust is generally established. If it is not established, you need to manually perform the establishment. + +### What Should I Do If the Error `FATAL: semctl(578486307, 7, SETVAL, 0) failed: Invalid argument` Is Reported? + +You can check whether the value of `RemoveIPC` in the `/etc/systemd/logind.conf` directory is `no`. If it is, restart the server. + +### How Can I Query the MogDB Versions Supported by PTK? + +You can run the `ptk candidate db` command to query the MogDB versions supported by PTK. + +### How Can I Query the Operating Systems Supported by PTK? + +You can run the `ptk candidate os` command to query the operating systems supported by PTK. + +### Can the CM Component Be Installed? + +Yes. + +> **Note**: To use CM, at least 3 instances are required. + +`ptk install` supports the `--install-cm` parameter. When this parameter is specified, and all nodes in a cluster are initialized, cm_ctl can be used to start the cluster (if CM is not installed, use gs_ctl to start the cluster). During the starting, the primary instance needs to be chosen and the primary/standby building process is required. Therefore, the starting time is relatively long. + +If the command times out during the PTK starting, you can log in to the database server to check the cluster status. In the starting phase, exit of PTK does not interrupt the execution of cm_ctl. + +### Should PTK and the Database Be Installed on the Same Server? + +No. + +PTK is designed as a controller. PTK is able to manage multiple database clusters, therefore it is recommended that PTK is installed on a management server independently and the database is installed on a database-dedicated server in the cluster. + +Certainly, PTK supports installation on the same server as the database. This is called local installation. \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/gptk/gptk-installation.md b/product/en/docs-ptk/v0.6/gptk/gptk-installation.md new file mode 100644 index 0000000000000000000000000000000000000000..f70e705c7ea3497c70ea81383e541abc0e8d505c --- /dev/null +++ b/product/en/docs-ptk/v0.6/gptk/gptk-installation.md @@ -0,0 +1,105 @@ +--- +title: GPTK Installation +summary: GPTK Installation +author: Yao Qian +date: 2023-01-17 +--- + +# GPTK Installation + +Different releases and OSs use different installation packages. You need to choose a package based on your environment. + +## Windows + +### Download + +- [gptk-0.1.0-x86_64-Setup.exe](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-x86_64-Setup.exe) + +### Installation + +After the package is downloaded, double click `gptk-0.1.0-x86_64-Setup.exe`. + +1. Click **Next**. + + ![windows-installation-1.png](https://cdn-mogdb.enmotech.com/gptk/static/v0.1.0/windows-installation-1.png) + +2. If you need to modify the installation package path, click **Browse** to modify it, and then click **Install**. + + ![windows-installation-2.png](https://cdn-mogdb.enmotech.com/gptk/static/v0.1.0/windows-installation-2.png) + +## macOS + +### Download + +**x86_64** + +- [gptk-0.1.0-x86_64.dmg](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-x86_64.dmg) + +**apple m1** + +- [gptk-0.1.0-arm64.dmg](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-arm64.dmg) + +### Installation + +Double click the downloaded package. + +1. Drag the **gptk.app** file to the **Applications** folder. + + ![macOS-installation-1.png](https://cdn-mogdb.enmotech.com/gptk/static/v0.1.0/macOS-installation-1.png) + +## Debian + +### Download + +**x86_64** + +- [gptk-0.1.0-x86_64.deb](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-x86_64.deb) + +**arm64** + +- [gptk-0.1.0-arm64.deb](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-arm64.deb) + +### Installation + +Use the DEB installation package for installation. + +1. Run `sudo dpkg -i gptk--.deb` in the terminal to perform installation. +2. Run `gptk &` to start GPTK. + +## RPM Package + +### Download + +**x86_64** + +- [gptk-0.1.0-x86_64.rpm](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-x86_64.rpm) + +**arm64** + +- [gptk-0.1.0-arm64.rpm](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-arm64.rpm) + +### Installation + +Use the RPM package for installation. + +1. Run `sudo rpm -ivh gptk--.rpm` in the terminal to perform installation. +2. Run `gptk &` to start GPTK. + +## pacman Package + +### Download + +**x86_64** + +- [gptk-0.1.0-x86_64.pacman](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-x86_64.pacman) + +**arm64** + +- [gptk-0.1.0-arm64.pacman](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-arm64.pacman) + +### Installation + +Use the pacman package for installation. + +1. Run `sudo pacman -S gptk--.pacman` in the terminal to perform installation. +2. Run `gptk &` to start GPTK. diff --git a/product/en/docs-ptk/v0.6/gptk/gptk-releases.md b/product/en/docs-ptk/v0.6/gptk/gptk-releases.md new file mode 100644 index 0000000000000000000000000000000000000000..09e5ffff89fe55d647dfe63e280a65487e5d50e6 --- /dev/null +++ b/product/en/docs-ptk/v0.6/gptk/gptk-releases.md @@ -0,0 +1,17 @@ +--- +title: GPTK Release Note +summary: GPTK Release Note +author: Yao Qian +date: 2023-01-18 +--- + +# Release Note + +## 0.1.0 (2023.1.18) + +### Function and Feature + +- Support deployment of a database cluster. +- Support the database cluster list. +- Support query of the startup and stopping status of a database cluster. +- Support Chinese and English interface language. diff --git a/product/en/docs-ptk/v0.6/gptk/gptk-usage.md b/product/en/docs-ptk/v0.6/gptk/gptk-usage.md new file mode 100644 index 0000000000000000000000000000000000000000..5360198335185d831b4497f5c774b535f3cea0a6 --- /dev/null +++ b/product/en/docs-ptk/v0.6/gptk/gptk-usage.md @@ -0,0 +1,60 @@ +--- +title: GPTK Usage +summary: GPTK Usage +author: Yao Qian +date: 2023-01-17 +--- + +# Usage + +## Database Cluster Deployment + +If there is no cluster managed in GPTK, the home page is displayed as follows. You can click **Install Cluster** to start deployment. + +![usage-1.png](https://cdn-mogdb.enmotech.com/gptk/static/v0.1.0/usage-1.png) + +**Control Item** + +On the **Control Item** page, the control parameters used for deployment are positioned on the top. They are optional. + +![usage-control-items.png](https://cdn-mogdb.enmotech.com/gptk/static/v0.1.0/usage-control-items.png) + +> If you choose to use a YAML configuration file for creation, the server configuration information will not be displayed. You can click **Browse YAML File** to check whether the information is correct. + +**Database Cluster Info** + +Edit the cluster information. + +This section takes a primary node and a standby node as an example. + +![usage-form.png](https://cdn-mogdb.enmotech.com/gptk/static/v0.1.0/usage-form.png) + +After cluster configuration is finished, read the software license agreements, select it, and then perform the follow-up operations. + +**Precheck** + +The precheck operation is similar to the `checkos` function in PTK. You need to make sure that the precheck is successful before deployment. If the precheck fails, you need to fix it on the target server according to the error information, or use PTK to fix it. + +**Deployment Confirmation** + +After the precheck is successful, click **Confirm Deployment**. + +The system automatically displays a list in which the deployment status is deploying. The system periodically refreshes the status. Once the installation is successful, the status is changed to success. Later you can operate a cluster. + +![usage-list.png](https://cdn-mogdb.enmotech.com/gptk/static/v0.1.0/usage-list.png) + +## Database Cluster Details + +After the installation is successful, click the cluster name to enter the **Cluster Details** page. + +![usage-cluster-detail.png](https://cdn-mogdb.enmotech.com/gptk/static/v0.1.0/usage-cluster-detail.png) + +The **Cluster Details** page displays the cluster version, status, instance status, and cluster configuration file information. + +You can start or uninstall a cluster or instance on the current page. + +## Setting + +### Interface Language + +Click ⚙️in the lower left corner, and click **Preference Settings** to set the interface language. \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/install.md b/product/en/docs-ptk/v0.6/install.md new file mode 100644 index 0000000000000000000000000000000000000000..45408d25b3feb1cc8ce772a1f1c9b771e647c810 --- /dev/null +++ b/product/en/docs-ptk/v0.6/install.md @@ -0,0 +1,50 @@ +--- +title: Installation +summary: Installation +author: Yao Qian +date: 2022-05-30 +--- + +## Installation + +PTK is a provisioning toolkit. It does not need to be installed on the same server together with a database instance. It is recommended that a management server is used to install PTK and deploy database instances on other servers. + +### Online Installation + +> **Note**: Command line installation does not support PTK installed on Windows. + +You can run the following command to install PTK on macOS or Linux operating systems. + +```shell +curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install.sh | sh +``` + +After running the command, PTK is automatically installed in the `$HOME/.ptk` directory where cache files, data files, cluster configuration files, and backup files are stored. Additionally, the `$HOME/.ptk/bin` directory will be automatically updated to the environment variable of the corresponding Shell profile file. After login, you can run the ptk-related commands. + +### Offline Installation + +If the server where PTK is to be installed cannot be connected to the external network or you need to install PTK on Windows, you can manually install PTK. + +Perform the following operations to install PTK manually: + +**Step 1** Download the installation package corresponding to your server. The following lists installation packages of the latest versions corresponding to different system architectures. + +- MacOS ARM64: [ptk_darwin_arm64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_darwin_arm64.tar.gz) +- MacOS X86: [ptk_darwin_x86_64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_darwin_x86_64.tar.gz) +- Linux ARM64: [ptk_linux_arm64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_linux_arm64.tar.gz) +- Linux X86: [ptk_linux_x86_64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_linux_x86_64.tar.gz) +- Windows X86: [ptk_windows_x86_64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_windows_x86_64.tar.gz) + +**Step 2** Copy the installation package to the target server on the intranet. + +**Step 3** Decompress the package to obtain a binary file named `ptk` (executable file of PTK) and move the file to a directory (`$HOME/.ptk/bin/` is recommended and it needs to be manually created) as you need. Update the directory to the PTK PATH environment variable. + +### PTK Upgrade + +For offline installation, download the latest installation package to cover the binary file on the server to upgrade PTK. + +For online installation, run the following command to upgrade PTK. + +```shell +ptk self upgrade +``` \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/overview.md b/product/en/docs-ptk/v0.6/overview.md new file mode 100644 index 0000000000000000000000000000000000000000..70b4d14033697054451f37d6661e2a22a7cff84e --- /dev/null +++ b/product/en/docs-ptk/v0.6/overview.md @@ -0,0 +1,68 @@ +--- +title: PTK Overview +summary: PTK Overview +author: Yao Qian +date: 2022-05-30 +--- + +## PTK Overview + +PTK (Provisioning Toolkit) is an installation and operation and maintenance tool for MogDB. It aims at quick installation of MogDB. + +If you need to run MogDB or its related components, only one command needs to be run. + +## Application Scenarios + +- Developers need to quickly enable multiple local MogDB processes. +- Users need to install MogDB quickly using PTK. +- Daily operation and maintenance by DBAs +- A third-party operation and maintenance platform needs to be integrated. + +## Recommended Deployment Architecture + +PTK is multi-cluster management software. As a centrally-controlling machine, it manages multiple database clusters remotely using SSH. Therefore, it is recommended that PTK is independently deployed a control server and the database is another server, as shown in the following figure. Certainly, PTK can be also deployed on the local server where the database is located. You can choose either of the deployment methods as required. + +``` + +-----------+ + | PTK | + +-----------+ + /---ssh-----/ | \---ssh----\ + / ssh \ + / | \ + +-----------+ +-----------+ +-----------+ + | MogDB | | MogDB | | MogDB | + +-----------+ +-----------+ +-----------+ +``` + +## Operating Systems Supported by PTK for Installing MogDB + +You can run `ptk candidate os` to check the latest OSs supported. + +| ID | OS | Tested Version | +| ------- | ----------------------------------- | ------------------------- | +| 1007010 | CentOS Linux 7 (Core) (x86_64) | 7.6.1810 (Core) | +| 1008010 | Centos 8 (x86_64) | 8.0.1905 (Core) | +| 1008020 | Centos 8 (arm64) | 8.0.1905 (Core) | +| 1120010 | openEuler 20 (x86_64) | 20.03 LTS | +| 1120020 | openEuler 20 (arm64) | 20.03 LTS | +| 1122010 | openEuler 22 (x86_64) | 22.03 LTS | +| 1122020 | openEuler 22 (arm64) | 22.03 LTS | +| 1210010 | Kylin V10 (x86_64) | V10 (Tercel) | +| 1210020 | Kylin V10 (arm64) | V10 (Tercel) | +| 1320010 | UOS 20 A (x86_64) | 1002a/1020a/1050a | +| 1320020 | UOS 20 A (arm64) | 1050a (kongzi) | +| 1420010 | UOS 20 D/E (x86_64) | 1040d (fou) | +| 1420020 | UOS 20 D/E (arm64) | 1040d (fou) | +| 1520010 | Ubuntu 20 (x86_64) | 20.04.3 LTS (Focal Fossa) | +| 1522010 | Ubuntu 22 (x86_64) | 22.04 (Jammy Jellyfish) | +| 1607010 | Red Hat Enterprise Linux 7 (x86_64) | 7.5 (Maipo) | +| 1608010 | Red Hat Enterprise Linux 8 (x86_64) | 8.5 (Ootpa) | +| 1702010 | EulerOS 2 (x86_64) | 2.0 (SP3) | +| 1702020 | EulerOS 2 (arm64) | 2.0 (SP3) | +| 1812010 | SLES 12SP5 (x86_64) | 12SP5 | +| 1907010 | Oracle Linux 7 (x86_64) | 7.9 (Maipo) | +| 1908010 | Oracle Linux 8 (x86_64) | 8.6 (Ootpa) | +| 2008010 | Rocky Linux 8 (x86_64) | 8.5 (Green Obsidian) | +| 2107010 | NeoKylin V7 (x86_64) | V7Update6 | +| 2222010 | FusionOS 22 (x86_64) | 22.0.2 | +| 2222020 | FusionOS 22 (arm64) | 22.0.2 | \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/quick-start.md b/product/en/docs-ptk/v0.6/quick-start.md new file mode 100644 index 0000000000000000000000000000000000000000..88061aeb5d5d05850df612add30ab59b84356d21 --- /dev/null +++ b/product/en/docs-ptk/v0.6/quick-start.md @@ -0,0 +1,206 @@ +--- +title: Quick Start +summary: Quick Start +author: Yao Qian +date: 2022-06-02 +--- + +## Quick Start + +This document introduces two methods of quickly installing MogDB using PTK. + +> **Note**: PTK can run on multiple operating systems, such as Linux, macOS, and Windows. MogDB can be run on only Linux operating systems, and therefore make sure that a server on which MogDB is installed must run on a Linux operating system. For details about Linux OS types and versions, see [Operating Systems Supported by PTK for Installing MogDB](./overview.md#Operating Systems Supported by PTK for Installing MogDB). + +## PTK Download and Installation + +Run the following command to install PTK. + +```shell +curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install.sh | sh +``` + +Information similar to the following is displayed (the information varies depending on the type of Shell for running PTK). + +``` +info: downloading ptk package +Detected shell: bash +Shell profile: /root/.bash_profile +ptk has been added to PATH in /root/.bash_profile +open a new terminal or source /root/.bash_profile to active it +Installed path: /root/.ptk/bin/ptk +``` + +Run the source command or open a terminal to make PTK environment variables take effect. + +If the output information is similar to the above, PTK has its path added to the PATH environment variable in the `/root/.bash_profile` file. + +> **Note**: ~/.bash_profile varies depends on different operating systems. You can query the installation log to check which file needs to be activated. + +For example, use bash as an example. + +```shell +source $HOME/.bash_profile +``` + +## Method 1 Single Server Without Being Configured for Database Test + +> This method supports only installation on local Linux servers. + +### 1. Run the demo Command + +Before running this command, make sure that port 26000 is available. If you need to user other ports, use `--port ` to specify the port. + +If you use the default port, run the following command: + +```shell +ptk demo +``` + +After this command is run, a random user with the prefix of `demo_user_` will be created as the database user, and the database instances and data will be stored in the root directory of the user. + +After PTK is installed, PTK will install plugins supported by all databases for tests. + +**Summary example after PTK installation** + +Demo summary: + +Database: + +| cluster_name | host | user | port | status | message | +| ------------ | ----------- | -------------- | ----- | ------------- | ------- | +| demo_gJyY | 192.168.1.1 | demo_user_gJyY | 26000 | start_success | success | + +Other database details: + +| item | value | +| ----------- | ------------------------------ | +| db password | Demo@pwd_gJyY | +| base_dir | /home/demo_user_gJyY/demo | +| app_dir | /home/demo_user_gJyY/demo/app | +| data_dir | /home/demo_user_gJyY/demo/data | +| tool_dir | /home/demo_user_gJyY/demo/tool | +| tmp_dir | /home/demo_user_gJyY/demo/tmp | + +Mode compatibility information: + +| mode_name | database | plugins_info | other_info | +| --------- | ---------------------- | ------------------------------------------------------------ | ------------------------------------------------------- | +| PG | postgres_compatibility | none | | +| A | oracle_compatibility | plugin:whale, status:success, ref:
plugin:orafce, status:success, ref:
plugin:compat_tools, status:success, ref:
plugin:mogila, status:success, ref: |


create user: mogdb, password: Demo@pwd_gJyY | + +### 2. Access MogDB + +Take the `demo_user_gJyY` user as an example. + +``` +su - demo_user_gJyY +gsql -r +``` + +## Method 2 Database Installed Using a Configuration File + +> This method supports both local and remote installation. + +### Prepare a Configuration File + +PTK installation requires a **config.yaml** configuration file provided by users. This configuration file can be generated by running ptk template. If local installation is required, run the following command: + +```bash +ptk template --local > config.yaml +``` + +The configuration file content is as follows: + +```yaml +# config.yaml +global: + # # cluster name (required) + cluster_name: "cluster_etalatint" + # # system user for running db + user: "omm" + # # system user group, same as username if not given + group: "omm" + # # base directory for install MogDB server, + # # if any of app_dir, data_dir, log_dir and tool_dir not config, + # # PTK will create corresponding directory under base_dir + base_dir: "/opt/mogdb" + +db_servers: + - host: "127.0.0.1" + # # database port + db_port: 26000 +``` + +If default settings are used in the configuration file, PTK will perform the following operations: + +* MogDB is installed on the local server. +* The operating system user for running the database is omm, the user group name is omm, and the user does not have a default password. +* The database is installed in the **/opt/mogdb** directory where four directories **app**, **data**, **log**, and **tool** will be created for storing database software, data files, database logs, and database-related tools. +* The listening port of the database is 26000. + +If MogDB needs to be installed on other servers or primary/standby MogDB is to be installed, [more configuration information](./config.md) needs to be added to **config.yaml**. For details, see [Usage](./usage-config.md). + +Configuration example for one primary node and one standby node + +```yaml +# config.yaml +global: + cluster_name: mogdb_cluster1 + user: omm + group: omm + base_dir: /opt/mogdb +db_servers: + - host: 192.168.0.1 + db_port: 26000 + role: primary + ssh_option: + port: 22 + user: root + password: [Enter the SSH login password] + - host: 192.168.0.2 + db_port: 26000 + role: standby + ssh_option: + port: 22 + user: root + password: [Enter the SSH login password] +``` + +### Perform System Check on the Local Server + +```shell +ptk checkos -f config.yaml +``` + +Make sure the check result includes `OK` or `Warning`. + +If `Abnormal` occurs, PTK will generates a shell script with the prefix of **root_fix_os** automatically by default. You can try to fix the abnormal check item by executing the shell script. + +In most cases, it can be fixed. If it persists, you need to manually fix it based on the log. + +### Install MogDB + +```shell +ptk install -f config.yaml +``` + +The MogDB of the latest version will be installed by default. You can check the version from the download page of the official website. During the installation, you will be prompted to enter the initial password of the database user, and make sure that you take a note of the password. After automatic installation of MogDB using PTK, the database instance will be started. + +PTK supports customization of the installation package and manual downloading of the installation package. For example, run the following command to install MogDB using the installation package in the current directory: + +```shell +ptk install -f config.yaml --pkg ./MogDB-3.0.0-openEuler-arm64.tar.gz +``` + +After successful installation, you can check the instance information by running the `ptk ls` command. + +### Access MogDB + +```bash +su - omm +gsql -r +``` + +## Related Page + +The above example provides the simplest configuration file, thereby facilitating quick experience of MogDB. For more configuration information, see [Configuration File](./config.md). \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/release.md b/product/en/docs-ptk/v0.6/release.md new file mode 100644 index 0000000000000000000000000000000000000000..a4637f023370524f49ec7955a1575b965fbe45d1 --- /dev/null +++ b/product/en/docs-ptk/v0.6/release.md @@ -0,0 +1,126 @@ +--- +title: Release Note +summary: Release Note +author: Yao Qian +date: 2022-06-01 +--- + +## PTK of the Latest Version + +> The PTK of the revised version will be released aperiodically based on user feedback. It is recommended that users download the latest version for use. + +- MacOS ARM64: [ptk_darwin_arm64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_darwin_arm64.tar.gz) +- MacOS X86: [ptk_darwin_x86_64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_darwin_x86_64.tar.gz) +- Linux ARM64: [ptk_linux_arm64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_linux_arm64.tar.gz) +- Linux X86: [ptk_linux_x86_64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_linux_x86_64.tar.gz) +- Windows X86: [ptk_windows_x86_64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_windows_x86_64.tar.gz) + +## Release Note + +### v0.6 + +#### New Function + +- Support installation of MogDB 3.1 and plugins. +- Add the demo command for quick deployment of MogDB locally and attached with most plugins. +- Add the build subcommand to a cluster and support rebuilding of a specified database. +- Add the meta command. +- Add the selinux check item (A18) to the OS check. + +#### Function Optimization and Bug Fixing + +- Optimize the system parameter check to support generation of a recommended script for permanently disabling THP. +- Optimize MogHA installation by adding configuration file verification and supporting installation by mode. +- Optimize scale-in and scale-out operations in different scenarios. +- Add the mutually exclusive lock on cluster write operations. +- Optimize the cluster status query to support the query in the scenario where the server with instances deployed cannot be connected. +- Optimize the CM-related cluster operations. +- Fix some known bugs. + +### v0.5 + +#### New Function + +- Support installation of MogDB-3.0.3 and Uqbar-1.1.0. +- Support deployment of multiple instances on a single node. +- Support online scale-out and scale-in using the CM component. +- Add the ptk exec command. +- Add the log function of metadata. +- Add a built-in pssh module and make it decoupled from om. + +#### Function Optimization and Bug Fixing + +- Optimize the scale-in and scale-out process. +- Optimize the installation process. +- Optimize the symbol interruption processing. +- Fix some known bugs. + +### v0.4 + +#### New Function + +- Add the failover/switchover function. +- Add the show-hba/show-guc/show-config function so that users can query the cluster configuration information conveniently. +- Add the MogHA installation function. +- Add the shell command that can make the shell command or the script run quickly. +- Add the refresh command so that users can update cluster configurations conveniently. Currently, the IP address modification function is available. +- Add the register command that allows users to register the system type. +- Add the CPU command to allow users to check the CPU architectures supported by PTK. +- Add the copy mode in cluster scale-out. +- Support the operation (start, stop, and query) on all the clusters. +- Support installation of CM two-node in MogDB 3.0.1 or later. +- Support Phytium CPU check. +- Be compatible with openGauss installation. + +#### Function Optimization and Bug Fixing + +- Optimize that check and processing of the interrupt signal in execution. +- Offer suggestions once an error occurs due to insufficient semaphore. +- Fix the issue that CM fails to start because the AZ priority configuration is incorrect. +- Fix other known issues. + +### v0.3 + +#### New Function + +- Support scale-in. +- Support extension installation. +- Automatically fix the dynamic library dependency based on the environment. +- Add the version to the cluster list result. +- Add the MD5 verification of an installation package. +- Support the download command. +- Add the cluster comment function. + +#### Function Optimization and Bug Fixing + +- Fix the network check error when there is an IB NIC. +- Fix the SUSE script error. +- Fix other known issues. + +### v0.2 + +#### New Function + +- Add the candidate command. +- Support CM installation. +- Generate a fix script of the system check automatically. +- Add the default configuration of recommended database parameters. + +#### Bug Fixing + +- Optimize the installation process. +- Fix the multi-check item problem in OS check. +- Automatically detect the package format. +- Fix other known issues. + +### v0.1 + +#### New Function + +- Support system check. +- Support database installation and uninstallation. +- Support cluster management, including start, stop, query, and restart. +- Support password encryption. +- Support template generation. +- Adapt to different OS for installation. +- Support PTK self-upgrade. \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/usage/usage-chekos.md b/product/en/docs-ptk/v0.6/usage/usage-chekos.md new file mode 100644 index 0000000000000000000000000000000000000000..66d692fae314f9c8a52d4a2aaa1e3383aa264975 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-chekos.md @@ -0,0 +1,77 @@ +--- +title: Checking the System +summary: Checking the System +author: Yao Qian +date: 2022-07-30 +--- + +# Checking the System + +Before installing the database, you need to check the system parameters and software dependencies of the server where the database is to be installed to ensure smooth installation. + +> During system check, the values provided by PTK are recommended ones in production environment. They may vary in different system versions or hardware configurations. Users need to optimize them according to their environment. + +## Check Item List + +You can run `checkos` to perform system check. During the check, PTK checks the following modules. + +| No. | Category | Check Item | Description | +| ---- | --------------------- | ----------------------------- | ----------------------------------------------------- | +| A1 | System version | Check_OS_Version | Checks the system version. | +| A2 | Kernel version | Check_Kernel_Version | Checks the kernel version. | +| A3 | Character set | Check_Unicode | Check the character set. | +| A4 | Time zone | Check_TimeZone | Checks the time zone. | +| A5 | Swap memory | Check_Swap_Memory_Configure | Checks the swap memory configuration. | +| A6 | sysctl parameter | Check_SysCtl_Parameter | Checks the sysctl parameter. | +| A7 | File system | Check_FileSystem_Configure | Checks the file system configuration. | +| A8 | Disk | Check_Disk_Configure | Checks the disk configuration. | +| A9 | Preread block | Check_BlockDev_Configure | Checks the block configuration. | +| | | Check_Logical_Block | Checks the logic block. | +| A10 | IO scheduling | Check_IO_Request | Checks the IO request parameters. | +| | | Check_Asynchronous_IO_Request | Checks the asynchronous IO request parameters. | +| | | Check_IO_Configure | Checks the IO configuration. | +| A11 | Network | Check_Network_Configure | Checks the network configuration. | +| A12 | Clock consistency | Check_Time_Consistency | Checks the clock consistency. | +| A13 | Firewall | Check_Firewall_Service | Checks the firewall configuration. | +| A14 | Transparent huge page | Check_THP_Service | Checks the transparent huge page configuration. | +| A15 | Dependencies | Check_Dependent_Package | Checks the database system installation dependencies. | +| A16 | CPU command set | Check_CPU_Instruction_Set | Checks the CPU command set. | +| A17 | Port status | Check_Port | Checks whether the database port is occupied. | + +To perform system check using PTK, you need to specify the cluster configuration file using`-f` and content to be checked using `-i`. If the content to be checked is unknown, all check items listed in the above table will be checked by default. + +To check individual check items, specify the check items by separating their item numbers with commas. + +Example: + +```shell +ptk checkos -i A1,A2,A3 # To check multiple check items, enter the item number in the -i A1,A2,A3 format. +ptk checkos -i A # Check all check items. +ptk checkos -i A --detail # Display details. +ptk checkos --gen-warning-fix # When the root-fix script is outputted, the check item at the warning level will also generate rectification statements. +``` + +## Check Result Classification + +The PTK check result includes four levels. + +- **OK**: The check result reaches expectations and meets the installation requirement. +- **Warning**: The check result does not reach expectations but meets the installation requirement. +- **Abnormal**: The check result does not meet the installation requirement. The installation may fail. The exception needs to be handled manually based on the suggested script by PTK. +- **ExecuteError**: PTK failed to execute commands during system check. The reason may be that some tools are not installed in the environment or there is an internal bug. This error needs to be handled based on the actual prompt information. + +Before installing the database, make sure that the check result of all check items is `OK` or `Warning`. If the check result displays `Abnormal`, an error may occur during installation and installation exits. + +## Automatic Fixing + +After running the `checkos` command, if there is abnormal check items, PTK will generate a shell script file started with `root_fix_os` and followed by timestamp. + +You can open it to view the content. It includes the fixing suggestions on abnormal check items provided by PTK. + +> The fixing suggestions are not generated for warning check items by default. If you need it, specify the `--gen-warning-fix` option in the `checkos` command. + +You can manually perform the fixing command, or automatically execute the script on all servers in a cluster using PTK. + +```shell +ptk -f config.yaml -s +``` diff --git a/product/en/docs-ptk/v0.6/usage/usage-comment.md b/product/en/docs-ptk/v0.6/usage/usage-comment.md new file mode 100644 index 0000000000000000000000000000000000000000..38de110bf7868effd701876f714ed0fe42a953e2 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-comment.md @@ -0,0 +1,20 @@ +--- +title: Cluster Comment +summary: Cluster Comment +author: Yao Qian +date: 2022-09-15 +--- + +# Commenting a Cluster + +PTK support the `--comment` parameter for commenting a cluster during database cluster installation. + +After successful installation, the comment information can be displayed in the cluster list by running `ls`. + +## Comment Modification + +Run the following command to modify the comment: + +```shell +ptk cluster -n CLUSTER_NAME modify-comment --comment "new comment" +``` diff --git a/product/en/docs-ptk/v0.6/usage/usage-config.md b/product/en/docs-ptk/v0.6/usage/usage-config.md new file mode 100644 index 0000000000000000000000000000000000000000..03ce83393de9dd9d18aca330991a1201f0743af9 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-config.md @@ -0,0 +1,261 @@ +--- +title: Creating a Configuration File +summary: Creating a Configuration File +author: Yao Qian +date: 2022-07-30 +--- + +# Creating a Configuration File + +## Manual Configuration + +Before installing the database, PTK can be used to create a configuration file for defining the expected database cluster topology. + +To install a single-instance database, run the following command to generate a configuration file. + +```shell +ptk template -l > config.yaml +``` + +To install a multi-instance cluster, run the following command to generate a configuration file. + +```shell +ptk template > config.yaml +``` + +After PTK is run, a `config.yaml` file is generated in the current folder. You need to modify db_server-related fields. + +If there is the password field, you need to run [ptk encrypt](../commands/ptk-encrypt.md) to encrypt the password and then add the ciphertext to the configuration file. + +> **Note**: +> If you hope to use a non-root user to connect the target server, make sure that the user has the sudo permission on the target server. +> +> Configuration method: Add the following content (replacing `USERNAME` with SSH connection user name) to the `sudoers` files in the `/etc` directory: +> `[USERNAME] ALL=(ALL) NOPASSWD:ALL` + +## Interactive Creation + +PTK also supports interactive creation of a configuration file. You can perform the following command to perform interactive creation: + +```shell +ptk template create +``` + +After the command is run, the interactive terminal is displayed. You need to only reply the questions in sequence. + +**Note**: During db_server configuration, if the SSH connection information is the same, it can be used repeatedly. + +After the interactive terminal exits, a `config.yaml` file will be automatically created in the current folder. + +### Example + +The default values prevail for most fields by default. The password field value needs to be entered. + +The following is an example of a configuration file where one primary instance and one standby instance are deployed. Assume that the primary instance is deployed on the local server and the IP address of the standby instance is `192.168.1.100`. + +```shell +$ ptk template create +Please enter the cluster name: (default: cluster_igiltry) +Please enter the system user name: (default: omm) +Please enter the user group name: (default: omm) +Please enter the initial password of the database (8 to 16 characters): +Please enter your password again: +Please enter the listening port of the database (value range: 1024 to 65535 ): (default: 26000) +Please enter the listening port of the CM sever (value range: 1024 to 65535): (default: 15300) +Please enter the directory for database installation (make sure the directory is empty): (default: /opt/mogdb) +Next, let us add some database instance servers +================db server 1================ +Please enter the IP address of the server (support for only IPv4): 127.0.0.1 +Please choose a database role: + 1: primary + 2: standby + 3: cascade_standby +Please enter the number: 1 +Please enter the name of the database Az (available zone): (default: AZ1) +================ end ================ +Do you want to add another db server?[Y|Yes](default=N) y +================db server 2================ +Please enter the IP address of the server (support for only IPv4): 192.168.1.100 +Please choose a database role: + 1: primary + 2: standby + 3: cascade_standby +Please enter the number: 2 +Please enter the name of the database Az (available zone): (default: AZ1) +[SSH] Please enter the SSH login user name: (default: root) +[SSH] Please enter the SSH port: (default: 22) +[SSH] Please choose an verification mode: + 1: Password + 2: KeyFile +Please enter the number: 1 +[SSH] Please enter the SSH login password: +================ end ================ +Do you want to add another db server?[Y|Yes](default=N) n +Generate /Users/vimiix/Home/enmotech/ptk/ptk_repo/config.yaml successfully +``` + +## Configuration File Field Description + +The following is an example of a completed configuration file: + +```yaml +global: + # # cluster name + cluster_name: + # # system user for running db + user: omm + # # system user group, same as username if not given + group: omm + # # system user password, use 'ptk encrypt' to encrypt it if not empty + # user_password: "" + # # database password, use 'ptk encrypt' to encrypt it if not empty + # db_password: "" + # # database port + db_port: 26000 + # # cm_server port (Effective after mogdb3.0) + # cm_server_port: 15300 + # # base directory for install MogDB server, + # # if any of app_dir,data_dir,log_dir and tool_dir not config, + # # PTK will create corresponding directory under base_dir + base_dir: /opt/mogdb + # # application directory + # app_dir: /opt/mogdb/app + # # log directory + # log_dir: /opt/mogdb/log + # # data directory + # data_dir: /opt/mogdb/data + # # tool directory + # tool_dir: /opt/mogdb/tool + # # temporary directory + tmp_dir: /tmp + # # corefile directory + # core_file_dir: + # # gs_initdb custom options + gs_initdb_opts: + - --encoding=UTF-8 + - --dbcompatibility=A + cm_option: + dir: /opt/mogdb/cm + cm_server_port: 15300 + db_service_vip: "" + cm_server_conf: + # # support all fields in cm_server.conf + # instance_heartbeat_timeout: 2 + # ... + cm_agent_conf: + # # support all fields in cm_agent.conf + # log_max_size: 10240 + # ... + +db_servers: + - host: 10.0.1.100 + # # database port + db_port: 26000 + # # ip list for database replication, use host default + # ha_ips: + # - 10.0.2.100 + # # port for database replication, use db_port plus 1 default + ha_port: 26001 + # # database role, options: primary, standby, cascade_standby + role: primary + # # available zone name + az_name: AZ1 + # available zone priority + az_priority: 1 + # # upstream host ip for cascade_standby instance + upstream_host: + # # parameters in postgresql.conf + db_conf: + # replication_type: 1 + # # SSH connection config,use global.ssh_option if not config + # ssh_option: + # port: 22 + # user: root + # password: + # key_file: + # passphrase: + # conn_timeout: 5s + # exec_timeout: 1m + # proxy: + # host: + # user: + # password: + # key_file: + # passphrase: + # conn_timeout: 5s + # exec_timeout: 1m +``` + +The configuration file includes two parts, including `global` and `db_servers`. + +- **global**: describes the common information of all instances in a cluster. +- **db_servers**: shows the instance list. Each element represents an instance. + +### Global Configuration + +Field Name | Description | Value Type | Default Value | Mandatory or Not | Remarks +------|-------|-----|------|------ | ------ +cluster_name | Cluster name | String | `cluster_` is the prefix of a cluster name by default. | Yes | +user | Operating system user | String | omm | No | +group | Operating system user group | String | omm | No | +user_password | Operating system user password | String | Null | No | The value needs to be encrypted by running the `encrypt` command. +db_password | Database password | String | Null | No | The value needs to be encrypted by running the encrypt command. If the field is not set, it can be set during installation. +db_port | Listening port of a database | Integer | 26000 | No | +base_dir | Base directory for database installation | String | /opt/mogdb | No | If this field is set, the app_dir, log_dir, data_dir, tool_dir, cm_dir, and tmp_dir fields can be optional and automatically put in the specified directory of this field. +app_dir | Application directory of a database | String | /opt/mogdb/app | No | +log_dir | Database log directory | String | /opt/mogdb/log | No | +data_dir | Database data directory | String | /opt/mogdb/data | No | +tool_dir | Database tool directory | String | /opt/mogdb/tool | No | +tmp_dir | Directory of the temporary database file | String | /tmp | No | +core_file_dir | Directory of the system core file | String | Null | No | If this field is set, the `kernel.core_pattern` value will be changed. +gs_initdb_opts | gs_initdb parameters for database initialization | String list | no | An element maps a parameter. If the `--locale` parameter is not set, PTK will set the element to `--no-locale` by default. | +ssh_option | SSH connection authentication information | [ssh_option](#ssh_option) | no | If an instance needs to be connected remotely but the instance-level ssh_option is not configured, the field in the global will prevail. | +cm_option | CM configuration parameter | [cm_option](#cm_option) | no | The field takes effect when `--install-cm` is specified during installation. | + +### db_servers Configuration + +Field Name | Description | Value Type | Default Value | Mandatory or Not | Remarks +------|-------|-----|------|------ | ------ +host | IP address of an instance | String | Null | Yes | +db_port | Instance port | Integer | 26000 | No | If this field is not configured, the field in the global will prevail. +ha_ips | HA IP address list for instance log replication | String list | Null | No | +ha_port | HA port for log replication | Integer | 26001 | No | +role | Database instance role | String | Null | No | The value can be `primary`, `standby`, and `cascade_standby`. If this field is not configured, an instance in a cluster will be chosen as the primary instance randomly. Other instances will become standby instances. +upstream_host | IP address of the upstream standby of the cascaded standby | String | Null | Mandatory for a cascaded standby | +az_name | AZ name | String | AZ1 | No | +az_priority | AZ priority | Integer | 1 | The smaller the value, the higher the priority. | +xlog_dir | xlog log directory | String | Null | The xlog will be put in the pg_log of the `log_dir` directory. This field cannot be configured under the data directory. Otherwise, an error will occur during database starting. | +db_conf | Database GUC parameter configuration | Dictionary | Null |The dictionary key is a parameter in postgresql.conf.| +ssh_option | SSH connection authentication for connecting an instance | [ssh_option](#ssh_option) | no | If this field is not configured, the field in the global will prevail. | + +### cm_servers + +| Field Name | Description | Value Type | Default Value | Mandatory or Not | Remarks | +| ---------- | ------------------------------------------------------ | ------------------------- | ------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| host | IP address of an instance | String | Null | Yes | | +| port | CM server port | Integer | 15300 | No | If it is not specified, the value of `global.cm_option.cm_server_port` is used. | +| ssh_option | SSH authentication information for instance connection | [ssh_option](#ssh_option) | No | If it is not specified, the field in the global or the configuration of the same IP address in db_servers can be used. | | + +### cm_option + +| Field Name | Description | Value Type | Default Value | Mandatory or Not | Remarks | +| -------------- | ------------------------------------------------------ | ---------- | ------------- | ----------------- | ------------------------------------------------------------ | +| dir | CM installation directory | String | $base_dir/cm | Yes | | +| cm_server_port | Listening port of the CM server | Integer | 15300 | No | | +| db_service_vip | Virtual IP address (which needs to be supported by CM) | String | Null | No | | +| cm_server_conf | CM sever configuration parameter | Dictionary | Null | No | The dictionary key of the field supports any parameter of cm_server. PTK will set this value in cm_server.conf . | +| cm_agent_conf | CM agent configuration parameter | Dictionary | Null | No | The dictionary key of the field supports any parameter of cm_agent. PTK will set this value in cm_agent.conf . | + +### ssh_option + +Field Name | Description | Value Type | Default Value | Mandatory or Not | Remarks +------|-------|-----|------|------ | ------ +host | IP address of a host | String | IP address of an instance | No | If a host is to be configured as a proxy jump server, this field is mandatory. +port | SSH connection port | Integer | 22 | No | +user | SSH connection user | String | root | No | If the connection user is not root, make sure that the user has the sudo permission without the code. +password | SSH connection password | String | Null | No | The value needs to be encrypted by running the `encrypt` command. +key_file | SSH connection key file | String | Null | No | +passphrase | Password of the SSH connection key file | String | Null | No | +conn_timeout | SSH connection timeout duration | Duration | 1m | No | +exec_timeout | Command execution timeout duration | Duration | 10m | No | +proxy | Jump server configuration | ssh_option | Null | No | The jump server can be connected for only once. diff --git a/product/en/docs-ptk/v0.6/usage/usage-db-operation.md b/product/en/docs-ptk/v0.6/usage/usage-db-operation.md new file mode 100644 index 0000000000000000000000000000000000000000..98f1debfe602dd6ed74c3c9d51ce7d4e0e443bd6 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-db-operation.md @@ -0,0 +1,232 @@ +--- +title: Operating with a Database +summary: Operating with a Database +author: Yao Qian +date: 2022-07-30 +--- + +# Operating with a Database + +## View the Cluster List + +After the database clusters is installed, you can run `ptk ls` to query the list of clusters installed by the current user (Because PTK metadata is stored in the `$HOME/.ptk` directory, you can query the list of the clusters installed under the current user). + +Example: + +```shell +$ ptk ls +cluster_name| id | addr | user | data_dir | db_version | create_time | comment +------------------+------+-----------------------+------+-----------------------+------------------------------+---------------------+---------- + c1 | 6001 | 192.168.100.100:26000 | ptk1 | /home/ptk1/mogdb/data | MogDB 3.0.3 (build 23ba838d) | 2022-11-09 15:01:34 | +``` + +The output list describes the following information: + +- cluster_name: specifies the cluster name. +- id: specifies the ID distributed to an instance during installation. +- addr: specifies the instance address list. +- user: specifies the system user. +- data_dir: specifies the data directory of the instances. +- db_version: specifies the database version. +- create_time: specifies the cluster creation time. +- comment: specifies the cluster comment information. + +After the database cluster is installed, it is recommended that the `-n` parameter (specifying the cluster name) is used to manage the cluster. + +## View the Cluster Status + +You can run `cluster status` to view the cluster status. + +```shell +# ptk cluster -n c1 status + +[ Cluster State ] +database_version : MogDB 3.0.3 (build 23ba838d) +cluster_name : c1 +cluster_state : Normal + +[ Datanode State ] +cluster_name | id | ip | port | user | instance | db_role | state +-------------+-------+-----------------+-------+------+----------+---------+--------- + c1 | 6001 | 192.168.122.101 | 26000 | ptk | dn_6001 | primary | Normal + | 6002 | 192.168.122.102 | 26000 | ptk | dn_6002 | standby | Normal +``` + +## Start the Cluster + +> The following uses the `c1` cluster as an example. + +After the database cluster is installed, PTK will start the database cluster by default. + +If the `--skip-launch-db` parameter is specified during installation, the database is in the stopped status. + +You can run `cluster start` to start the database cluster. You need to specify the cluster name in the command. + +Example: + +```shell +# ptk cluster -n c1 start +INFO[2022-08-02T11:40:48.728] Operating: Starting. +INFO[2022-08-02T11:40:48.728] ========================================= +INFO[2022-08-02T11:40:48.784] starting host 192.168.122.101 +INFO[2022-08-02T11:40:54.097] starting host (192.168.122.101,ptk) successfully +INFO[2022-08-02T11:40:54.097] starting host 192.168.122.102 +INFO[2022-08-02T11:40:56.329] starting host (192.168.122.102,ptk) successfully +INFO[2022-08-02T11:40:56.613] waiting for check cluster state... +INFO[2022-08-02T11:41:01.861] ========================================= +INFO[2022-08-02T11:41:01.861] Successfully started. +INFO[2022-08-02T11:41:01.861] Operation succeeded: Start. +``` + +PTK starts all instances in the cluster by default. It also supports the starting of a single instance. + +```shell +# ptk cluster -n c1 start -H 192.168.122.101 +INFO[2022-08-02T11:50:04.442] Operating: Starting. +INFO[2022-08-02T11:50:04.442] ========================================= +INFO[2022-08-02T11:50:06.692] starting host (192.168.122.101,ptk) successfully +``` + +For more parameters, see the help information. + +```shell +# ptk cluster start -h +Start a database instance or cluster. + +Usage: + ptk cluster start [flags] + +Flags: + -h, --help help for start + -H, --host string Specifies the IP address of an instance. + -n, --name string Specifies the cluster name. + --security-mode string Specifies whether to start a database in safe mode. + The value can be on and off. + --time-out duration Specifies the start timeout duration. The default value is 10 minutes. +``` + +## Stop the Cluster + +> The following uses the `c1` cluster as an example. + +You can run `cluster stop` to stop a database cluster. PTK will stop all instances in a cluster by default. + +```shell +# ptk cluster -n c1 stop +INFO[2022-08-02T11:49:40.685] Operating: Stopping. +INFO[2022-08-02T11:49:40.685] ========================================= +INFO[2022-08-02T11:49:40.891] stopping host 192.168.122.102 +INFO[2022-08-02T11:49:41.946] stopping host (192.168.122.102,ptk) successfully +INFO[2022-08-02T11:49:41.946] stopping host 192.168.122.101 +INFO[2022-08-02T11:49:43.004] stopping host (192.168.122.101,ptk) successfully +INFO[2022-08-02T11:49:43.004] ========================================= +INFO[2022-08-02T11:49:43.004] Successfully stoped. +INFO[2022-08-02T11:49:43.004] Operation succeeded: Stop. +``` + +You can use the `-H` parameter to specify a instance to stop it. + +```shell +# ptk cluster -n c1 stop -H 192.168.122.101 +INFO[2022-08-02T11:56:32.880] Operating: Stopping. +INFO[2022-08-02T11:56:32.881] ========================================= +INFO[2022-08-02T11:56:34.154] stopping host (192.168.122.101,ptk) successfully +``` + +For more parameters, see the help information. + +```shell +# ptk cluster stop -h +Stop a database instance or cluster. + +Usage: + ptk cluster stop [flags] + +Flags: + -h, --help help for stop + -H, --host string Specifies the IP address of an instance. + -n, --name string Specifies the cluster name. + --time-out duration Specifies the stop timeout duration. The default value is 10 minutes. +``` + +## Restart the Cluster + +> The following uses the `c1` cluster as an example. + +Restarting a cluster is actually to stop the database first and then start the database. + +You can run `cluster restart` to restart the cluster. + +```shell +# ptk cluster -n c1 restart +INFO[2022-08-02T11:59:31.037] Operating: Stopping. +INFO[2022-08-02T11:59:31.037] ========================================= +INFO[2022-08-02T11:59:31.217] stopping host 192.168.122.102 +INFO[2022-08-02T11:59:32.269] stopping host (192.168.122.102,ptk) successfully +INFO[2022-08-02T11:59:32.269] stopping host 192.168.122.101 +INFO[2022-08-02T11:59:33.309] stopping host (192.168.122.101,ptk) successfully +INFO[2022-08-02T11:59:33.309] ========================================= +INFO[2022-08-02T11:59:33.309] Successfully stoped. +INFO[2022-08-02T11:59:33.309] Operation succeeded: Stop. + +INFO[2022-08-02T11:59:33.310] Operating: Starting. +INFO[2022-08-02T11:59:33.310] ========================================= +INFO[2022-08-02T11:59:33.376] starting host 192.168.122.101 +INFO[2022-08-02T11:59:35.583] starting host (192.168.122.101,ptk) successfully +INFO[2022-08-02T11:59:35.583] starting host 192.168.122.102 +INFO[2022-08-02T11:59:36.787] starting host (192.168.122.102,ptk) successfully +INFO[2022-08-02T11:59:36.995] waiting for check cluster state... +INFO[2022-08-02T11:59:42.247] ========================================= +INFO[2022-08-02T11:59:42.247] Successfully started. +INFO[2022-08-02T11:59:42.247] Operation succeeded: Start. +``` + +For more parameters, see the help information. + +```shell +# ptk cluster restart -h +Restart a database instance or cluster. + +Usage: + ptk cluster restart [flags] + +Flags: + -h, --help help for restart + -H, --host string Specifies the IP address of an instance. + -n, --name string Specifies the cluster name. + --security-mode string Specifies whether to start a database in safe mode. + The value can be on and off. + --time-out duration Specifies the start timeout duration. The default value is 10 minutes. +``` + +## Rebuild a Specified Database Instance + +> The following uses the `c1` cluster as an example. + +Rebuilding an instance is to actually schedule `gs_ctl build` to execute related operations. + +You can run `cluster build` to rebuild an instance. + +```shell +# ptk cluster -n c1 build -H 172.16.0.190 +INFO[2023-01-10T11:46:22.035] operation: build +INFO[2023-01-10T11:46:22.035] ======================================== +INFO[2023-01-10T11:46:22.035] build 172.16.0.190, role standby +INFO[2023-01-10T11:46:32.816] build 172.16.0.183, role cascade_standby +INFO[2023-01-10T11:46:44.099] ======================================== +INFO[2023-01-10T11:46:44.099] build successfully +``` + +For more parameters, see the help information. + +``` +# ptk cluster build -h +Rebuild a database instance. + +Usage: + ptk cluster build [flags] + +Flags: + -h, --help help for build + -H, --host stringArray Specifies the IP address list to be built. +``` \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/usage/usage-demo.md b/product/en/docs-ptk/v0.6/usage/usage-demo.md new file mode 100644 index 0000000000000000000000000000000000000000..d4faba644ae9d05037c0c0f5cf8c482de0183af2 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-demo.md @@ -0,0 +1,97 @@ +--- +title: ptk demo +summary: ptk demo +author: Jerad.K +date: 2023-01-10 +--- + +# ptk demo Quickens Deployment of the Single-Server Verification Environment + +`ptk demo` allows you to quickly deploy a single-server MogDB database with related components installed without the need of a configuration file. + +The database installed using `ptk demo` can be operated using other PTK commands. + +## Objectives + +- A quick installation method is provided to get access to a single-server MogDB cluster conveniently. +- The A compatibility mode is provided, requiring zero learning cost for Oracle users. +- The PG compatibility mode is provided, requiring zero learning cost for PostgreSQL users. + +## Prerequisites + +ptk demo applies to only the Linux operating system currently. + +Before executing `ptk demo`, make sure that port 26000 is available. If you use other ports, use `--port` to specify a port. + +## Deployment Command + +```shell +ptk demo [--port PORT] +``` + +## MogDB Version + +The default version is LTS, that is, MogDB `3.0.3` currently. + +## Plugins + +For a database of the `oracle_compatibility` mode, the following plugsin will be installed: + +- [whale](https://docs.mogdb.io/zh/mogdb/v3.0/whale) +- [orafce](https://docs.mogdb.io/zh/mogdb/v3.0/orafce-user-guide) +- [compat_tools](https://gitee.com/enmotech/compat-tools) +- [mogila](https://gitee.com/enmotech/mogila) + +## Summary After Installation + +Demo summary: + +Database: +|cluste_name|host|user|port|status|message| +|-----------|----|----|----|------|-------| +|demo_gJyY|192.168.1.1|demo_user_gJyY|26000|start_success|success| + +Other database details: + +|item|value| +|-----------|--------| +|db password |Demo@pwd_gJyY | +|base_dir | /home/demo_user_gJyY/demo | +|app_dir | /home/demo_user_gJyY/demo/app | +|data_dir | /home/demo_user_gJyY/demo/data | +|tool_dir | /home/demo_user_gJyY/demo/tool | +|tmp_dir | /home/demo_user_gJyY/demo/tmp | + +Mode compatibility: + +|mode_name|database|plugins_info|other_info| +|---------|--------|------------|----------| +| PG | postgres_compatibility |none | +| A | oracle_compatibility | plugin:whale, status:success, ref:
plugin:orafce, status:success, ref:
plugin:compat_tools, status:success, ref:
plugin:mogila, status:success, ref: |


create user: mogdb, password: Demo@pwd_gJyY| + +## Database Connection + +Switch to the database user, and use gsql to perform the connection test. + +The `demo_user_gJyY` user is used as an example. + +```shell +# su - demo_user_gJyY +$ gsql -r +gsql ((MogDB 3.0.3 build 23ba838d) compiled at 2022-10-22 09:50:39 commit 0 last mr ) +Non-SSL connection (SSL connection is recommended when requiring high-security) +Type "help" for help. + +MogDB=# \l + List of databases + Name | Owner | Encoding | Collate | Ctype | Access privileges | Compatibility +----------------------+----------------+----------+---------+-------+-----------------------------------+--------------- +postgres_compatibility | demo_user_gJyY | UTF8 | C | C | | PG + oracle_compatibility | demo_user_gJyY | UTF8 | C | C | | A + postgres | demo_user_gJyY | UTF8 | C | C | | A + template0 | demo_user_gJyY | UTF8 | C | C | =c/demo_user_gJyY +| A + | | | | | demo_user_gJyY=CTc/demo_user_gJyY | + template1 | demo_user_gJyY | UTF8 | C | C | =c/demo_user_gJyY +| A + | | | | | demo_user_gJyY=CTc/demo_user_gJyY | +(4 rows) +``` diff --git a/product/en/docs-ptk/v0.6/usage/usage-help.md b/product/en/docs-ptk/v0.6/usage/usage-help.md new file mode 100644 index 0000000000000000000000000000000000000000..fd2a66860442d9a2dbfc7c5f80e0a3da5add87c8 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-help.md @@ -0,0 +1,77 @@ +--- +title: Viewing Help Information +summary: Viewing Help Information +author: Yao Qian +date: 2022-05-30 +--- + +## Viewing Help Information + +After PTK is successfully installed, you can run `ptk -h` to view the help information. For details about command parameters, see [PTK Command Reference](../commands/ptk.md). + +``` +PTK is a command line tool for deploying and managing the MogDB database cluster. + +Usage: + ptk [flags] [args...] + ptk [command] + +Available Commands: + env Prints PTK-loaded environment variable values. + gen-om-xml Generates the gs_om XML configuration file. + self Operates with the PTK self installation package. + version Prints the PTK version. + help Prints the PTK help information. + completion Generate the autocompletion script for the specified shell + +Pre Install Commands: + candidate Prints the PTK-supported software version list. + download Downloads the MogDB installation package online. + checkos Checks whether the cluster server system meets database installation requirements. + encrypt Provides a convenient method of encrypting your text or password. + template Prints the configuration template. + +Install Commands: + install Configures and deploys the MogDB database cluster based on the given topology. + uninstall Uninstalls the MogDB database cluster. + +Post Install Commands: + ls Lists all MogDB clusters. + cluster Manages the database cluster. +Experimental Commands: + register 注册PTK内部类型满足特定需求 +Flags: + -h, --help Prints the PTK help information. + --log-file string Specifies a path of the run log file + --log-format string Specifies the output format of the run log. The value can be text or json. The default value is text. + --log-level string Specifies the run log level. The value can be debug, info, warning, error, and panic. The default value is info. + -v, --version Prints the PTK version. + +Use "ptk [command] --help" for more information about a command. +``` + +## Viewing Version + +You can run `ptk -v` to view PTK version. + +```shell +$ ptk -v +PTK Version: v0.4.0 +Go Version: go1.17.1 +Build Date: 2022-09-14T09:32:14Z +Git Hash: a9xa9e +``` + +The output includes the PTK version, Golang version in compilation, build time, and git hash value. + +## More + +- [Checking the System](./usage-chekos.md) +- [Creating a Configuration File](./usage-config.md) +- [Installing a Database](./usage-install.md) +- [Operating with a Database](./usage-db-operation.md) +- [Scale-In/Out](./usage-scale.md) +- [Installing Extensions](./usage-install-plugin.md) +- [Uninstalling a Database Cluster](./usage-uninstall.md) +- [Commenting a Cluster](./usage-comment.md) +- [Upgrading PTK](./usage-self-upgrade.md) diff --git a/product/en/docs-ptk/v0.6/usage/usage-install-plugin.md b/product/en/docs-ptk/v0.6/usage/usage-install-plugin.md new file mode 100644 index 0000000000000000000000000000000000000000..326afaafa88d42436d09172359bec9e3be9763d2 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-install-plugin.md @@ -0,0 +1,95 @@ +--- +title: Install Extensions +summary: Install Extensions +author: Yao Qian +date: 2022-07-30 +--- + +# Installing Extensions + +> For details about MogDB extension usage, see the related document, such as [dblink](https://docs.mogdb.io/en/mogdb/v3.0/dblink-user-guide). + +PTK automatically judges the version of the current cluster to download the corresponding extension package for installation. + +After successful installation, PTK will not create extensions in the database. You need to manually create extensions based on the related document. + +## View the Help Document + +```shell +# ptk cluster install-plugin -h +Installl the MogDB extension. + +Usage: + ptk cluster install-plugin [flags] + +Flags: + -h, --help Specifies the help information for installing extensions. + -H, --host strings Specifies the IP address of the host where an extension is to be installed. The extension is installed on all hosts in a cluster by default. + -n, --name string Specifies the cluster name. + --override Specifies whether to override the current extension file. + -p, --pkg string Specifies the extension package path. + -P, --plugin strings Specifies the name of the extension to be installed. All extensions will be installed by default. +``` + +## Install All Extensions + +PTK downloads all the extension packages of the corresponding version to install them by default. If you need to specify an extension for installation, use `-P` or `--plugin` to specify it. + +Example: + +```bash +# ptk cluster -n cluster_slirist install-plugin +INFO[2022-08-02T16:15:11.786] downloading Plugins-3.0.0-CentOS-x86_64.tar.gz... +> Plugins-3.0.0-CentOS-x86_64...: 70.71 MiB / 70.71 MiB [-----------------------------------------------] 100.00% 14.33 MiB p/s 5.1s +INFO[2022-08-02T16:15:17.629] download successfully +INFO[2022-08-02T16:15:17.651] scp file from /tmp/2451478859/Plugins-3.0.0-CentOS-x86_64.tar.gz to 192.168.122.101:/opt/mogdb/tool/Plugins-3.0.0-CentOS-x86_64.tar.gz host=192.168.122.101 +INFO[2022-08-02T16:15:17.651] scp file from /tmp/2451478859/Plugins-3.0.0-CentOS-x86_64.tar.gz to 192.168.122.102:/opt/mogdb/tool/Plugins-3.0.0-CentOS-x86_64.tar.gz host=192.168.122.102 +INFO[2022-08-02T16:15:17.781] mkdir /opt/mogdb/tool/plugins host=192.168.122.101 +> upload Plugins-3.0.0-CentOS...: 70.71 MiB / 70.71 MiB [--------------------------------------------------------] 100.00% 124.92 MiB p/s 800ms +INFO[2022-08-02T16:15:18.437] mkdir /opt/mogdb/tool/plugins host=192.168.122.102 +INFO[2022-08-02T16:15:18.606] decompress Plugins-3.0.0-CentOS-x86_64.tar.gz to dir /opt/mogdb/tool/plugins host=192.168.122.102 +INFO[2022-08-02T16:15:19.816] change /opt/mogdb/tool/plugins owner to vmx host=192.168.122.101 +INFO[2022-08-02T16:15:20.542] change /opt/mogdb/tool/plugins owner to vmx host=192.168.122.102 +INFO[2022-08-02T16:15:20.562] installing plugin [dblink] ... host=192.168.122.101 +INFO[2022-08-02T16:15:20.562] installing plugin [dolphin] ... host=192.168.122.102 +INFO[2022-08-02T16:15:20.627] plugin [dblink] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:20.627] installing plugin [wal2json] ... host=192.168.122.101 +INFO[2022-08-02T16:15:20.668] plugin [wal2json] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:20.668] installing plugin [pg_bulkload] ... host=192.168.122.101 +INFO[2022-08-02T16:15:20.725] plugin [dolphin] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:20.725] installing plugin [postgis] ... host=192.168.122.102 +INFO[2022-08-02T16:15:20.734] plugin [pg_bulkload] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:20.734] installing plugin [pg_prewarm] ... host=192.168.122.101 +INFO[2022-08-02T16:15:20.771] plugin [pg_prewarm] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:20.771] installing plugin [dolphin] ... host=192.168.122.101 +INFO[2022-08-02T16:15:20.881] plugin [dolphin] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:20.881] installing plugin [postgis] ... host=192.168.122.101 +INFO[2022-08-02T16:15:20.985] plugin [postgis] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:20.985] installing plugin [dblink] ... host=192.168.122.102 +INFO[2022-08-02T16:15:21.042] plugin [dblink] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:21.042] installing plugin [wal2json] ... host=192.168.122.102 +INFO[2022-08-02T16:15:21.075] plugin [postgis] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:21.075] installing plugin [pg_trgm] ... host=192.168.122.101 +INFO[2022-08-02T16:15:21.112] plugin [wal2json] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:21.112] installing plugin [pg_bulkload] ... host=192.168.122.102 +INFO[2022-08-02T16:15:21.117] plugin [pg_trgm] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:21.117] installing plugin [orafce] ... host=192.168.122.101 +INFO[2022-08-02T16:15:21.160] plugin [orafce] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:21.160] installing plugin [pg_repack] ... host=192.168.122.101 +INFO[2022-08-02T16:15:21.200] plugin [pg_repack] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:21.200] installing plugin [whale] ... host=192.168.122.101 +INFO[2022-08-02T16:15:21.208] plugin [pg_bulkload] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:21.208] installing plugin [pg_prewarm] ... host=192.168.122.102 +INFO[2022-08-02T16:15:21.243] plugin [whale] installed successfully host=192.168.122.101 +INFO[2022-08-02T16:15:21.266] plugin [pg_prewarm] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:21.266] installing plugin [pg_trgm] ... host=192.168.122.102 +INFO[2022-08-02T16:15:21.321] plugin [pg_trgm] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:21.321] installing plugin [orafce] ... host=192.168.122.102 +INFO[2022-08-02T16:15:21.384] plugin [orafce] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:21.384] installing plugin [pg_repack] ... host=192.168.122.102 +INFO[2022-08-02T16:15:21.444] plugin [pg_repack] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:21.444] installing plugin [whale] ... host=192.168.122.102 +INFO[2022-08-02T16:15:21.510] plugin [whale] installed successfully host=192.168.122.102 +INFO[2022-08-02T16:15:26.949] All done +INFO[2022-08-02T16:15:26.949] Time elapsed: 15s +``` diff --git a/product/en/docs-ptk/v0.6/usage/usage-install.md b/product/en/docs-ptk/v0.6/usage/usage-install.md new file mode 100644 index 0000000000000000000000000000000000000000..f1be7d0a221f6482b6d462778dc38775f0965184 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-install.md @@ -0,0 +1,94 @@ +--- +title: Install +summary: Install +author: Yao Qian +date: 2022-07-30 +--- + +# Installing a Database + +## View the Help Information + +After a configuration file is created and the system check is successful, you can start to install a database. + +Before installing the database, you are advised to familiarize yourself with some common parameters. You can run the `ptk install -h` command to view these parameters. + +```shell +Configure and deploy a MogDB database cluster based on the given topology. + +Usage: + ptk install [flags] + +Flags: + -y, --assumeyes Automatically applies Yes to all questions. + --db-version string Specifies the database package version (used for only online installation) + You can run 'ptk candidate db' to query the supported MogDB server version (default "3.0.3"). + --default-guc Does not automatically optimize GUC parameters. The default database parameters are used. + -e, --env strings Adds environment variables to the configuration file of the system user. + -h, --help Shows the help information for installation. + --install-cm Installs the CM component. + --launch-db-timeout duration Specifies the database start timeout duration (default 10 min). + --no-cache Does not use the installation package cached on the local server. + -p, --pkg string Specifies the path of the database package files or URL. + --post-run string Specifies the path of the Bash script, which will be distributed to each server after the database is deployed. + --pre-run string Specifies the path of the Bash script, which will be distributed to each server before the database is deployed. + --skip-check-distro Skips the system release check and perform installation directly. + --skip-check-os Skips system environment check and perform installation directly. + --skip-create-user Skips system user creation. + --skip-launch-db Skips database starting. + --skip-rollback Skips the rollback operation once the database fails to be installed. +``` + +### Install MogDB + +You can run the following command to install the MogDB database. + +```shell +$ ptk install -f config.yaml -y +``` + +`-f` specifies the configuration file path. `-y` specifies that yes is replied automatically for all interactive questions. + +> **Note**: If the initial password is not configured in the configuration file, `-y` cannot skip the password setting process. + +PTK will automatically download MogDB of the latest LTS (long-term support) version for installation by default. + +PTK also supports installation of a database of other versions or a database compiled by yourself. + +Parameter `--db-version` provided by PTK allows you to install MogDB of a specified version. + +For example, run the following command to install MogDB 3.1.0: + +```shell +ptk install -f config.yaml --db-version 3.1.0 -y +``` + +> You can run the `ptk candidate db` command to query the database versions supported by PTK. + +To install a database using an installation package compiled by yourself locally, use parameter `-p|--pkg` to specify the local path for storing the installation package or network address. The specified installation packages support only those including kernel, toolkit, and om. + +Parameter description: + +- `-e|--env` : adds environment variables to the database system user environment after database installation. + +- `--launch-db-timeout`: specifies the database start timeout duration. The default value is 5 minutes. + +- `--pre-run`: adds a shell script path and executes the specified script on all servers in a cluster before cluster installation. + +- `--post-run`: adds a shell script path and executes the specified script on all servers in a cluster after cluster installation. + +- `--skip-check-os`: skips the system check. + +- `--skip-check-distro`: skips system release check. + +- `--skip-create-user`: PTK automatically creates a user by default. This option skips user creation. When this option is specified, make sure that a user must exist in the server. + + Note: If this parameter is specified, PTK skips SSH mutual trust creation by default, and therefore you need to manually build SSH mutual trust. The O&M tools of some databases depend on SSH mutual trust. For example, it is required when you use gs_guc to modify all instance parameters of a cluster. + +- `--skip-launch-db`: does not start database after installation. + +- `--skip-rollback`: PTK rolls back all operations to clear environment by default once an error occurs. This option does not allow rollback operations. + +- `--install-cm`: installs the CM component during database installation (applied to MogDB 3.0.0 or later or scenarios where at least three instances are installed in a cluster). + +- `--no-cache`: does not use an installation package in the local cache and downloads the installation package from the specified network. \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/usage/usage-meta.md b/product/en/docs-ptk/v0.6/usage/usage-meta.md new file mode 100644 index 0000000000000000000000000000000000000000..3fbe0518e880fc268752e7030ab13c8bddbb6d5e --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-meta.md @@ -0,0 +1,30 @@ +--- +title: Meta Operation +summary: Meta Operation +author: Yao Qian +date: 2023-01-12 +--- + +## PTK Metadatabase + +During installation, PTK automatically creates a metadata directory `~/.ptk` in the root directory under an installation user. The metadata directory is used for storing data required for PTK running. Please execute the operation with caution. + +### Viewing the Metadata Directory of PTK + +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. + +```shell +ptk meta prune -n [--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. \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/usage/usage-mogha-operation.md b/product/en/docs-ptk/v0.6/usage/usage-mogha-operation.md new file mode 100644 index 0000000000000000000000000000000000000000..2ac0d0ed60f7057b579d564280df0acd20b36b7d --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-mogha-operation.md @@ -0,0 +1,59 @@ +--- +title: Cluster Install MogHA +summary: Cluster Install MogHA +author: Yao Qian +date: 2022-09-15 +--- + +# MogHA Installation and Uninstallation + +PTK supports the MogHA installation process in prerequisite that the user provides a legal MogHA configuration file. Before MogHA is installed, PTK verifies the configuration file. + +## Pre-Installation Verification + +- Verify whether the cluster status is normal. +- Verify whether there is MogHA running on the target server. + +## Verification Content + +- Verify whether `db_user` is null and consistent with the database user in a cluster. + +- Verify whether `db_port` is null and consistent with the database port in a cluster and whether the port is occupied. + +- Verify whether `db_datadir` is null and consistent with the database directory in a cluster. + +- Verify whether `agent_port` is null and meets the port specifications and whether the port is occupied. + +- Verify whether there are two or more servers where MogHA is to be installed. + +- Verify the `pinglist` and `hosts` fields in a zone. + +- Verify the `lite_mode` mode. + +## Deployment Mode + +MogHA is deployed in two modes, including the lite mode and the non-lite mode. + +- For the lite mode, MogHA is installed on only a primary node and a synchronous standby node. If there are multiple synchronous standby nodes, you need to choose one for installation. If there is only one synchronous standby node, MogHA is installed on it by default. + +- For the non-lite mode, MogHA is installed on all nodes in a cluster. + +## Generation of a Configuration File Template + +PTK provides a template command to help users automatically generate a MogHA configuration file. + +```shell +ptk template mogha -n CLUSTER_NAME [-o node.conf] [--port 8081] +``` + +## Installation Command + +```shell +ptk cluster -n CLUSTER_NAME install-mogha -d INSTALL_DIR -c node.conf [-p MOGHA_PACKAGE] +``` + +## Uninstallation Command + +```bash +ptk cluster -n CLUSTER_NAME uninstall-mogha +``` \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/usage/usage-scale.md b/product/en/docs-ptk/v0.6/usage/usage-scale.md new file mode 100644 index 0000000000000000000000000000000000000000..df56098cd889648f2080cfd8e31275dba6a0c626 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-scale.md @@ -0,0 +1,198 @@ +--- +title: Scale-In/Out +summary: Scale-In/Out +author: Yao Qian +date: 2022-07-30 +--- + +# Scale-In/Out + +## What Is Scale-In/Out? + +Scale-in/out indicates that you can add database nodes to or delete database nodes from the existing database cluster to meet different service requirements. + +Terms: + +- **Scale-out**: Adds database nodes to the existing database cluster. +- **Scale-in**: Deletes database nodes from the existing database cluster. + +## Prerequisites + +Assume that you have a MogDB database cluster which can include a node or multiple nodes, and the cluster name is `CLUSTER_NAME`. + +During scale-out, make sure that the database version and configuration is consistent with the system environment, avoiding the incompatibility problem. + +> For details about how to install a database cluster, see [Database Installation](../install.md). + +## Scale-Out + +### View the Help Information + +``` +# ptk cluster scale-out -h +Perform scale-out for a MogDB cluster. + +Usage: + ptk cluster scale-out [flags] + +Examples: +ptk cluster -n scale-out -c scale-out.yaml + +Flags: + -y, --assumeyes Replies yes to all questions automatically. + -c, --config string Specifies the scale-in and scale-out configuration file path. + --cpu string Specifies the CPU model. + 'ptk candidate cpu' can be used for querying the supported CPU models. + --default-guc Specifies that GUC parameters are not automatically optimized. The default database parameters are used. + -h, --help help for scale-out + --skip-check-distro Skips the system release check. + --skip-check-os Skips the system check. + --skip-create-user Skips user creation. + --skip-rollback Skips rollback for installation failures. +``` + +#### Scale-Out Principle + +During scale-out, PTK randomly chooses a node in a cluster, packages static files such as the application and tool directories of the node, copies the package to the target machine, and then decompress it to a directory. + +PTK then uses a kernel tool to initiate a new data directory, and refreshes the cluster configuration file based on the topology of the new cluster. + +Note that nodes are scaled out one by one. When a node fails scale-out, scale-out is stopped, and the cluster configuration is refreshed for only cluster nodes that finish scale-out. + +### Create a Configuration File for Scale-Out + +The `ptk template` subcommand includes scale-out, and it can generate a basic scale-out configuration file template. + +``` +ptk template scale-out > scale-out.yaml +``` + +In this case, a scale-out configuration file named **scale-out.yaml** is created. You need to modify it as needed. + +The following introduces the scale-out configuration file template. + +``` +# The newly added database server list is the same as that during installation. +db_servers: + - host: "replace host ip here" + # The role can be "standby" (default) or "cascade_standby". + role: standby + ssh_option: + port: 22 + user: root + password: "encrypted ssh password by ptk" + +# CM component server list +# If a CM component is installed in a cluster before scale-out,, the CM server list needs to be specified. +# Typically, the CM server list is the same as that of the database. +# If only database or CM component on the new server is scaled out, the two server lists can be inconsistent. +cm_servers: + - host: "replace host ip here" +``` + +### Scale-Out Support Description + +| Original Cluster | Scale-Out Condition | Supported or Not | Solution | +| ------------------------- | ------------------- | ---------------- | ------------------------------------------------------------ | +| db1, db2 | db3 | Supported | | +| db1, db2 | cm1, cm2 | Not Supported | Uninstall the cluster and specify the `--install-cm` parameter to install the cluster again. | +| db1+cm1, db2+cm2, db3+cm3 | db4+cm4 | Supported | | +| db1+cm1, db2+cm2, db3+cm3 | db4 | Supported | | +| db1+cm1, db2+cm2, db3+cm3 | cm4 | Supported | | +| db1+cm1, db2+cm2, db3 | cm3 | Not Supported | Perform scale-in for db3 and perform scale-out for db3+cm3. | +| db1+cm1, db2+cm2, cm3 | db3 | Not Supported | Perform scale-in for cm3 and perform scale-out for db3+cm3. | + +### Scale-Out Command + +```shell +ptk cluster -n CLUSTER_NAME scale-out -c scale-out.yaml +``` + +## Scale-In + +### View the Help Information + +``` +# ptk cluster scale-in -h + +Perform scale-in for a MogDB cluster + +Usage: + ptk cluster scale-in [flags] + +Examples: +ptk cluster -n scale-in -H -H + +Flags: + -y, --assumeyes Replies yes to all questions automatically. + --force If the target host cannot be connected using SSH, forcibly delete the target instance from the configuration of the upgraded cluster node. + -h, --help help for scale-in + -H, --host stringArray Specifies the target IP address to be deleted. + --skip-clear-db Skips deletion of the directory of the target database. + --skip-clear-user Skips deletion of the system user of the target database. +``` + +### Scale-In Command + +``` +ptk cluster -n CLUSTER_NAME scale-in -H IP1 -H IP2 +``` + +The above command can remove database nodes whose IP addresses are `IP1` and `IP2` from a cluster. + +**Scale-in description** + +- Scale-in for one primary server, multiple standby servers, and multiple cascaded servers + +Assume that the cluster topology is as follows: + +``` + standby1 —— cascade_standby1 + / +primary + \ + standby2 —— cascade_standby2 +``` + +After deleting standby1, the topology is changed to the following one: + +``` + standby1 cascade_standby1 + / +primary / + \ / + standby2 —— cascade_standby2 +``` + +At this time, standby1 is not in the cluster but is independent of the cluster. + +That is to say, if a standby node is to be deleted, there is a cascaded standby node under the standby node, and there are multiple standby nodes, PTK will randomly choose a standby node to connect the cascaded standby node. + +- Scale-in for one primary server, one standby servers, and one cascaded servers + +Assume that the cluster topology is as follows: + +``` +primary —— standby1 —— cascade_standby1 +``` + +After deleting standby1, the topology is changed to the following one: + +``` +primary standby1 cascade_standby1 +``` + +At this time, three nodes are independent of each other. + +### Scale-In Support Description + +> Note: Scale-In supports only deletion of a node based on the node level of the IP address. + +| Original Cluster | Scale-In Condition | Supported or Not | Solution | +| ------------------------- | ------------------------- | ---------------- | ----------------------------------------------------------- | +| db1, db2, db3 | db3 | Supported | | +| db1+cm1, db2+cm2, db3+cm3 | db3+cm3 (same IP address) | Supported | | +| db1+cm1, db2+cm2, db3+cm3 | db3 | Not Supported | Perform scale-in for db3+cm3 and perform scale-out for cm3. | +| db1+cm1, db2+cm2, db3+cm3 | cm3 | Not Supported | Perform scale-in for db3+cm3 and perform scale-out for db3. | +| db1+cm1, db2+cm2, db3 | db3 | Supported | | +| db1+cm1, db2+cm2, cm3 | cm3 | Supported | | \ No newline at end of file diff --git a/product/en/docs-ptk/v0.6/usage/usage-self-upgrade.md b/product/en/docs-ptk/v0.6/usage/usage-self-upgrade.md new file mode 100644 index 0000000000000000000000000000000000000000..ef3337a95b9de65e98913b8c3d8bed6d1f2b0df3 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-self-upgrade.md @@ -0,0 +1,66 @@ +--- +title: Upgrading PTK +summary: Upgrading PTK +author: Yao Qian +date: 2022-07-30 +--- + +# Upgrading PTK + +## View the Help Information + +``` +$ ptk self -h + +Operate with the PTK installation package. + +Usage: + ptk self [command] + +Available Commands: + upgrade Download and automatically install PTK + +Flags: + -h, --help help for self +``` + +### Online Upgrade + +You can run the `self upgrade` command to upgrade PTK to the latest version. After the upgrade, you can run the `ptk -v` command to check the PTK version. + +Example: + +```shell +$ ptk self upgrade + +INFO[2022-07-30T10:26:36.197] downloading ptk_darwin_arm64.tar.gz... +> ptk_darwin_arm64.tar.gz: 4.86 MiB / 4.86 MiB [-------------------------------------------------------------------] 100.00% 7.48 MiB p/s 900ms +INFO[2022-07-30T10:26:37.701] download successfully +INFO[2022-07-30T10:26:37.831] upgrade ptk successfully +``` + +### Offline Upgrade + +Firstly, you need to download a package based on your operating system (the following link always shows you the packages of the latest versions): + +- MacOS ARM64: [ptk_darwin_arm64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_darwin_arm64.tar.gz) +- MacOS X86: [ptk_darwin_x86_64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_darwin_x86_64.tar.gz) +- Linux ARM64: [ptk_linux_arm64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_linux_arm64.tar.gz) +- Linux X86: [ptk_linux_x86_64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_linux_x86_64.tar.gz) +- Windows X86: [ptk_windows_x86_64.tar.gz](https://cdn-mogdb.enmotech.com/ptk/latest/ptk_windows_x86_64.tar.gz) + +Secondly, you need to put the PTK package in the PTK binary directory of the server where PTK is installed and decompress the package to override the old binary file. + +```shell +# which ptk +/root/.ptk/bin/ptk + +# cd /root/.ptk/bin/ +tar -xvf ptk_[os]_[arch]_.tar.gz +``` + +If the PTK version is later than 0.3, you can specify the `-p` parameter to perform the local upgrade. + +``` +# ptk self upgrade -p /path/to/ptk_[os]_[arch]_.tar.gz +``` diff --git a/product/en/docs-ptk/v0.6/usage/usage-uninstall.md b/product/en/docs-ptk/v0.6/usage/usage-uninstall.md new file mode 100644 index 0000000000000000000000000000000000000000..51d2aa543a2dc224fb65c922ab0ffc58904591b1 --- /dev/null +++ b/product/en/docs-ptk/v0.6/usage/usage-uninstall.md @@ -0,0 +1,23 @@ +--- +title: Uninstalling a Database Cluster +summary: Uninstalling a Database Cluster +author: Yao Qian +date: 2022-07-30 +--- + +# Uninstalling a Database Cluster + +During uninstallation, PTK will check whether the cluster is in the running status. A cluster in the running status cannot be uninstalled. You need to stop the cluster and then uninstall the cluster. + +> **Note**: +> Once a database is uninstalled, it cannot be recovered. Please execute operation with caution. + +You can run the `ptk uninstall -n CLUSTER_NAME` command on the server where PTK is installed to uninstall a cluster. + +To uninstall a cluster, you need to specify the cluster name, you can run the `ptk ls` command to query the cluster name. + +During uninstallation, PTK will ask you whether to delete the cluster topology information, system user, and database data. + +**Please perform operations with cautions, avoiding data loss due to incorrect operations.** + +> If you are sure to delete the data directory, PTK delete only the data directory and will not delete its parent directory. You need to manually delete the parent directory. diff --git a/product/en/docs-ptk/v0.6/yaml-grammar.md b/product/en/docs-ptk/v0.6/yaml-grammar.md new file mode 100644 index 0000000000000000000000000000000000000000..5a359b72fc35cb618c3ea29dd2ea5aafc132041d --- /dev/null +++ b/product/en/docs-ptk/v0.6/yaml-grammar.md @@ -0,0 +1,232 @@ +--- +title: Appendix-YAML Syntax +summary: Appendix-YAML Syntax +author: Yao Qian +date: 2022-09-16 +--- + +# Appendix: YAML Syntax + +PTK uses the configuration file in the YAML format because YAML is simple in syntax, intuitive in data structure, and convenient in comment addition. + +> **Note**: Spaces are used to show the hierarchical structure in YAML. Therefore, during configuration editing, pay attention to indentation. + +This document describes the YAML syntax to help users understand the PTK configuration file format easily. + +## Scalar and Collection + +According to [YAML specification](https://yaml.org/spec/1.2/spec.html), there are two types of collections and multiple types of scalars. + +The two types of collections include map and sequence. + +```yaml +map: + one: 1 + two: 2 + three: 3 + +sequence: + - one + - two + - three +``` + +The scalar value is a single value (which is contrary to the collection). + +## Scalar Type in YAML + +An integer or floating-point number is usually considered numeric if it is not quoted. + +```yaml +count: 1 +size: 2.34 +``` + +If An integer or floating-point number is quoted, it is considered a string. + +```yaml +count: "1" # <-- string, not int +size: '2.34' # <-- string, not float +``` + +Boolean is the same. + +```yaml +isGood: true # bool +answer: "true" # string +``` + +An empty string is called `null` not `nil`. + +**Note**: `port: "80"` is legal. It is possible to pass values through the template engine and YAML interpreter, but if PTK expects the port to be an integer, it will fail. + +In some cases, YAML node tags can be used to force inference of a specific type. + +```yaml +coffee: "yes, please" +age: !!str 21 +port: !!int "80" +``` + +As shown above, the `!!str` tells the interpreter that `age` is a string, even though it looks like an integer. Even if `port` is enclosed in quotes, it is treated as an integer. + +## String in YAML + +The data type of most data in YAML is string. There are multiple string methods in YAML. This section describes these methods and introduces how to use some of the methods. + +The following shows three single-row methods to declare a string. + +```yaml +way1: bare words +way2: "double-quoted strings" +way3: 'single-quoted strings' +``` + +Single row indicates that all characters must be put in one line. + +- Bare words are not quoted and escaped. Therefore, use characters with caution. + +- A double-quoted string can have specified characters escaped with a backslash. For example, you can use `\n` to wrap lines for `"\"Hello\", she said"`. +- A single-quoted string is not escaped, and only the single quotes need to be escaped with `'`. + +Additionally, you can declare a multi-row string. + +```yaml +coffee: | + Latte + Cappuccino + Espresso +``` + +The above refers to the string value of `coffee`, which is equivalent to `Latte\nCappuccino\nEspresso\n`. + +The second line following `|` must be correctly indented. + +```yaml +coffee: | + Latte + Cappuccino + Espresso + +``` + +As shown in the above example, `Latte` is indented incorrectly. As a result, the following error is reported: + +```shell +Error parsing file: error converting YAML to JSON: yaml: line 7: did not find expected key +``` + +In a template, adding a line similar to "# commented first line" in multi-row text can avoid this error. + +```yaml +coffee: | + # Commented first line + Latte + Cappuccino + Espresso + +``` + +No matter what the first line is, it will be saved and output to a string. If you need to output the file text to a configuration mapping, the comment should be the type required for reading this item. + +### Spaces in a Multi-Row String + +In the above example, `|` is used to express a multi-row string. Note that the string is followed by `\n`. If you need to remove the line break using the YAML processor, add `-` behind `|`. + +```yaml +coffee: |- + Latte + Cappuccino + Espresso +``` + +Here, the value of `coffee` is `Latte\nCappuccino\nEspresso` without `\n` at the end. + +In some cases, you may hope to reserve the spaces behind `|`, use `|+`. + +```yaml +coffee: |+ + Latte + Cappuccino + Espresso + + +another: value +``` + +Here, the value of `coffee` is `Latte\nCappuccino\nEspresso\n\n\n`. + +The indentation and line break will be reserved in the text. + +```yaml +coffee: |- + Latte + 12 oz + 16 oz + Cappuccino + Espresso +``` + +In the above example, the value of `coffee` is `Latte\n 12 oz\n 16 oz\nCappuccino\nEspresso`. + +### Collapsing a Multi-Row String + +Sometimes you need to show a string in multiple rows, but it can be interpreted as a long row. This is called collapse. To express a collapsed block, replace `|` with `>`. + +```yaml +coffee: > + Latte + Cappuccino + Espresso + + +``` + +In the above example, the value of `coffee` is `Latte Cappuccino Espresso\n`. Note that all line breaks will be converted to spaces except the last one. + +You can use `>-` to combine the space symbol and collapsing symbol to replace or cancel all new rows. + +In the collapsing syntax, indenting a text will reserve a symbol. + +```yaml +coffee: >- + Latte + 12 oz + 16 oz + Cappuccino + Espresso +``` + +The value of `coffee` is `Latte\n 12 oz\n 16 oz\nCappuccino Espresso`. Both the space and line break are reserved as part of the string. + +## YAML Is the Superset of JSON + +YAML is the superset of JSON, any legal JSON file should be a legal YAML file. + +```json +{ + "coffee": "yes, please", + "coffees": [ + "Latte", "Cappuccino", "Espresso" + ] +} +``` + +Another expression method of the above JSON is as follows: + +```yaml +coffee: yes, please +coffees: +- Latte +- Cappuccino +- Espresso +``` + +The two expression methods can be together used, therefore, use them with caution. + +```yaml +coffee: "yes, please" +coffees: [ "Latte", "Cappuccino", "Espresso"] +``` + +All three types can be interpreted into the same meaning. \ No newline at end of file diff --git a/product/en/docs-uqbar/v1.1/data-write/data-writing-method/Kafka-supported-for-importing-data-to-table.md b/product/en/docs-uqbar/v1.1/data-write/data-writing-method/Kafka-supported-for-importing-data-to-table.md index d962fbe1c61c13183e1ea2fff7f889d1e1fee615..2769353841bfb1a83bd4a7aec5a318edf7c1ee18 100644 --- a/product/en/docs-uqbar/v1.1/data-write/data-writing-method/Kafka-supported-for-importing-data-to-table.md +++ b/product/en/docs-uqbar/v1.1/data-write/data-writing-method/Kafka-supported-for-importing-data-to-table.md @@ -112,51 +112,51 @@ plugin.path=/usr/local/Cellar/confluentinc-kafka-connect-jdbc-10.5.2 - Method one: Start JDBC Connector. - - Open a Command Prompt or terminal to start JDBC Connector. - - ``` - curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d '{ - "name":"connector-name", - "config":{ - "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector", - "connection.url":"jdbc:opengauss://localhost:15432/OpengaussDB", - "connection.user":"user", - "connection.password":"password", - "topics":"test_topic", - "insert.mode": "insert", - "table.name.format":"table_name_${topic}", - "auto.create":true, - "dialect.name": "PostgreSqlDatabaseDialect" - } - }' - ``` + Open a Command Prompt or terminal to start JDBC Connector. + + ``` + curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d '{ + "name":"connector-name", + "config":{ + "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector", + "connection.url":"jdbc:opengauss://localhost:15432/OpengaussDB", + "connection.user":"user", + "connection.password":"password", + "topics":"test_topic", + "insert.mode": "insert", + "table.name.format":"table_name_${topic}", + "auto.create":true, + "dialect.name": "PostgreSqlDatabaseDialect" + } + }' + ``` - Method two: Create a JSON file to configure JDBC Connector. - - Create a JSON file named `test.json`, including the following content. - - ``` - { - "name":"connector-name", - "config":{ - "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector", - "connection.url":"jdbc:opengauss://localhost:15432/OpengaussDB", - "connection.user":"user", - "connection.password":"password", - "topics":"test_topic", - "insert.mode": "insert", - "table.name.format":"table_name_${topic}", - "auto.create":true, - "dialect.name": "PostgreSqlDatabaseDialect" - } - } - ``` - - Start Kafka in a Command Prompt or terminal. - - ``` - curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d @test.json - ``` + Create a JSON file named `test.json`, including the following content. + + ``` + { + "name":"connector-name", + "config":{ + "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector", + "connection.url":"jdbc:opengauss://localhost:15432/OpengaussDB", + "connection.user":"user", + "connection.password":"password", + "topics":"test_topic", + "insert.mode": "insert", + "table.name.format":"table_name_${topic}", + "auto.create":true, + "dialect.name": "PostgreSqlDatabaseDialect" + } + } + ``` + + Start Kafka in a Command Prompt or terminal. + + ``` + curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d @test.json + ``` - Method three: Use the Postman test tool. diff --git a/product/en/docs-uqbar/v1.1/toc.md b/product/en/docs-uqbar/v1.1/toc.md index ea27c59593779b2eea41dc751ad0a77617cd4ec8..6c21e5b9048b26e22e085671ea3470cac843d21b 100644 --- a/product/en/docs-uqbar/v1.1/toc.md +++ b/product/en/docs-uqbar/v1.1/toc.md @@ -20,9 +20,9 @@ + [Using Drivers to Write Data](/data-write/data-writing-method/driver-supported-for-importing-data-to-table.md) + [Using Kafka to Write Data](/data-write/data-writing-method/Kafka-supported-for-importing-data-to-table.md) + Time-Series Data Write Model - + [Single-Value and Multi-Value Model](/data-write/data-writing-model/single-field-and-multiple-field-model.md) - + [Out-of-Order Data Write](/data-write/data-writing-model/data-imported-out-of-order.md) - + [Wring Data Without the Time Field](/data-write/data-writing-model/data-imported-without-the-time-field.md) + + [Single-Field and Multi-Field Model](/data-write/data-writing-model/single-field-and-multiple-field-model.md) + + [Data Imported Out of Order](/data-write/data-writing-model/data-imported-out-of-order.md) + + [Data Imported Without the Time Field](/data-write/data-writing-model/data-imported-without-the-time-field.md) + [Time-Series Data Write Performance Indicator](/data-write/data-write-performance-indicator.md) + [Time-Series Data Compression](/data-compression.md) + [Deletion of Expired Time-Series Data](/expired-deletion.md) diff --git a/product/zh/docs-ptk/v0.5/usage/usage-help.md b/product/zh/docs-ptk/v0.5/usage/usage-help.md index 61efc771be55b84846dfe7ee7d16612506163a1e..26926cb7cf714f93cbf343939dee1f4c9b4f63ea 100644 --- a/product/zh/docs-ptk/v0.5/usage/usage-help.md +++ b/product/zh/docs-ptk/v0.5/usage/usage-help.md @@ -58,7 +58,7 @@ Use "ptk [command] --help" for more information about a command. ```shell $ ptk -v -PTK Version: v0.5.0 +PTK Version: v0.4.0 Go Version: go1.17.1 Build Date: 2022-09-14T09:32:14Z Git Hash: a9xa9e diff --git a/product/zh/docs-ptk/v0.6/gptk/gptk-installation.md b/product/zh/docs-ptk/v0.6/gptk/gptk-installation.md index 126be957508308d7f8b542fd688a3526c43fab4f..94c4be02a6c0d7c0a764f3d764957b445d16c8d6 100644 --- a/product/zh/docs-ptk/v0.6/gptk/gptk-installation.md +++ b/product/zh/docs-ptk/v0.6/gptk/gptk-installation.md @@ -87,6 +87,8 @@ date: 2023-01-17 ## pacman 包 +### 下载 + **x86_64** - [gptk-0.1.0-x86_64.pacman](https://cdn-mogdb.enmotech.com/gptk/v0.1.0/gptk-0.1.0-x86_64.pacman) diff --git a/product/zh/docs-ptk/v0.6/quick-start.md b/product/zh/docs-ptk/v0.6/quick-start.md index fa7bb04dbb4eb2824649da1d5bee28a6bf4f7f05..f34b6b3fc0383b56ca300b688d42bb4ab89b47b5 100644 --- a/product/zh/docs-ptk/v0.6/quick-start.md +++ b/product/zh/docs-ptk/v0.6/quick-start.md @@ -65,7 +65,7 @@ ptk demo Demo Summary: Database: -|cluste_name|host|user|port|status|message| +|cluster_name|host|user|port|status|message| |-----------|----|----|----|------|-------| |demo_gJyY|192.168.1.1|demo_user_gJyY|26000|start_success|success| @@ -74,10 +74,10 @@ Database Other Detail: |item|value| |-----------|--------| |db password |Demo@pwd_gJyY | -|base_dir | /home/demo_user_gJyY/demo | -|app_dir | /home/demo_user_gJyY/demo/app | -|data_dir | /home/demo_user_gJyY/demo/data | -|tool_dir | /home/demo_user_gJyY/demo/tool | +|base_dir | /home/demo_user_gJyY/demo | +|app_dir | /home/demo_user_gJyY/demo/app | +|data_dir | /home/demo_user_gJyY/demo/data | +|tool_dir | /home/demo_user_gJyY/demo/tool | |tmp_dir | /home/demo_user_gJyY/demo/tmp | Mode Compatibility: diff --git a/product/zh/docs-ptk/v0.6/usage/usage-help.md b/product/zh/docs-ptk/v0.6/usage/usage-help.md index f69f8727de254ac3627c48c3e92a3e8cc82d1201..3b5bbf12f483498b094d4493b3839bbe8ae5403f 100644 --- a/product/zh/docs-ptk/v0.6/usage/usage-help.md +++ b/product/zh/docs-ptk/v0.6/usage/usage-help.md @@ -7,7 +7,7 @@ date: 2022-05-30 ## 查看帮助 -当安装成功 PTK 以后,可以在终端运行 `ptk -h` 来查看帮助信息,关于命令参数的含义说明,请参考[命令介绍}](./../commands/ptk.md) +当安装成功 PTK 以后,可以在终端运行 `ptk -h` 来查看帮助信息,关于命令参数的含义说明,请参考[命令介绍](../commands/ptk.md) ``` PTK是一款部署和管理MogDB数据库集群的命令行工具 diff --git a/product/zh/docs-ptk/v0.6/usage/usage-mogha-operation.md b/product/zh/docs-ptk/v0.6/usage/usage-mogha-operation.md index 8c5a277eb38ad114cd4b8f6b1cadf9e51b891bb1..e2e4074db524d072aa88c08009a1b1c7c894a25c 100644 --- a/product/zh/docs-ptk/v0.6/usage/usage-mogha-operation.md +++ b/product/zh/docs-ptk/v0.6/usage/usage-mogha-operation.md @@ -9,12 +9,12 @@ date: 2022-09-15 PTK 支持基本的 MogHA 安装流程,需用户提供合法的 MogHA 配置文件,PTK 在安装前也会对配置文件进行校验 -### 在安装前请确认 +## 在安装前请确认 1. 集群是否正常状态 2. 目标机器是否有 MogHA 运行 -### 校验内容 +## 校验内容 1. 校验 db_user 是否为空且是否和集群内 db 用户一致; 2. 校验 db_port 是否为空且是否和集群内 db 端口一致以及端口是否被占用; @@ -24,7 +24,7 @@ PTK 支持基本的 MogHA 安装流程,需用户提供合法的 MogHA 配置 6. 校验 zone 中的 pinglist 和 hosts 字段内容; 7. 检验 lite_mode 模式; -### 部署模式 +## 部署模式 MogHA 分为 lite 部署模式和非 lite 部署模式 diff --git a/product/zh/docs-uqbar/v1.1/data-write/data-writing-method/Kafka-supported-for-importing-data-to-table.md b/product/zh/docs-uqbar/v1.1/data-write/data-writing-method/Kafka-supported-for-importing-data-to-table.md index 29777cf5d9ecfe49450d2c186b046ae95011be79..e864491c20f7ef221a335394a4b40066ce8d0063 100644 --- a/product/zh/docs-uqbar/v1.1/data-write/data-writing-method/Kafka-supported-for-importing-data-to-table.md +++ b/product/zh/docs-uqbar/v1.1/data-write/data-writing-method/Kafka-supported-for-importing-data-to-table.md @@ -112,51 +112,51 @@ plugin.path=/usr/local/Cellar/confluentinc-kafka-connect-jdbc-10.5.2 - 方式一:启动JDBC Connector - - 通过终端或cmd 启动JDBC Connector。 - - ``` - curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d '{ - "name":"connector-name", - "config":{ - "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector", - "connection.url":"jdbc:opengauss://localhost:15432/OpengaussDB", - "connection.user":"user", - "connection.password":"password", - "topics":"test_topic", - "insert.mode": "insert", - "table.name.format":"table_name_${topic}", - "auto.create":true, - "dialect.name": "PostgreSqlDatabaseDialect" - } - }' - ``` + 通过终端或cmd 启动JDBC Connector。 + + ``` + curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d '{ + "name":"connector-name", + "config":{ + "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector", + "connection.url":"jdbc:opengauss://localhost:15432/OpengaussDB", + "connection.user":"user", + "connection.password":"password", + "topics":"test_topic", + "insert.mode": "insert", + "table.name.format":"table_name_${topic}", + "auto.create":true, + "dialect.name": "PostgreSqlDatabaseDialect" + } + }' + ``` - 方式二:创建json文件配置 JDBC Connector。 - - 创建名为`test.json`的json文件,内容如下: - - ``` - { - "name":"connector-name", - "config":{ - "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector", - "connection.url":"jdbc:opengauss://localhost:15432/OpengaussDB", - "connection.user":"user", - "connection.password":"password", - "topics":"test_topic", - "insert.mode": "insert", - "table.name.format":"table_name_${topic}", - "auto.create":true, - "dialect.name": "PostgreSqlDatabaseDialect" - } - } - ``` - - 在终端或cmd启动Kafka。 - - ``` - curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d @test.json - ``` + 创建名为`test.json`的json文件,内容如下: + + ``` + { + "name":"connector-name", + "config":{ + "connector.class":"io.confluent.connect.jdbc.JdbcSinkConnector", + "connection.url":"jdbc:opengauss://localhost:15432/OpengaussDB", + "connection.user":"user", + "connection.password":"password", + "topics":"test_topic", + "insert.mode": "insert", + "table.name.format":"table_name_${topic}", + "auto.create":true, + "dialect.name": "PostgreSqlDatabaseDialect" + } + } + ``` + + 在终端或cmd启动Kafka。 + + ``` + curl -X POST http://localhost:8083/connectors -H "Content-Type: application/json" -d @test.json + ``` - 方式三:使用Postman等接口测试工具