tencent cloud


Configuration Description

Last updated: 2021-03-03 19:32:50

    The ClickHouse server configuration files are located in /etc/clickhouse-server and include config.xml, metrika.xml, and users.xml, among which config.xml is the primary configuration file of the ClickHouse server.


    Under the conf.d and config.d folders at the same level as the config.xml configuration file, you can create an *.xml file to override the configurations in the config.xml file (however, you are not recommended to do so; instead, you are recommended to centrally distribute configurations by using the configuration delivery feature in the console).

    For example, create a config.d directory at the same level as the config.xml file:

    1. Modify the TCP port listened on by the clickhouse-server, which is port 9000 in the config.xml file by default. Create a tcp_port.xml file in the config.d folder and add the following content to it:
      Restart the clickhouse-server and you can find that the TCP port listened on has been changed to 9000.
    2. Add the metric_log configuration. Create a metric_log.xml file and add the following content to it:
      Restart the clickhouse-server and clickhouse-client and run SELECT * FROM system.metric_log LIMIT 1 FORMAT Vertical; to create the system.metric_log table automatically.


    ClickHouse configurations can be "replaced". You can use the incl attribute to replace configurations in config.xml with those in the specified file, so that the primary configuration file will not become too redundant or hard to maintain. In the default config.xml configuration file, you can see that the three tags <remote_servers>, <macros>, and <zookeeper> all have the incl attribute. Therefore, you can load the corresponding <clickhouse_remote_servers>, <macros>, and <zookeeper-servers> configuration items in the metrika.xml file into the config.xml file. The path of the file for replacement is /etc/metrika.xml by default and can be modified through the <include_from> configuration item.


    If the configuration items to be replaced in the incl attribute do not exist, the event will be recorded in a log. If you do not want to log such events, you can use the optional="true" attribute.


    In the config.xml configuration file, users_config indicates the path of the user-related configuration file, which is users.xml by default. In users.xml, you can configure information such as user password, permission, profile, and quota. Different users can have different configurations.

    You can create a users.d directory in the user.xml statistics directory and add user-related configurations (e.g., /etc/clickhouse-server/users.d/testUser.xml) under it so as to reduce redundancy of the users.xml file and simplify the maintenance.


    For the specific server parameter configurations and settings, please see Server Settings and Settings on the official website.

    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