Consulta de configurações de parâmetros de banco de dados para sincronização de dados
Função
Essa API é usada para consultar configurações de parâmetros do banco de dados para sincronização de dados. Antes de chamar essa API:
- Saiba como autorizá-la e autenticá-la.
- Obtenha a região e o ponto de extremidade necessários.
URI
GET /v3/{project_id}/instances/{instance_id}/clickhouse/replication/database-parameter
Parâmetro |
Obrigatório |
Tipo |
Descrição |
---|---|---|---|
project_id |
Sim |
String |
ID do projeto de um locatário numa região. Para obter esse valor, consulte Obtenção de um ID de projeto. |
instance_id |
Sim |
String |
ID da instância do ClickHouse, que é compatível com o formato UUID. |
Parâmetros de solicitação
Parâmetro |
Obrigatório |
Tipo |
Descrição |
---|---|---|---|
X-Auth-Token |
Sim |
String |
Token do usuário. Para obter esse valor, chame a API do IAM para obter um token de usuário. O valor de X-Subject-Token no cabeçalho da resposta é o valor do token. |
X-Language |
Não |
String |
Tipo de linguagem da solicitação. O valor padrão é en-us. Valores:
|
Parâmetros de resposta
Código de status: 200
Parâmetro |
Tipo |
Descrição |
---|---|---|
db_parameters |
Array of ChDatabaseParameterInfo objects |
Parâmetros do banco de dados. |
Parâmetro |
Tipo |
Descrição |
---|---|---|
param_name |
String |
Nome do parâmetro. |
data_type |
String |
Tipo de parâmetro. |
default_value |
String |
Valor padrão do parâmetro. |
value_range |
String |
Intervalo de valores do parâmetro. |
description |
String |
Descrição do parâmetro. |
Código de status: 400
Parâmetro |
Tipo |
Descrição |
---|---|---|
error_code |
String |
Código de erro. |
error_msg |
String |
Mensagem de erro. |
Código de status: 500
Parâmetro |
Tipo |
Descrição |
---|---|---|
error_code |
String |
Código de erro. |
error_msg |
String |
Mensagem de erro. |
Exemplo de solicitação
Consulta de configurações de parâmetros de banco de dados para sincronização de dados de uma instância
GET https://{localhost}/v3/23a50154cf494ec9ad6883979a12db0a/instances/54e42160670e48e789af7075e1efea1fin16/clickhouse/replication/database-parameter
Exemplo de resposta
Código de status: 200
Bem-sucedido.
{ "db_parameters" : [ { "param_name" : "default_isolation_level", "data_type" : "String", "default_value" : "QUERY_SNAPSHOT", "value_range" : "READ_COMMITTED|READ_UNCOMMITTED|QUERY_RAW|QUERY_SNAPSHOT", "description" : "Controls the default isolation level. This parameter is only suitable for the MaterializeMySQL engine. read_uncommitted: MVCC is not supported. read_committed: Transactional integrity in queries (including subqueries) is preserved. query_snapshot: Transactional integrity is preserved and duplicate and deleted rows are removed at the cost of data freshness." }, { "param_name" : "enable_snapshots", "data_type" : "String", "default_value" : "true", "value_range" : "true|false", "description" : "Disables or enables snapshots. This parameter can be set to true only when mvcc_isolation_level is set to query_snapshot." }, { "param_name" : "enable_chunk_level", "data_type" : "String", "default_value" : "true", "value_range" : "true|false", "description" : "Enables or disables chunk-level parallel replication." }, { "param_name" : "max_sync_threads", "data_type" : "Integer", "default_value" : "1", "value_range" : "1-2", "description" : "Controls the maximum number of threads for full replication." }, { "param_name" : "treat_numeric_string_as_integer", "data_type" : "String", "default_value" : "false", "value_range" : "true|false", "description" : "Controls whether numeric strings are treated as integers during block-level task generation during full synchronization." }, { "param_name" : "min_binlog_expire_logs_seconds", "data_type" : "Integer", "default_value" : "86400", "value_range" : "0-2592000", "description" : "Controls the minimum duration for storing binlogs. If the duration for storing binlogs is less than the threshold, a synchronization failure is reported. 0 indicates that the duration is not limited." }, { "param_name" : "max_rows_in_buffer", "data_type" : "Integer", "default_value" : "2000000", "value_range" : "1-10000000", "description" : "Controls the maximum number of rows of data that is allowed to be cached in memory (for a single table and any cache data that cannot be queried). When the number of rows exceeds this parameter value, the data will be materialized." }, { "param_name" : "max_rows_in_buffers", "data_type" : "Integer", "default_value" : "6000000", "value_range" : "1-10000000", "description" : "Controls the maximum number of rows of data that is allowed to be cached in memory (for databases and cache data that cannot be queried). When the number of rows exceeds this parameter value, the data will be materialized." }, { "param_name" : "max_bytes_in_buffer", "data_type" : "Integer", "default_value" : "200000000", "value_range" : "1-1000000000", "description" : "Controls the maximum number of bytes of data that is allowed to be cached in memory (for a single table and any cache data that cannot be queried). When the number of bytes exceeds the parameter value, the data will be materialized." }, { "param_name" : "max_bytes_in_buffers", "data_type" : "Integer", "default_value" : "600000000", "value_range" : "1-1000000000", "description" : "Controls the maximum number of bytes of data that is allowed to be cached in memory (for databases and any cache data that cannot be queried). When the number of bytes exceeds the parameter value, the data will be materialized." }, { "param_name" : "max_flush_data_time", "data_type" : "Integer", "default_value" : "5000", "value_range" : "1-10000", "description" : "Controls how long that data is cached in the memory, in milliseconds." } ] }
Código de status
Código de status |
Descrição |
---|---|
200 |
Bem-sucedido. |
400 |
Erro do cliente. |
500 |
Erro no servidor. |
Código de erro
Para obter detalhes, consulte Códigos de erro.