tencent cloud

Feedback

Parameter Configuration

Last updated: 2022-04-18 09:47:27

    Feature Overview

    This document describes how to manage clusters in the console. You can adopt either the key-value or XML mode in the ClickHouse cluster configuration management feature based on your usage habits to modify key parameters and push the modified configuration file content to the nodes in the cluster.

    Feature Description

    • By default, the key-value mode applies to parameter configuration for legacy clusters created before August 2021, while the XML mode applies to those created afterward. If you need to manage a legacy cluster in XML mode, contact us for assistance.
      Note:

      Currently, cluster parameter configuration is available in either key-value or XML mode. New clusters support the key-value mode by default, but you can also switch to the XML mode irreversibly.

    • Before using the following features, we recommend you contact technical support to confirm your current configuration file content if you have submitted a ticket to have your cluster configuration maintained or modified by technical support.

    Directions

    1. Log in to the Cloud Data Warehouse console, select the target cluster in Cluster List, click Name/ID to enter the cluster details page, and click Parameter Configuration.

    2. On the Parameter Configuration tab for existing clusters, parameters can be configured in key-value mode and come from the config.xml file. After a parameter is modified, click Apply to Cluster for the modification to take effect.

    3. For new clusters or existing clusters with the parameter configuration mode switched to XML, the Parameter Configuration tab displays parameter configurations in XML mode. Currently, you can view and edit parameters in config.xml, metrika.xml, and users.xml files as shown below.

      You can edit a configuration file and click Save Configuration.

      You can view the modification through Details.

      After confirming that the modification is correct, click Save and Deliver to commit it to the nodes in the cluster.

    4. The cluster will enter the Changing status, and the prompt "Configuration has changed. Please restart" will be displayed. Determine whether a restart is needed according to the specific modification, and if so, click Restart in the top-right corner.

    5. After the modification is committed, you can view the modification history of the configuration file and the comparison details of each modification in Modification History.

    Notes

    • Configuration items should not be added to the configuration file if they are not supported by the ClickHouse kernel, so as to avoid startup failures or other issues. For more information on supported configurations, see Server Settings.
    • In the metrika.xml file in XML mode, you can only modify the following configuration items and content.
      <yandex>
        <clickhouse_remote_servers>
            <default_cluster>
                <shard>
                    <internal_replication></internal_replication>
                    <replica>
                        <host></host>
                        <second_host></second_host>
                        <port></port>
                        <user></user>
                        <password></password>
                    </replica>
                </shard>
            </default_cluster>
            <new_cluster_1>
                <shard>
                    <internal_replication></internal_replication>
                    <replica>
                        <host></host>
                        <second_host></second_host>
                        <port></port>
                        <user></user>
                        <password></password>
                    </replica>
                </shard>
            </new_cluster_1>
        </clickhouse_remote_servers>
        <zookeeper-servers>
            <node>
                <host></host>
                <port></port>
            </node>
        </zookeeper-servers>
      </yandex>
      

    Here, new_cluster_1 indicates the name of a new cluster supported and second_host is an enhancement parameter for the ClickHouse kernel (v20.8.7.15 only for the time being).

    • The port cannot be modified, and the host IP address cannot be set to other IP addresses or those of other clusters. There are two IP addresses for one node: one is the host IP in the metrika.xml file generated by default, and the other can be found in Basic Information > Network Information. The former is used for backend management, while the latter for user access. IP addresses in metrika.xml should be those in non-user VPCs.
    • We recommend you use only metrika.xml to maintain the above information related to clusters and ZooKeeper. If unsupported configuration items are added to metrika.xml, you may face the risk of invalidity or loss even if the modification is committed successfully. More configuration items will be supported in metrika.xml in the future, which will be described in the documentation accordingly.
    • In addition, you should not modify ClickHouse management and control information such as port numbers and log paths in config.xml, so as to avoid possible operation and management exceptions. We recommend you only modify operation configuration items such as those related to performance, compression algorithms, and MergeTree, but do not modify the following items:
    <yandex>
      <logger>
         <level>trace</level>
          <log>/data/clickhouse/clickhouse-server/logs/clickhouse-server.log</log>
          <errorlog>/data/clickhouse/clickhouse-server/logs/clickhouse-server.err.log</errorlog>
          <size>1000 MB</size>
          <count>10</count>
      </logger>
      <http_port>8123</http_port>
      <tcp_port>9000</tcp_port>
      <mysql_port>9004</mysql_port>
      <interserver_http_port>9009</interserver_http_port>
      <path>/data/clickhouse/clickhouse-server/</path>
      <tmp_path>/data/clickhouse/clickhouse-server/tmp/</tmp_path>
      <user_files_path>/data/clickhouse/clickhouse-server/user_files/</user_files_path>
      <users_config>users.xml</users_config>
      <timezone>Asia/Shanghai</timezone> 
      <mlock_executable>true</mlock_executable> 
      <remote_servers incl="clickhouse_remote_servers" /> 
      <zookeeper incl="zookeeper-servers" optional="true" /> 
      <macros incl="macros" optional="true" /> 
      <prometheus> 
          <endpoint>/metrics</endpoint> 
          <port>9363</port> 
          <metrics>true</metrics> 
          <events>true</events> 
          <asynchronous_metrics>true</asynchronous_metrics> 
      </prometheus> 
      <query_log> 
          <database>system</database> 
          <table>query_log</table> 
          <partition_by>toYYYYMM(event_date)</partition_by> 
          <flush_interval_milliseconds>7500</flush_interval_milliseconds> 
      </query_log> 
      <trace_log> 
          <database>system</database> 
          <table>trace_log</table> 
          <partition_by>toYYYYMM(event_date)</partition_by> 
          <flush_interval_milliseconds>7500</flush_interval_milliseconds> 
      </trace_log> 
      <query_thread_log> 
          <database>system</database> 
          <table>query_thread_log</table> 
          <partition_by>toYYYYMM(event_date)</partition_by> 
          <flush_interval_milliseconds>7500</flush_interval_milliseconds> 
      </query_thread_log> 
      <compression incl="clickhouse_compression"> 
      </compression> 
      <distributed_ddl> 
          <path>/clickhouse/task_queue/ddl</path> 
      </distributed_ddl> 
      <listen_host>0.0.0.0</listen_host> 
      <zookeeper incl="zookeeper-servers" optional="true" /> 
      <macros incl="macros" optional="true" /> 
      <include_from>/etc/clickhouse-server/metrika.xml</include_from> 
    </yandex> 
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support