All Products
Search
Document Center

ApsaraDB for ClickHouse:Set parameters in the user.xml file

Last Updated:May 25, 2023

This topic describes how to change the values of the parameters in the user.xml file of an ApsaraDB for ClickHouse cluster.

Background information

Several parameters can be set for an ApsaraDB for ClickHouse cluster. The default parameter values are set in the config.xml file and the user.xml file. You can improve the performance of the ApsaraDB for ClickHouse cluster by changing the parameter values in the configuration files.

  • If you want to change the parameter values in the config.xml file, you can change the parameter values in the ApsaraDB for ClickHouse console and restart the ApsaraDB for ClickHouse cluster to make the modifications take effect. For more information, see Set parameters in the config.xml file.

  • If you want to change the parameter values in the user.xml file, you can execute the set global statements. After the parameter values are changed, you do not need to restart the cluster to make the changes take effect.

Precautions

The values of the parameters in the user.xml file cannot be changed by using the clickhouse-client tool. You can connect to your ApsaraDB for ClickHouse cluster by using the Data Management (DMS) console and execute the set statements to change the values of the parameters in the user.xml file. For more information about how to connect to an ApsaraDB for ClickHouse cluster by using the DMS console, see Use DMS to connect to an ApsaraDB for ClickHouse cluster. For more information about operation methods, see Operation methods in this topic.

Syntax

Statement used to set parameters

set global on cluster default key = value;

If the value of the value parameter is a Boolean value or a string, the value of the value parameter must be enclosed by using single quotation marks (' '). Sample statements:

set global on cluster default max_block_size=10000;
set global on cluster default totals_mode='any';
set global on cluster default input_format_parallel_parsing='True';
Note

For more information about the parameters that are supported by ApsaraDB for ClickHouse, see the Core Settings topic of the open source ClickHouse documentation.

Statement used to query parameter values

select * from system.settings;

Operation methods

  • Set the parameters by using the DMS console

    Connect to your ApsaraDB for ClickHouse cluster by using the DMS console, and execute the set statements to set the parameters.

  • Set the parameters by using a client tool

    Connect to your ApsaraDB for ClickHouse cluster by using a client tool such as DBeaver. Then, execute the set statements in the same way as you execute regular DDL statements to set the parameters.

  • Set the parameters by using a Java Database Connectivity (JDBC) connection

    Write Java code to establish a JDBC connection to your ApsaraDB for ClickHouse cluster, and execute the set statements to set the parameters. For more information about how to connect to an ApsaraDB for ClickHouse cluster by using JDBC, see Use JDBC to connect to an ApsaraDB for ClickHouse cluster.