2020-04-03 13:23:32 +00:00
---
toc_priority: 57
toc_title: Server Settings
---
2020-03-20 10:10:48 +00:00
# Server Settings {#server-settings}
2017-12-28 15:13:23 +00:00
2020-10-13 17:23:29 +00:00
## builtin_dictionaries_reload_interval {#builtin-dictionaries-reload-interval}
2017-12-28 15:13:23 +00:00
The interval in seconds before reloading built-in dictionaries.
2020-03-20 10:10:48 +00:00
ClickHouse reloads built-in dictionaries every x seconds. This makes it possible to edit dictionaries “on the fly” without restarting the server.
2017-12-28 15:13:23 +00:00
Default value: 3600.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< builtin_dictionaries_reload_interval > 3600< / builtin_dictionaries_reload_interval >
```
2020-03-18 18:43:51 +00:00
## compression {#server-settings-compression}
2017-12-28 15:13:23 +00:00
2020-04-30 18:19:18 +00:00
Data compression settings for [MergeTree ](../../engines/table-engines/mergetree-family/mergetree.md )-engine tables.
2017-12-28 15:13:23 +00:00
2020-03-20 10:10:48 +00:00
!!! warning "Warning"
Don’ t use it if you have just started using ClickHouse.
2017-12-28 15:13:23 +00:00
2020-01-16 16:53:56 +00:00
Configuration template:
2017-12-28 15:13:23 +00:00
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< compression >
< case >
2020-01-16 16:53:56 +00:00
< min_part_size > ...< / min_part_size >
< min_part_size_ratio > ...< / min_part_size_ratio >
< method > ...< / method >
2017-12-28 15:13:23 +00:00
< / case >
...
< / compression >
```
2020-01-16 16:53:56 +00:00
`<case>` fields:
2017-12-28 15:13:23 +00:00
2020-03-21 04:11:51 +00:00
- `min_part_size` – The minimum size of a data part.
- `min_part_size_ratio` – The ratio of the data part size to the table size.
- `method` – Compression method. Acceptable values: `lz4` or `zstd` .
2017-12-28 15:13:23 +00:00
2020-01-16 16:53:56 +00:00
You can configure multiple `<case>` sections.
2017-12-28 15:13:23 +00:00
2020-01-16 16:53:56 +00:00
Actions when conditions are met:
2020-03-21 04:11:51 +00:00
- If a data part matches a condition set, ClickHouse uses the specified compression method.
- If a data part matches multiple condition sets, ClickHouse uses the first matched condition set.
2020-01-16 16:53:56 +00:00
If no conditions met for a data part, ClickHouse uses the `lz4` compression.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< compression incl = "clickhouse_compression" >
< case >
< min_part_size > 10000000000< / min_part_size >
< min_part_size_ratio > 0.01< / min_part_size_ratio >
< method > zstd< / method >
< / case >
< / compression >
```
2020-09-28 02:59:01 +00:00
## custom_settings_prefixes {#custom_settings_prefixes}
List of prefixes for [custom settings ](../../operations/settings/index.md#custom_settings ). The prefixes must be separated with commas.
**Example**
```xml
< custom_settings_prefixes > custom_< / custom_settings_prefixes >
```
**See Also**
- [Custom settings ](../../operations/settings/index.md#custom_settings )
2020-09-28 15:01:28 +00:00
## core_dump
Configures soft limit for core dump file size, one gigabyte by default.
```xml
< core_dump >
< size_limit > 1073741824< / size_limit >
< / core_dump >
```
(Hard limit is configured via system tools)
2020-10-13 17:23:29 +00:00
## default_database {#default-database}
2017-12-28 15:13:23 +00:00
The default database.
2020-04-30 18:19:18 +00:00
To get a list of databases, use the [SHOW DATABASES ](../../sql-reference/statements/show.md#show-databases ) query.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< default_database > default< / default_database >
```
2020-10-13 17:23:29 +00:00
## default_profile {#default-profile}
2017-12-28 15:13:23 +00:00
Default settings profile.
2018-12-18 11:32:08 +00:00
Settings profiles are located in the file specified in the parameter `user_config` .
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< default_profile > default< / default_profile >
```
2020-10-13 17:23:29 +00:00
## dictionaries_config {#server_configuration_parameters-dictionaries_config}
2017-12-28 15:13:23 +00:00
The path to the config file for external dictionaries.
Path:
2020-03-21 04:11:51 +00:00
- Specify the absolute path or the path relative to the server config file.
- The path can contain wildcards \* and ?.
2017-12-28 15:13:23 +00:00
2020-04-30 18:19:18 +00:00
See also “[External dictionaries](../../sql-reference/dictionaries/external-dictionaries/external-dicts.md)”.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< dictionaries_config > *_dictionary.xml< / dictionaries_config >
```
2020-10-13 17:23:29 +00:00
## dictionaries_lazy_load {#server_configuration_parameters-dictionaries_lazy_load}
2017-12-28 15:13:23 +00:00
Lazy loading of dictionaries.
2018-09-04 11:18:59 +00:00
If `true` , then each dictionary is created on first use. If dictionary creation failed, the function that was using the dictionary throws an exception.
2017-12-28 15:13:23 +00:00
If `false` , all dictionaries are created when the server starts, and if there is an error, the server shuts down.
2018-09-04 11:18:59 +00:00
The default is `true` .
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< dictionaries_lazy_load > true< / dictionaries_lazy_load >
```
2020-10-13 17:23:29 +00:00
## format_schema_path {#server_configuration_parameters-format_schema_path}
2017-12-28 15:13:23 +00:00
2018-12-21 19:23:55 +00:00
The path to the directory with the schemes for the input data, such as schemas for the [CapnProto ](../../interfaces/formats.md#capnproto ) format.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2018-03-25 02:04:22 +00:00
<!-- Directory containing schema files for various input formats. -->
2017-12-28 15:13:23 +00:00
< format_schema_path > format_schemas/< / format_schema_path >
```
2020-04-03 13:23:32 +00:00
## graphite {#server_configuration_parameters-graphite}
2017-12-28 15:13:23 +00:00
Sending data to [Graphite ](https://github.com/graphite-project ).
Settings:
2020-03-21 04:11:51 +00:00
- host – The Graphite server.
- port – The port on the Graphite server.
- interval – The interval for sending, in seconds.
- timeout – The timeout for sending data, in seconds.
2020-10-13 17:23:29 +00:00
- root_path – Prefix for keys.
2020-06-18 08:24:31 +00:00
- metrics – Sending data from the [system.metrics ](../../operations/system-tables/metrics.md#system_tables-metrics ) table.
- events – Sending deltas data accumulated for the time period from the [system.events ](../../operations/system-tables/events.md#system_tables-events ) table.
2020-10-13 17:23:29 +00:00
- events_cumulative – Sending cumulative data from the [system.events ](../../operations/system-tables/events.md#system_tables-events ) table.
- asynchronous_metrics – Sending data from the [system.asynchronous_metrics ](../../operations/system-tables/asynchronous_metrics.md#system_tables-asynchronous_metrics ) table.
2017-12-28 15:13:23 +00:00
You can configure multiple `<graphite>` clauses. For instance, you can use this for sending different data at different intervals.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< graphite >
< host > localhost< / host >
< port > 42000< / port >
< timeout > 0.1< / timeout >
< interval > 60< / interval >
< root_path > one_min< / root_path >
< metrics > true< / metrics >
< events > true< / events >
2019-09-22 22:57:06 +00:00
< events_cumulative > false< / events_cumulative >
2017-12-28 15:13:23 +00:00
< asynchronous_metrics > true< / asynchronous_metrics >
< / graphite >
```
2020-10-13 17:23:29 +00:00
## graphite_rollup {#server_configuration_parameters-graphite-rollup}
2017-12-28 15:13:23 +00:00
Settings for thinning data for Graphite.
2020-04-30 18:19:18 +00:00
For more details, see [GraphiteMergeTree ](../../engines/table-engines/mergetree-family/graphitemergetree.md ).
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< graphite_rollup_example >
< default >
< function > max< / function >
< retention >
< age > 0< / age >
< precision > 60< / precision >
< / retention >
< retention >
< age > 3600< / age >
< precision > 300< / precision >
< / retention >
< retention >
< age > 86400< / age >
< precision > 3600< / precision >
< / retention >
< / default >
< / graphite_rollup_example >
```
2020-10-13 17:23:29 +00:00
## http_port/https_port {#http-porthttps-port}
2017-12-28 15:13:23 +00:00
The port for connecting to the server over HTTP(s).
2020-04-03 13:23:32 +00:00
If `https_port` is specified, [openSSL ](#server_configuration_parameters-openssl ) must be configured.
2017-12-28 15:13:23 +00:00
2020-03-19 08:31:06 +00:00
If `http_port` is specified, the OpenSSL configuration is ignored even if it is set.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2020-05-15 13:14:39 +00:00
< https_port > 9999< / https_port >
2017-12-28 15:13:23 +00:00
```
2020-10-13 17:23:29 +00:00
## http_server_default_response {#server_configuration_parameters-http_server_default_response}
2017-12-28 15:13:23 +00:00
The page that is shown by default when you access the ClickHouse HTTP(s) server.
2020-03-20 10:10:48 +00:00
The default value is “Ok.” (with a line feed at the end)
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
Opens `https://tabix.io/` when accessing `http://localhost: http_port` .
2017-12-28 15:13:23 +00:00
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< http_server_default_response >
<![CDATA[<html ng-app="SMI2"><head><base href="http://ui.tabix.io/"></head><body><div ui-view="" class="content-ui"></div><script src="http://loader.tabix.io/master.js"></script></body></html>]]>
< / http_server_default_response >
```
2020-10-13 17:23:29 +00:00
## include_from {#server_configuration_parameters-include_from}
2017-12-28 15:13:23 +00:00
The path to the file with substitutions.
2020-06-18 08:24:31 +00:00
For more information, see the section “[Configuration files](../../operations/configuration-files.md#configuration_files)”.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< include_from > /etc/metrica.xml< / include_from >
```
2020-10-13 17:23:29 +00:00
## interserver_http_port {#interserver-http-port}
2017-12-28 15:13:23 +00:00
Port for exchanging data between ClickHouse servers.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< interserver_http_port > 9009< / interserver_http_port >
```
2020-10-13 17:23:29 +00:00
## interserver_http_host {#interserver-http-host}
2017-12-28 15:13:23 +00:00
2020-03-19 08:31:06 +00:00
The hostname that can be used by other servers to access this server.
2017-12-28 15:13:23 +00:00
2018-09-04 11:18:59 +00:00
If omitted, it is defined in the same way as the `hostname-f` command.
2017-12-28 15:13:23 +00:00
Useful for breaking away from a specific network interface.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< interserver_http_host > example.yandex.ru< / interserver_http_host >
```
2020-10-13 17:23:29 +00:00
## interserver_http_credentials {#server-settings-interserver-http-credentials}
2019-09-24 23:14:23 +00:00
2020-04-30 18:19:18 +00:00
The username and password used to authenticate during [replication ](../../engines/table-engines/mergetree-family/replication.md ) with the Replicated\* engines. These credentials are used only for communication between replicas and are unrelated to credentials for ClickHouse clients. The server is checking these credentials for connecting replicas and use the same credentials when connecting to other replicas. So, these credentials should be set the same for all replicas in a cluster.
2019-09-24 23:14:23 +00:00
By default, the authentication is not used.
This section contains the following parameters:
2020-03-21 04:11:51 +00:00
- `user` — username.
- `password` — password.
2019-09-24 23:14:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2019-09-24 23:14:23 +00:00
< interserver_http_credentials >
< user > admin< / user >
< password > 222< / password >
< / interserver_http_credentials >
```
2020-10-13 17:23:29 +00:00
## keep_alive_timeout {#keep-alive-timeout}
2017-12-28 15:13:23 +00:00
2019-01-31 12:23:18 +00:00
The number of seconds that ClickHouse waits for incoming requests before closing the connection. Defaults to 3 seconds.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2019-01-31 12:23:18 +00:00
< keep_alive_timeout > 3< / keep_alive_timeout >
2017-12-28 15:13:23 +00:00
```
2020-10-13 17:23:29 +00:00
## listen_host {#server_configuration_parameters-listen_host}
2017-12-28 15:13:23 +00:00
Restriction on hosts that requests can come from. If you want the server to answer all of them, specify `::` .
Examples:
2020-03-20 10:10:48 +00:00
``` xml
2018-03-25 02:04:22 +00:00
< listen_host > ::1< / listen_host >
< listen_host > 127.0.0.1< / listen_host >
2017-12-28 15:13:23 +00:00
```
2020-04-03 13:23:32 +00:00
## logger {#server_configuration_parameters-logger}
2017-12-28 15:13:23 +00:00
Logging settings.
Keys:
2020-05-29 21:52:49 +00:00
- `level` – Logging level. Acceptable values: `trace` , `debug` , `information` , `warning` , `error` .
- `log` – The log file. Contains all the entries according to `level` .
- `errorlog` – Error log file.
- `size` – Size of the file. Applies to `log` and`errorlog`. Once the file reaches `size` , ClickHouse archives and renames it, and creates a new log file in its place.
- `count` – The number of archived log files that ClickHouse stores.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< logger >
< level > trace< / level >
< log > /var/log/clickhouse-server/clickhouse-server.log< / log >
< errorlog > /var/log/clickhouse-server/clickhouse-server.err.log< / errorlog >
< size > 1000M< / size >
< count > 10< / count >
< / logger >
```
2018-09-04 11:18:59 +00:00
Writing to the syslog is also supported. Config example:
2020-03-20 10:10:48 +00:00
``` xml
2018-06-01 15:06:45 +00:00
< logger >
< use_syslog > 1< / use_syslog >
< syslog >
< address > syslog.remote:10514< / address >
2018-07-20 17:35:34 +00:00
< hostname > myhost.local< / hostname >
2018-06-01 15:06:45 +00:00
< facility > LOG_LOCAL6< / facility >
< format > syslog< / format >
< / syslog >
< / logger >
```
2020-08-25 07:41:59 +00:00
Keys for syslog:
2018-09-04 11:18:59 +00:00
2020-10-13 17:23:29 +00:00
- use_syslog — Required setting if you want to write to the syslog.
2020-03-21 04:11:51 +00:00
- address — The host\[:port\] of syslogd. If omitted, the local daemon is used.
- hostname — Optional. The name of the host that logs are sent from.
2020-10-13 17:23:29 +00:00
- facility — [The syslog facility keyword ](https://en.wikipedia.org/wiki/Syslog#Facility ) in uppercase letters with the “LOG_” prefix: (`LOG_USER`, `LOG_DAEMON` , `LOG_LOCAL3` , and so on).
2020-08-25 07:41:59 +00:00
Default value: `LOG_USER` if `address` is specified, `LOG_DAEMON` otherwise.
2020-03-21 04:11:51 +00:00
- format – Message format. Possible values: `bsd` and `syslog.`
2017-12-28 15:13:23 +00:00
2020-10-13 17:23:29 +00:00
## send_crash_reports {#server_configuration_parameters-logger}
2020-05-29 21:52:49 +00:00
Settings for opt-in sending crash reports to the ClickHouse core developers team via [Sentry ](https://sentry.io ).
2020-10-13 15:29:28 +00:00
Enabling it, especially in pre-production environments, is highly appreciated.
2020-05-30 08:13:04 +00:00
2020-10-13 15:29:28 +00:00
The server will need access to the public Internet via IPv4 (at the time of writing IPv6 is not supported by Sentry) for this feature to be functioning properly.
2020-05-29 21:52:49 +00:00
Keys:
2020-08-25 07:41:59 +00:00
- `enabled` – Boolean flag to enable the feature, `false` by default. Set to `true` to allow sending crash reports.
2020-10-13 15:29:28 +00:00
- `endpoint` – You can override the Sentry endpoint URL for sending crash reports. It can be either a separate Sentry account or your self-hosted Sentry instance. Use the [Sentry DSN ](https://docs.sentry.io/error-reporting/quickstart/?platform=native#configure-the-sdk ) syntax.
- `anonymize` - Avoid attaching the server hostname to the crash report.
2020-05-30 08:24:21 +00:00
- `http_proxy` - Configure HTTP proxy for sending crash reports.
2020-05-29 21:52:49 +00:00
- `debug` - Sets the Sentry client into debug mode.
- `tmp_path` - Filesystem path for temporary crash report state.
**Recommended way to use**
``` xml
< send_crash_reports >
< enabled > true< / enabled >
2020-06-25 17:50:13 +00:00
< / send_crash_reports >
2020-05-29 21:52:49 +00:00
```
2020-03-20 10:10:48 +00:00
## macros {#macros}
2017-12-28 15:13:23 +00:00
Parameter substitutions for replicated tables.
Can be omitted if replicated tables are not used.
2020-04-30 18:19:18 +00:00
For more information, see the section “[Creating replicated tables](../../engines/table-engines/mergetree-family/replication.md)”.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< macros incl = "macros" optional = "true" / >
```
2020-10-13 17:23:29 +00:00
## mark_cache_size {#server-mark-cache-size}
2017-12-28 15:13:23 +00:00
2020-04-30 18:19:18 +00:00
Approximate size (in bytes) of the cache of marks used by table engines of the [MergeTree ](../../engines/table-engines/mergetree-family/mergetree.md ) family.
2017-12-28 15:13:23 +00:00
The cache is shared for the server and memory is allocated as needed. The cache size must be at least 5368709120.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< mark_cache_size > 5368709120< / mark_cache_size >
```
2020-08-25 07:41:59 +00:00
2020-10-13 17:23:29 +00:00
## max_server_memory_usage {#max_server_memory_usage}
2020-07-01 13:08:16 +00:00
2020-08-14 19:57:44 +00:00
Limits total RAM usage by the ClickHouse server.
2020-07-01 13:08:16 +00:00
Possible values:
- Positive integer.
2020-09-28 18:26:38 +00:00
- 0 (auto).
2020-07-01 13:08:16 +00:00
Default value: `0` .
**Additional Info**
2020-07-19 17:46:23 +00:00
The default `max_server_memory_usage` value is calculated as `memory_amount * max_server_memory_usage_to_ram_ratio` .
2020-07-01 13:08:16 +00:00
**See also**
2020-10-13 17:23:29 +00:00
- [max_memory_usage ](../../operations/settings/query-complexity.md#settings_max_memory_usage )
2020-07-19 17:46:23 +00:00
- [max_server_memory_usage_to_ram_ratio ](#max_server_memory_usage_to_ram_ratio )
## max_server_memory_usage_to_ram_ratio {#max_server_memory_usage_to_ram_ratio}
Defines the fraction of total physical RAM amount, available to the Clickhouse server. If the server tries to utilize more, the memory is cut down to the appropriate amount.
Possible values:
- Positive double.
- 0 — The Clickhouse server can use all available RAM.
Default value: `0` .
**Usage**
On hosts with low RAM and swap, you possibly need setting `max_server_memory_usage_to_ram_ratio` larger than 1.
**Example**
``` xml
< max_server_memory_usage_to_ram_ratio > 0.9< / max_server_memory_usage_to_ram_ratio >
```
**See Also**
- [max_server_memory_usage ](#max_server_memory_usage )
2020-07-01 13:08:16 +00:00
2020-10-13 17:23:29 +00:00
## max_concurrent_queries {#max-concurrent-queries}
2017-12-28 15:13:23 +00:00
The maximum number of simultaneously processed requests.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< max_concurrent_queries > 100< / max_concurrent_queries >
```
2020-10-13 17:23:29 +00:00
## max_connections {#max-connections}
2017-12-28 15:13:23 +00:00
The maximum number of inbound connections.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< max_connections > 4096< / max_connections >
```
2020-10-13 17:23:29 +00:00
## max_open_files {#max-open-files}
2017-12-28 15:13:23 +00:00
The maximum number of open files.
By default: `maximum` .
2020-03-19 08:31:06 +00:00
We recommend using this option in Mac OS X since the `getrlimit()` function returns an incorrect value.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< max_open_files > 262144< / max_open_files >
```
2020-10-13 17:23:29 +00:00
## max_table_size_to_drop {#max-table-size-to-drop}
2017-12-28 15:13:23 +00:00
Restriction on deleting tables.
2020-04-30 18:19:18 +00:00
If the size of a [MergeTree ](../../engines/table-engines/mergetree-family/mergetree.md ) table exceeds `max_table_size_to_drop` (in bytes), you can’ t delete it using a DROP query.
2017-12-28 15:13:23 +00:00
2018-09-04 11:18:59 +00:00
If you still need to delete the table without restarting the ClickHouse server, create the `<clickhouse-path>/flags/force_drop_table` file and run the DROP query.
2017-12-28 15:13:23 +00:00
Default value: 50 GB.
The value 0 means that you can delete all tables without any restrictions.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< max_table_size_to_drop > 0< / max_table_size_to_drop >
```
2020-10-13 17:23:29 +00:00
## max_thread_pool_size {#max-thread-pool-size}
2020-06-14 20:44:39 +00:00
The maximum number of threads in the Global Thread pool.
Default value: 10000.
**Example**
``` xml
< max_thread_pool_size > 12000< / max_thread_pool_size >
```
2020-10-13 17:23:29 +00:00
## merge_tree {#server_configuration_parameters-merge_tree}
2017-12-28 15:13:23 +00:00
2020-04-30 18:19:18 +00:00
Fine tuning for tables in the [MergeTree ](../../engines/table-engines/mergetree-family/mergetree.md ).
2017-12-28 15:13:23 +00:00
For more information, see the MergeTreeSettings.h header file.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< merge_tree >
< max_suspicious_broken_parts > 5< / max_suspicious_broken_parts >
< / merge_tree >
```
2020-10-13 17:23:29 +00:00
## replicated_merge_tree {#server_configuration_parameters-replicated_merge_tree}
2020-08-10 11:23:58 +00:00
Fine tuning for tables in the [ReplicatedMergeTree ](../../engines/table-engines/mergetree-family/mergetree.md ).
This setting has higher priority.
For more information, see the MergeTreeSettings.h header file.
**Example**
``` xml
< replicated_merge_tree >
< max_suspicious_broken_parts > 5< / max_suspicious_broken_parts >
< / replicated_merge_tree >
```
2020-04-03 13:23:32 +00:00
## openSSL {#server_configuration_parameters-openssl}
2017-12-28 15:13:23 +00:00
SSL client/server configuration.
2018-09-04 11:18:59 +00:00
Support for SSL is provided by the `libpoco` library. The interface is described in the file [SSLManager.h ](https://github.com/ClickHouse-Extras/poco/blob/master/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h )
2017-12-28 15:13:23 +00:00
Keys for server/client settings:
2020-03-21 04:11:51 +00:00
- privateKeyFile – The path to the file with the secret key of the PEM certificate. The file may contain a key and certificate at the same time.
- certificateFile – The path to the client/server certificate file in PEM format. You can omit it if `privateKeyFile` contains the certificate.
- caConfig – The path to the file or directory that contains trusted root certificates.
- verificationMode – The method for checking the node’ s certificates. Details are in the description of the [Context ](https://github.com/ClickHouse-Extras/poco/blob/master/NetSSL_OpenSSL/include/Poco/Net/Context.h ) class. Possible values: `none` , `relaxed` , `strict` , `once` .
- verificationDepth – The maximum length of the verification chain. Verification will fail if the certificate chain length exceeds the set value.
- loadDefaultCAFile – Indicates that built-in CA certificates for OpenSSL will be used. Acceptable values: `true` , `false` . \|
- cipherList – Supported OpenSSL encryptions. For example: `ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH` .
- cacheSessions – Enables or disables caching sessions. Must be used in combination with `sessionIdContext` . Acceptable values: `true` , `false` .
- sessionIdContext – A unique set of random characters that the server appends to each generated identifier. The length of the string must not exceed `SSL_MAX_SSL_SESSION_ID_LENGTH` . This parameter is always recommended since it helps avoid problems both if the server caches the session and if the client requested caching. Default value: `${application.name}` .
- sessionCacheSize – The maximum number of sessions that the server caches. Default value: 1024\*20. 0 – Unlimited sessions.
- sessionTimeout – Time for caching the session on the server.
- extendedVerification – Automatically extended verification of certificates after the session ends. Acceptable values: `true` , `false` .
- requireTLSv1 – Require a TLSv1 connection. Acceptable values: `true` , `false` .
2020-10-13 17:23:29 +00:00
- requireTLSv1_1 – Require a TLSv1.1 connection. Acceptable values: `true` , `false` .
2020-03-21 04:11:51 +00:00
- requireTLSv1 – Require a TLSv1.2 connection. Acceptable values: `true` , `false` .
- fips – Activates OpenSSL FIPS mode. Supported if the library’ s OpenSSL version supports FIPS.
- privateKeyPassphraseHandler – Class (PrivateKeyPassphraseHandler subclass) that requests the passphrase for accessing the private key. For example: `<privateKeyPassphraseHandler>` , `<name>KeyFileHandler</name>` , `<options><password>test</password></options>` , `</privateKeyPassphraseHandler>` .
- invalidCertificateHandler – Class (a subclass of CertificateHandler) for verifying invalid certificates. For example: `<invalidCertificateHandler> <name>ConsoleCertificateHandler</name> </invalidCertificateHandler>` .
- disableProtocols – Protocols that are not allowed to use.
- preferServerCiphers – Preferred server ciphers on the client.
2017-12-28 15:13:23 +00:00
**Example of settings:**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< openSSL >
< server >
<!-- openssl req - subj "/CN=localhost" - new - newkey rsa:2048 - days 365 - nodes - x509 - keyout /etc/clickhouse - server/server.key - out /etc/clickhouse - server/server.crt -->
< certificateFile > /etc/clickhouse-server/server.crt< / certificateFile >
< privateKeyFile > /etc/clickhouse-server/server.key< / privateKeyFile >
<!-- openssl dhparam - out /etc/clickhouse - server/dhparam.pem 4096 -->
< dhParamsFile > /etc/clickhouse-server/dhparam.pem< / dhParamsFile >
< verificationMode > none< / verificationMode >
< loadDefaultCAFile > true< / loadDefaultCAFile >
< cacheSessions > true< / cacheSessions >
< disableProtocols > sslv2,sslv3< / disableProtocols >
< preferServerCiphers > true< / preferServerCiphers >
< / server >
< client >
< loadDefaultCAFile > true< / loadDefaultCAFile >
< cacheSessions > true< / cacheSessions >
< disableProtocols > sslv2,sslv3< / disableProtocols >
< preferServerCiphers > true< / preferServerCiphers >
<!-- Use for self - signed: <verificationMode>none</verificationMode> -->
< invalidCertificateHandler >
<!-- Use for self - signed: <name>AcceptCertificateHandler</name> -->
< name > RejectCertificateHandler< / name >
< / invalidCertificateHandler >
< / client >
< / openSSL >
```
2020-10-13 17:23:29 +00:00
## part_log {#server_configuration_parameters-part-log}
2017-12-28 15:13:23 +00:00
2020-04-30 18:19:18 +00:00
Logging events that are associated with [MergeTree ](../../engines/table-engines/mergetree-family/mergetree.md ). For instance, adding or merging data. You can use the log to simulate merge algorithms and compare their characteristics. You can visualize the merge process.
2017-12-28 15:13:23 +00:00
2020-10-13 17:23:29 +00:00
Queries are logged in the [system.part_log ](../../operations/system-tables/part_log.md#system_tables-part-log ) table, not in a separate file. You can configure the name of this table in the `table` parameter (see below).
2017-12-28 15:13:23 +00:00
Use the following parameters to configure logging:
2020-03-21 04:11:51 +00:00
- `database` – Name of the database.
- `table` – Name of the system table.
2020-08-25 07:41:59 +00:00
- `partition_by` — [Custom partitioning key ](../../engines/table-engines/mergetree-family/custom-partitioning-key.md ) for a system table. Can't be used if `engine` defined.
- `engine` - [MergeTree Engine Definition ](../../engines/table-engines/mergetree-family/mergetree.md#table_engine-mergetree-creating-a-table ) for a system table. Can't be used if `partition_by` defined.
2020-03-21 04:11:51 +00:00
- `flush_interval_milliseconds` – Interval for flushing data from the buffer in memory to the table.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< part_log >
< database > system< / database >
< table > part_log< / table >
2018-02-14 08:01:41 +00:00
< partition_by > toMonday(event_date)< / partition_by >
2017-12-28 15:13:23 +00:00
< flush_interval_milliseconds > 7500< / flush_interval_milliseconds >
< / part_log >
```
2020-04-03 13:23:32 +00:00
## path {#server_configuration_parameters-path}
2017-12-28 15:13:23 +00:00
The path to the directory containing data.
2020-03-20 10:10:48 +00:00
!!! note "Note"
2018-09-06 17:47:18 +00:00
The trailing slash is mandatory.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< path > /var/lib/clickhouse/< / path >
```
2020-04-11 05:27:24 +00:00
## prometheus {#server_configuration_parameters-prometheus}
Exposing metrics data for scraping from [Prometheus ](https://prometheus.io ).
Settings:
2020-04-30 18:19:18 +00:00
- `endpoint` – HTTP endpoint for scraping metrics by prometheus server. Start from ‘ /’ .
2020-04-11 05:27:24 +00:00
- `port` – Port for `endpoint` .
2020-06-18 08:24:31 +00:00
- `metrics` – Flag that sets to expose metrics from the [system.metrics ](../../operations/system-tables/metrics.md#system_tables-metrics ) table.
- `events` – Flag that sets to expose metrics from the [system.events ](../../operations/system-tables/events.md#system_tables-events ) table.
2020-10-13 17:23:29 +00:00
- `asynchronous_metrics` – Flag that sets to expose current metrics values from the [system.asynchronous_metrics ](../../operations/system-tables/asynchronous_metrics.md#system_tables-asynchronous_metrics ) table.
2020-04-11 05:27:24 +00:00
**Example**
``` xml
< prometheus >
< endpoint > /metrics< / endpoint >
< port > 8001< / port >
< metrics > true< / metrics >
< events > true< / events >
< asynchronous_metrics > true< / asynchronous_metrics >
< / prometheus >
```
2020-10-13 17:23:29 +00:00
## query_log {#server_configuration_parameters-query-log}
2017-12-28 15:13:23 +00:00
2020-10-13 17:23:29 +00:00
Setting for logging queries received with the [log_queries=1 ](../../operations/settings/settings.md ) setting.
2017-12-28 15:13:23 +00:00
2020-10-13 17:23:29 +00:00
Queries are logged in the [system.query_log ](../../operations/system-tables/query_log.md#system_tables-query_log ) table, not in a separate file. You can change the name of the table in the `table` parameter (see below).
2017-12-28 15:13:23 +00:00
Use the following parameters to configure logging:
2020-03-21 04:11:51 +00:00
- `database` – Name of the database.
- `table` – Name of the system table the queries will be logged in.
2020-08-25 07:41:59 +00:00
- `partition_by` — [Custom partitioning key ](../../engines/table-engines/mergetree-family/custom-partitioning-key.md ) for a system table. Can't be used if `engine` defined.
- `engine` - [MergeTree Engine Definition ](../../engines/table-engines/mergetree-family/mergetree.md#table_engine-mergetree-creating-a-table ) for a system table. Can't be used if `partition_by` defined.
2020-03-21 04:11:51 +00:00
- `flush_interval_milliseconds` – Interval for flushing data from the buffer in memory to the table.
2017-12-28 15:13:23 +00:00
2020-03-20 10:10:48 +00:00
If the table doesn’ t exist, ClickHouse will create it. If the structure of the query log changed when the ClickHouse server was updated, the table with the old structure is renamed, and a new table is created automatically.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< query_log >
< database > system< / database >
< table > query_log< / table >
2020-08-25 07:41:59 +00:00
< engine > Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day< / engine >
2017-12-28 15:13:23 +00:00
< flush_interval_milliseconds > 7500< / flush_interval_milliseconds >
< / query_log >
```
2020-10-13 17:23:29 +00:00
## query_thread_log {#server_configuration_parameters-query_thread_log}
2019-10-23 22:52:22 +00:00
2020-10-13 17:23:29 +00:00
Setting for logging threads of queries received with the [log_query_threads=1 ](../../operations/settings/settings.md#settings-log-query-threads ) setting.
2019-10-23 22:52:22 +00:00
2020-10-13 17:23:29 +00:00
Queries are logged in the [system.query_thread_log ](../../operations/system-tables/query_thread_log.md#system_tables-query_thread_log ) table, not in a separate file. You can change the name of the table in the `table` parameter (see below).
2019-10-23 22:52:22 +00:00
Use the following parameters to configure logging:
2020-03-21 04:11:51 +00:00
- `database` – Name of the database.
- `table` – Name of the system table the queries will be logged in.
2020-08-25 07:41:59 +00:00
- `partition_by` — [Custom partitioning key ](../../engines/table-engines/mergetree-family/custom-partitioning-key.md ) for a system table. Can't be used if `engine` defined.
- `engine` - [MergeTree Engine Definition ](../../engines/table-engines/mergetree-family/mergetree.md#table_engine-mergetree-creating-a-table ) for a system table. Can't be used if `partition_by` defined.
2020-03-21 04:11:51 +00:00
- `flush_interval_milliseconds` – Interval for flushing data from the buffer in memory to the table.
2019-10-23 22:52:22 +00:00
2020-03-20 10:10:48 +00:00
If the table doesn’ t exist, ClickHouse will create it. If the structure of the query thread log changed when the ClickHouse server was updated, the table with the old structure is renamed, and a new table is created automatically.
2019-10-23 22:52:22 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2019-10-23 22:52:22 +00:00
< query_thread_log >
< database > system< / database >
2019-12-02 22:21:06 +00:00
< table > query_thread_log< / table >
2019-10-23 22:52:22 +00:00
< partition_by > toMonday(event_date)< / partition_by >
< flush_interval_milliseconds > 7500< / flush_interval_milliseconds >
< / query_thread_log >
```
2020-10-13 17:23:29 +00:00
## text_log {#server_configuration_parameters-text_log}
2020-08-25 07:41:59 +00:00
2020-10-13 17:23:29 +00:00
Settings for the [text_log ](../../operations/system-tables/text_log.md#system_tables-text_log ) system table for logging text messages.
2020-08-25 07:41:59 +00:00
Parameters:
- `level` — Maximum Message Level (by default `Trace` ) which will be stored in a table.
- `database` — Database name.
- `table` — Table name.
- `partition_by` — [Custom partitioning key ](../../engines/table-engines/mergetree-family/custom-partitioning-key.md ) for a system table. Can't be used if `engine` defined.
- `engine` - [MergeTree Engine Definition ](../../engines/table-engines/mergetree-family/mergetree.md#table_engine-mergetree-creating-a-table ) for a system table. Can't be used if `partition_by` defined.
- `flush_interval_milliseconds` — Interval for flushing data from the buffer in memory to the table.
**Example**
```xml
< yandex >
< text_log >
< level > notice< / level >
< database > system< / database >
< table > text_log< / table >
< flush_interval_milliseconds > 7500< / flush_interval_milliseconds >
<!-- <partition_by>event_date</partition_by> -->
< engine > Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day< / engine >
< / text_log >
< / yandex >
```
2020-10-13 17:23:29 +00:00
## trace_log {#server_configuration_parameters-trace_log}
2019-11-20 09:33:29 +00:00
2020-10-13 17:23:29 +00:00
Settings for the [trace_log ](../../operations/system-tables/trace_log.md#system_tables-trace_log ) system table operation.
2019-11-20 09:33:29 +00:00
Parameters:
2020-03-21 04:11:51 +00:00
- `database` — Database for storing a table.
- `table` — Table name.
2020-08-25 07:41:59 +00:00
- `partition_by` — [Custom partitioning key ](../../engines/table-engines/mergetree-family/custom-partitioning-key.md ) for a system table. Can't be used if `engine` defined.
- `engine` - [MergeTree Engine Definition ](../../engines/table-engines/mergetree-family/index.md ) for a system table. Can't be used if `partition_by` defined.
2020-03-21 04:11:51 +00:00
- `flush_interval_milliseconds` — Interval for flushing data from the buffer in memory to the table.
2019-11-20 09:33:29 +00:00
The default server configuration file `config.xml` contains the following settings section:
2020-03-20 10:10:48 +00:00
``` xml
2019-11-20 09:33:29 +00:00
< 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 >
```
2020-10-13 17:23:29 +00:00
## query_masking_rules {#query-masking-rules}
2019-06-20 07:17:21 +00:00
2019-09-03 19:51:04 +00:00
Regexp-based rules, which will be applied to queries as well as all log messages before storing them in server logs,
2020-08-25 07:41:59 +00:00
`system.query_log` , `system.text_log` , `system.processes` tables, and in logs sent to the client. That allows preventing
2020-03-19 08:31:06 +00:00
sensitive data leakage from SQL queries (like names, emails, personal
identifiers or credit card numbers) to logs.
2019-06-20 07:17:21 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2019-06-20 07:17:21 +00:00
< query_masking_rules >
< rule >
< name > hide SSN< / name >
< regexp > (^|\D)\d{3}-\d{2}-\d{4}($|\D)</ regexp >
< replace > 000-00-0000< / replace >
< / rule >
< / query_masking_rules >
```
Config fields:
- `name` - name for the rule (optional)
- `regexp` - RE2 compatible regular expression (mandatory)
- `replace` - substitution string for sensitive data (optional, by default - six asterisks)
2020-03-19 08:31:06 +00:00
The masking rules are applied to the whole query (to prevent leaks of sensitive data from malformed / non-parsable queries).
2019-06-20 07:17:21 +00:00
2020-03-19 08:31:06 +00:00
`system.events` table have counter `QueryMaskingRulesMatch` which have an overall number of query masking rules matches.
2019-06-20 07:17:21 +00:00
2020-03-19 08:31:06 +00:00
For distributed queries each server have to be configured separately, otherwise, subqueries passed to other
2019-06-20 07:17:21 +00:00
nodes will be stored without masking.
2017-12-28 15:13:23 +00:00
2020-10-13 17:23:29 +00:00
## remote_servers {#server-settings-remote-servers}
2017-12-28 15:13:23 +00:00
2020-04-30 18:19:18 +00:00
Configuration of clusters used by the [Distributed ](../../engines/table-engines/special/distributed.md ) table engine and by the `cluster` table function.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< remote_servers incl = "clickhouse_remote_servers" / >
```
2020-06-18 08:24:31 +00:00
For the value of the `incl` attribute, see the section “[Configuration files](../../operations/configuration-files.md#configuration_files)”.
2017-12-28 15:13:23 +00:00
2019-08-20 12:06:52 +00:00
**See Also**
2020-10-13 17:23:29 +00:00
- [skip_unavailable_shards ](../../operations/settings/settings.md#settings-skip_unavailable_shards )
2017-12-28 15:13:23 +00:00
2020-04-03 13:23:32 +00:00
## timezone {#server_configuration_parameters-timezone}
2017-12-28 15:13:23 +00:00
2020-03-20 10:10:48 +00:00
The server’ s time zone.
2017-12-28 15:13:23 +00:00
2020-03-19 08:31:06 +00:00
Specified as an IANA identifier for the UTC timezone or geographic location (for example, Africa/Abidjan).
2017-12-28 15:13:23 +00:00
2020-03-20 10:10:48 +00:00
The time zone is necessary for conversions between String and DateTime formats when DateTime fields are output to text format (printed on the screen or in a file), and when getting DateTime from a string. Besides, the time zone is used in functions that work with the time and date if they didn’ t receive the time zone in the input parameters.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< timezone > Europe/Moscow< / timezone >
```
2020-10-13 17:23:29 +00:00
## tcp_port {#server_configuration_parameters-tcp_port}
2017-12-28 15:13:23 +00:00
Port for communicating with clients over the TCP protocol.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< tcp_port > 9000< / tcp_port >
```
2020-10-13 17:23:29 +00:00
## tcp_port_secure {#server_configuration_parameters-tcp_port_secure}
2019-02-28 09:06:10 +00:00
2020-04-03 13:23:32 +00:00
TCP port for secure communication with clients. Use it with [OpenSSL ](#server_configuration_parameters-openssl ) settings.
2019-02-28 09:06:10 +00:00
2019-02-28 16:53:11 +00:00
**Possible values**
Positive integer.
**Default value**
2019-02-28 09:06:10 +00:00
2020-03-20 10:10:48 +00:00
``` xml
2019-02-28 16:53:11 +00:00
< tcp_port_secure > 9440< / tcp_port_secure >
2019-02-28 09:06:10 +00:00
```
2017-12-28 15:13:23 +00:00
2020-10-13 17:23:29 +00:00
## mysql_port {#server_configuration_parameters-mysql_port}
2020-01-19 05:57:21 +00:00
Port for communicating with clients over MySQL protocol.
**Possible values**
Positive integer.
Example
2020-03-20 10:10:48 +00:00
``` xml
2020-01-19 05:57:21 +00:00
< mysql_port > 9004< / mysql_port >
```
2020-10-13 17:23:29 +00:00
## tmp_path {#tmp-path}
2017-12-28 15:13:23 +00:00
Path to temporary data for processing large queries.
2020-03-20 10:10:48 +00:00
!!! note "Note"
2018-09-06 17:47:18 +00:00
The trailing slash is mandatory.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< tmp_path > /var/lib/clickhouse/tmp/< / tmp_path >
```
2020-10-13 17:23:29 +00:00
## tmp_policy {#tmp-policy}
2020-01-23 18:08:27 +00:00
2020-10-13 17:23:29 +00:00
Policy from [storage_configuration ](../../engines/table-engines/mergetree-family/mergetree.md#table_engine-mergetree-multiple-volumes ) to store temporary files.
2020-05-19 06:02:30 +00:00
2020-10-13 17:23:29 +00:00
If not set, [tmp_path ](#tmp-path ) is used, otherwise it is ignored.
2020-01-23 18:08:27 +00:00
2020-03-20 10:10:48 +00:00
!!! note "Note"
2020-05-19 06:02:30 +00:00
- `move_factor` is ignored.
2020-06-18 08:24:31 +00:00
- `keep_free_space_bytes` is ignored.
- `max_data_part_size_bytes` is ignored.
- У ou must have exactly one volume in that policy.
2020-01-23 18:08:27 +00:00
2020-10-13 17:23:29 +00:00
## uncompressed_cache_size {#server-settings-uncompressed_cache_size}
2017-12-28 15:13:23 +00:00
2020-04-30 18:19:18 +00:00
Cache size (in bytes) for uncompressed data used by table engines from the [MergeTree ](../../engines/table-engines/mergetree-family/mergetree.md ).
2017-12-28 15:13:23 +00:00
2020-10-13 17:23:29 +00:00
There is one shared cache for the server. Memory is allocated on demand. The cache is used if the option [use_uncompressed_cache ](../../operations/settings/settings.md#setting-use_uncompressed_cache ) is enabled.
2017-12-28 15:13:23 +00:00
The uncompressed cache is advantageous for very short queries in individual cases.
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< uncompressed_cache_size > 8589934592< / uncompressed_cache_size >
```
2020-10-13 17:23:29 +00:00
## user_files_path {#server_configuration_parameters-user_files_path}
2018-05-14 19:58:49 +00:00
2020-04-30 18:19:18 +00:00
The directory with user files. Used in the table function [file() ](../../sql-reference/table-functions/file.md ).
2018-05-14 19:58:49 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2018-05-14 19:58:49 +00:00
< user_files_path > /var/lib/clickhouse/user_files/< / user_files_path >
```
2020-10-13 17:23:29 +00:00
## users_config {#users-config}
2017-12-28 15:13:23 +00:00
Path to the file that contains:
2020-03-21 04:11:51 +00:00
- User configurations.
- Access rights.
- Settings profiles.
- Quota settings.
2017-12-28 15:13:23 +00:00
**Example**
2020-03-20 10:10:48 +00:00
``` xml
2017-12-28 15:13:23 +00:00
< users_config > users.xml< / users_config >
```
2020-03-22 09:14:59 +00:00
## zookeeper {#server-settings_zookeeper}
2017-12-28 15:13:23 +00:00
2019-06-13 03:14:04 +00:00
Contains settings that allow ClickHouse to interact with a [ZooKeeper ](http://zookeeper.apache.org/ ) cluster.
2017-12-28 15:13:23 +00:00
2019-06-13 03:14:04 +00:00
ClickHouse uses ZooKeeper for storing metadata of replicas when using replicated tables. If replicated tables are not used, this section of parameters can be omitted.
2017-12-28 15:13:23 +00:00
2019-06-13 03:14:04 +00:00
This section contains the following parameters:
2017-12-28 15:13:23 +00:00
2020-03-21 04:11:51 +00:00
- `node` — ZooKeeper endpoint. You can set multiple endpoints.
2017-12-28 15:13:23 +00:00
2020-03-21 04:11:51 +00:00
For example:
2020-03-20 10:10:48 +00:00
<!-- -->
2019-04-24 07:39:53 +00:00
2020-03-20 10:10:48 +00:00
``` xml
2019-04-24 07:39:53 +00:00
< node index = "1" >
< host > example_host< / host >
< port > 2181< / port >
< / node >
2019-11-21 12:25:07 +00:00
```
2019-04-24 07:39:53 +00:00
2020-03-21 04:11:51 +00:00
The `index` attribute specifies the node order when trying to connect to the ZooKeeper cluster.
2019-04-24 07:39:53 +00:00
2020-03-21 04:11:51 +00:00
- `session_timeout` — Maximum timeout for the client session in milliseconds.
- `root` — The [znode ](http://zookeeper.apache.org/doc/r3.5.5/zookeeperOver.html#Nodes+and+ephemeral+nodes ) that is used as the root for znodes used by the ClickHouse server. Optional.
- `identity` — User and password, that can be required by ZooKeeper to give access to requested znodes. Optional.
2019-04-24 07:39:53 +00:00
**Example configuration**
2017-12-28 15:13:23 +00:00
2020-03-20 10:10:48 +00:00
``` xml
2018-12-20 12:04:28 +00:00
< zookeeper >
2019-04-24 07:39:53 +00:00
< node >
2018-12-20 12:04:28 +00:00
< host > example1< / host >
< port > 2181< / port >
< / node >
2019-04-24 07:39:53 +00:00
< node >
2018-12-20 12:04:28 +00:00
< host > example2< / host >
< port > 2181< / port >
< / node >
2019-04-24 07:39:53 +00:00
< session_timeout_ms > 30000< / session_timeout_ms >
2019-05-23 11:55:31 +00:00
< operation_timeout_ms > 10000< / operation_timeout_ms >
2019-04-24 07:39:53 +00:00
<!-- Optional. Chroot suffix. Should exist. -->
< root > /path/to/zookeeper/node< / root >
<!-- Optional. Zookeeper digest ACL string. -->
< identity > user:password< / identity >
2018-12-20 12:04:28 +00:00
< / zookeeper >
2017-12-28 15:13:23 +00:00
```
2018-09-04 11:18:59 +00:00
2019-04-24 07:39:53 +00:00
**See Also**
2020-04-30 18:19:18 +00:00
- [Replication ](../../engines/table-engines/mergetree-family/replication.md )
2020-03-21 04:11:51 +00:00
- [ZooKeeper Programmer’ s Guide ](http://zookeeper.apache.org/doc/current/zookeeperProgrammers.html )
2019-04-24 07:39:53 +00:00
2020-10-13 17:23:29 +00:00
## use_minimalistic_part_header_in_zookeeper {#server-settings-use_minimalistic_part_header_in_zookeeper}
2019-03-21 14:57:17 +00:00
2019-04-10 12:13:45 +00:00
Storage method for data part headers in ZooKeeper.
2019-03-21 14:57:17 +00:00
2019-04-10 12:13:45 +00:00
This setting only applies to the `MergeTree` family. It can be specified:
2019-03-21 14:57:17 +00:00
2020-10-13 17:23:29 +00:00
- Globally in the [merge_tree ](#server_configuration_parameters-merge_tree ) section of the `config.xml` file.
2019-03-21 14:57:17 +00:00
2020-03-21 04:11:51 +00:00
ClickHouse uses the setting for all the tables on the server. You can change the setting at any time. Existing tables change their behaviour when the setting changes.
2019-03-21 14:57:17 +00:00
2020-03-21 04:11:51 +00:00
- For each table.
2019-03-21 14:57:17 +00:00
2020-04-30 18:19:18 +00:00
When creating a table, specify the corresponding [engine setting ](../../engines/table-engines/mergetree-family/mergetree.md#table_engine-mergetree-creating-a-table ). The behaviour of an existing table with this setting does not change, even if the global setting changes.
2019-03-21 14:57:17 +00:00
**Possible values**
2020-03-21 04:11:51 +00:00
- 0 — Functionality is turned off.
- 1 — Functionality is turned on.
2019-03-21 14:57:17 +00:00
2020-04-30 18:19:18 +00:00
If `use_minimalistic_part_header_in_zookeeper = 1` , then [replicated ](../../engines/table-engines/mergetree-family/replication.md ) tables store the headers of the data parts compactly using a single `znode` . If the table contains many columns, this storage method significantly reduces the volume of the data stored in Zookeeper.
2019-03-21 14:57:17 +00:00
2020-03-20 10:10:48 +00:00
!!! attention "Attention"
After applying `use_minimalistic_part_header_in_zookeeper = 1` , you can’ t downgrade the ClickHouse server to a version that doesn’ t support this setting. Be careful when upgrading ClickHouse on servers in a cluster. Don’ t upgrade all the servers at once. It is safer to test new versions of ClickHouse in a test environment, or on just a few servers of a cluster.
2019-03-21 14:57:17 +00:00
2020-03-21 04:11:51 +00:00
Data part headers already stored with this setting can't be restored to their previous (non-compact) representation.
2019-03-21 14:57:17 +00:00
**Default value:** 0.
2020-10-13 17:23:29 +00:00
## disable_internal_dns_cache {#server-settings-disable-internal-dns-cache}
2019-09-12 16:58:19 +00:00
Disables the internal DNS cache. Recommended for operating ClickHouse in systems
with frequently changing infrastructure such as Kubernetes.
**Default value:** 0.
2020-10-13 17:23:29 +00:00
## dns_cache_update_period {#server-settings-dns-cache-update-period}
2019-09-12 16:58:19 +00:00
The period of updating IP addresses stored in the ClickHouse internal DNS cache (in seconds).
The update is performed asynchronously, in a separate system thread.
**Default value**: 15.
2020-06-02 18:11:56 +00:00
**See also**
2020-10-13 17:23:29 +00:00
- [background_schedule_pool_size ](../../operations/settings/settings.md#background_schedule_pool_size )
2020-05-01 14:48:16 +00:00
2020-10-13 17:23:29 +00:00
## access_control_path {#access_control_path}
2020-05-01 14:48:16 +00:00
Path to a folder where a ClickHouse server stores user and role configurations created by SQL commands.
Default value: `/var/lib/clickhouse/access/` .
**See also**
2020-06-18 08:24:31 +00:00
- [Access Control and Account Management ](../../operations/access-rights.md#access-control )
2020-05-01 14:48:16 +00:00
2020-04-03 13:23:32 +00:00
[Original article ](https://clickhouse.tech/docs/en/operations/server_configuration_parameters/settings/ ) <!--hide-->