Help Center/ TaurusDB/ API Reference/ APIs (Recommended)/ HTAP (Lightweight Edition)/ Checking Database Configurations for Data Synchronization
Updated on 2024-09-11 GMT+08:00

Checking Database Configurations for Data Synchronization

Function

This API is used to check database configurations for data synchronization. Before calling this API:

URI

POST /v3/{project_id}/instances/{instance_id}/clickhouse/replication/database-check

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

ClickHouse instance ID, which is compliant with the UUID format.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

To obtain this value, call the IAM API for obtaining a user token.

The value of X-Subject-Token in the response header is the token value.

X-Language

No

String

Request language type. The default value is en-us.

Values:

  • en-us
  • zh-cn
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

source_instance_id

Yes

String

Source instance ID, which is compliant with the UUID format.

source_node_id

No

String

Source node ID. GaussDB(for MySQL) read replica ID. If this parameter is left blank, the ID of the primary node is used.

source_database_name

Yes

String

Source database name.

db_configs

Yes

Array of ChDatabaseConfigsInfo objects

Database configurations.

table_repl_config

Yes

ChDatabaseTableReplConfigInfo object

Table configurations.

Table 4 ChDatabaseConfigsInfo

Parameter

Mandatory

Type

Description

param_name

Yes

String

Name of the database synchronization configuration parameter. To obtain this value, see Querying Database Parameter Settings for Data Synchronization.

value

Yes

String

Value of the database synchronization configuration parameter.

Table 5 ChDatabaseTableReplConfigInfo

Parameter

Mandatory

Type

Description

repl_type

Yes

String

Table synchronization type. Values:

  • white_list: whitelist. In this case, tables cannot be left blank.
  • black_list: blacklist. If tables are left blank, all tables are selected.

tables

Yes

Array of strings

Tables listed on the whitelist or blacklist.

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

database_name

String

Source database name.

db_config_check_results

Array of ChDatabaseConfigCheckResult objects

Check result of the source database configurations.

Table 7 ChDatabaseConfigCheckResult

Parameter

Type

Description

param_name

String

Name of the database synchronization configuration parameter.

value

String

Value of the database synchronization configuration parameter.

check_result

String

Check result. Values:

  • success
  • fail

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Checking database configurations for data synchronization

POST https://{localhost}/v3/23a50154cf494ec9ad6883979a12db0a/instances/54e42160670e48e789af7075e1efea1fin16/clickhouse/replication/database-check

{
  "source_database_name" : "blackwhite_0018_61474479",
  "db_configs" : [ {
    "param_name" : "default_isolation_level",
    "value" : "QUERY_SNAPSHOT"
  } ],
  "table_replconfig" : {
    "repl_type" : "black_list",
    "tables" : [ ]
  },
  "source_instance_id" : "77aa4096cb824a61b93dab5ca00ecc8fin07",
  "source_node_id" : "57bfeacf6e8d4eb685ea907372374b35no07"
}

Example Response

Status code: 200

Success.

{
  "database_name" : "blackwhite_0017_22525694",
  "db_config_check_results" : [ {
    "param_name" : "default_isolation_level",
    "value" : "QUERY_SNAPSHOT",
    "check_result" : "success"
  }, {
    "param_name" : "enable_snapshots",
    "value" : "true",
    "check_result" : "success"
  }, {
    "param_name" : "enable_chunk_level",
    "value" : "true",
    "check_result" : "success"
  }, {
    "param_name" : "max_sync_threads",
    "value" : "1",
    "check_result" : "success"
  }, {
    "param_name" : "treat_numeric_string_as_integer",
    "value" : "false",
    "check_result" : "success"
  }, {
    "param_name" : "min_binlog_expire_logs_seconds",
    "value" : "86400",
    "check_result" : "success"
  }, {
    "param_name" : "max_rows_in_buffer",
    "value" : "2000000",
    "check_result" : "success"
  }, {
    "param_name" : "max_rows_in_buffers",
    "value" : "6000000",
    "check_result" : "success"
  }, {
    "param_name" : "max_bytes_in_buffer",
    "value" : "200000000",
    "check_result" : "success"
  }, {
    "param_name" : "max_bytes_in_buffers",
    "value" : "600000000",
    "check_result" : "success"
  }, {
    "param_name" : "max_flush_data_time",
    "value" : "5000",
    "check_result" : "success"
  } ]
}

Status Code

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Code

For details, see Error Codes.