2020-03-20 18:20:59 +00:00
# Конфигурационные параметры сервера {#konfiguratsionnye-parametry-servera}
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
## builtin\_dictionaries\_reload\_interval {#builtin-dictionaries-reload-interval}
2017-10-25 05:27:09 +00:00
Интервал (в секундах) перезагрузки встроенных словарей.
2020-03-20 18:20:59 +00:00
ClickHouse перезагружает встроенные словари с заданным интервалом. Это позволяет править словари «на лету» без перезапуска сервера.
2017-10-25 05:27:09 +00:00
Значение по умолчанию - 3600.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< builtin_dictionaries_reload_interval > 3600< / builtin_dictionaries_reload_interval >
```
2020-03-20 18:20:59 +00:00
## compression {#compression}
2017-10-25 05:27:09 +00:00
Настройки компрессии данных.
2018-07-20 17:35:34 +00:00
!!! warning "Внимание"
Лучше не использовать, если вы только начали работать с ClickHouse.
2017-10-25 05:27:09 +00:00
Общий вид конфигурации:
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< compression >
< case >
< parameters / >
< / case >
...
< / compression >
```
Можно сконфигурировать несколько разделов `<case>` .
Поля блока `<case>` :
2020-03-21 04:11:51 +00:00
- `min_part_size` - Минимальный размер части таблицы.
- `min_part_size_ratio` - Отношение размера минимальной части таблицы к полному размеру таблицы.
- `method` - Метод сжатия. Возможные значения: `lz4` , `zstd` (экспериментальный).
2017-10-25 05:27:09 +00:00
ClickHouse проверит условия `min_part_size` и `min_part_size_ratio` и выполнит те блоки `case` , для которых условия совпали. Если ни один `<case>` не подходит, то ClickHouse применит алгоритм сжатия `lz4` .
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +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-03-20 18:20:59 +00:00
## default\_database {#default-database}
2017-10-25 05:27:09 +00:00
База данных по умолчанию.
2019-11-01 14:20:28 +00:00
Перечень баз данных можно получить запросом [SHOW DATABASES ](../../query_language/show.md#show-databases ).
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< default_database > default< / default_database >
```
2020-03-20 18:20:59 +00:00
## default\_profile {#default-profile}
2017-10-25 05:27:09 +00:00
Профиль настроек по умолчанию.
2018-12-18 11:32:08 +00:00
Профили настроек находятся в файле, указанном в параметре `user_config` .
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< default_profile > default< / default_profile >
```
2020-03-20 18:20:59 +00:00
## dictionaries\_config {#dictionaries-config}
2017-10-25 05:27:09 +00:00
Путь к конфигурации внешних словарей.
Путь:
2020-03-21 04:11:51 +00:00
- Указывается абсолютным или относительно конфигурационного файла сервера.
- Может содержать wildcard-ы \* и ?.
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
Смотрите также «[Внешние словари](../../query_language/dicts/external_dicts.md)».
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< dictionaries_config > *_dictionary.xml< / dictionaries_config >
```
2020-03-20 18:20:59 +00:00
## dictionaries\_lazy\_load {#dictionaries-lazy-load}
2017-10-25 05:27:09 +00:00
Отложенная загрузка словарей.
Если `true` , то каждый словарь создаётся при первом использовании. Если словарь не удалось создать, то вызов функции, использующей словарь, сгенерирует исключение.
Если `false` , то все словари создаются при старте сервера, и в случае ошибки сервер завершает работу.
По умолчанию - `true` .
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< dictionaries_lazy_load > true< / dictionaries_lazy_load >
```
2020-03-22 09:14:59 +00:00
## format\_schema\_path {#server_settings-format_schema_path}
2017-11-17 14:12:34 +00:00
2018-12-21 19:23:55 +00:00
Путь к каталогу с о схемами для входных данных. Например с о схемами для формата [CapnProto ](../../interfaces/formats.md#capnproto ).
2017-11-17 14:12:34 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-11-17 14:12:34 +00:00
<!-- Directory containing schema files for various input formats. -->
< format_schema_path > format_schemas/< / format_schema_path >
```
2020-03-22 09:14:59 +00:00
## graphite {#server_settings-graphite}
2017-10-25 05:27:09 +00:00
2019-08-23 10:55:34 +00:00
Отправка данных в [Graphite ](https://github.com/graphite-project ).
2017-10-25 05:27:09 +00:00
Настройки:
2020-03-21 04:11:51 +00:00
- host – Сервер Graphite.
- port – Порт сервера Graphite.
- interval – Период отправки в секундах.
- timeout – Таймаут отправки данных в секундах.
- root\_path – Префикс для ключей.
- metrics – Отправка данных из таблицы [system.metrics ](../system_tables.md#system_tables-metrics ).
- events – Отправка дельты данных, накопленной за промежуток времени из таблицы [system.events ](../system_tables.md#system_tables-events ).
- events\_cumulative – Отправка суммарных данных из таблицы [system.events ](../system_tables.md#system_tables-events ).
- asynchronous\_metrics – Отправка данных из таблицы [system.asynchronous\_metrics ](../system_tables.md#system_tables-asynchronous_metrics ).
2017-10-25 05:27:09 +00:00
Можно определить несколько секций `<graphite>` , например, для передачи различных данных с различной частотой.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +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-10-25 05:27:09 +00:00
< asynchronous_metrics > true< / asynchronous_metrics >
< / graphite >
```
2020-03-22 09:14:59 +00:00
## graphite\_rollup {#server_settings-graphite-rollup}
2017-10-25 05:27:09 +00:00
Настройка прореживания данных для Graphite.
2020-01-24 12:26:31 +00:00
Подробнее читайте в разделе [GraphiteMergeTree ](../table_engines/graphitemergetree.md ).
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +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-03-20 18:20:59 +00:00
## http\_port/https\_port {#http-porthttps-port}
2017-10-25 05:27:09 +00:00
Порт для обращений к серверу по протоколу HTTP(s).
2019-03-20 12:57:03 +00:00
Если указан `https_port` , то требуется конфигурирование [openSSL ](#server_settings-openssl ).
2017-10-25 05:27:09 +00:00
Если указан `http_port` , то настройка openSSL игнорируется, даже если она задана.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< https > 0000< / https >
```
2020-03-22 09:14:59 +00:00
## http\_server\_default\_response {#server_settings-http_server_default_response}
2017-10-25 05:27:09 +00:00
Страница, показываемая по умолчанию, при обращении к HTTP(s) серверу ClickHouse.
2020-03-20 18:20:59 +00:00
Значение по умолчанию «Ok.» (с переводом строки на конце).
2017-10-25 05:27:09 +00:00
**Пример**
2019-08-23 10:55:34 +00:00
Показывает `https://tabix.io/` при обращении к `http://localhost:http_port` .
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +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-03-22 09:14:59 +00:00
## include\_from {#server_settings-include_from}
2017-10-25 05:27:09 +00:00
Путь к файлу с подстановками.
2020-03-20 18:20:59 +00:00
Подробности смотрите в разделе «[Конфигурационный файлы](../configuration_files.md#configuration_files)».
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< include_from > /etc/metrica.xml< / include_from >
```
2020-03-20 18:20:59 +00:00
## interserver\_http\_port {#interserver-http-port}
2017-10-25 05:27:09 +00:00
Порт для обмена между серверами ClickHouse.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< interserver_http_port > 9009< / interserver_http_port >
```
2020-03-20 18:20:59 +00:00
## interserver\_http\_host {#interserver-http-host}
2017-10-25 05:27:09 +00:00
Имя хоста, которое могут использовать другие серверы для обращения к этому.
Если не указано, то определяется аналогично команде `hostname -f` .
Удобно использовать, чтобы отвязаться от конкретного сетевого интерфейса.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< interserver_http_host > example.yandex.ru< / interserver_http_host >
```
2020-03-20 18:20:59 +00:00
## interserver\_http\_credentials {#server-settings-interserver-http-credentials}
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
Имя пользователя и пароль, использующиеся для аутентификации при [репликации ](../table_engines/replication.md ) движками Replicated\*. Это имя пользователя и пароль используются только для взаимодействия между репликами кластера и никак не связаны с аутентификацией клиентов ClickHouse. Сервер проверяет совпадение имени и пароля для соединяющихся с ним реплик, а также использует это же имя и пароль для соединения с другими репликами. Соответственно, эти имя и пароль должны быть прописаны одинаковыми для всех реплик кластера.
2019-09-24 23:14:23 +00:00
По умолчанию аутентификация не используется.
Раздел содержит следующие параметры:
2020-03-21 04:11:51 +00:00
- `user` — имя пользователя.
- `password` — пароль.
2019-09-24 23:14:23 +00:00
**Пример конфигурации**
2020-03-20 18:20:59 +00:00
``` xml
2019-09-24 23:14:23 +00:00
< interserver_http_credentials >
< user > admin< / user >
< password > 222< / password >
< / interserver_http_credentials >
```
2020-03-20 18:20:59 +00:00
## keep\_alive\_timeout {#keep-alive-timeout}
2017-10-25 05:27:09 +00:00
2018-10-09 10:34:46 +00:00
Время в секундах, в течение которого ClickHouse ожидает входящих запросов прежде, чем закрыть соединение.
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2019-01-31 12:23:18 +00:00
< keep_alive_timeout > 3< / keep_alive_timeout >
2017-10-25 05:27:09 +00:00
```
2020-03-22 09:14:59 +00:00
## listen\_host {#server_settings-listen_host}
2017-10-25 05:27:09 +00:00
Ограничение по хостам, с которых может прийти запрос. Если необходимо, чтобы сервер отвечал всем, то надо указать `::` .
Примеры:
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< listen_host > ::1< / listen_host >
< listen_host > 127.0.0.1< / listen_host >
```
2020-03-22 09:14:59 +00:00
## logger {#server_settings-logger}
2017-10-25 05:27:09 +00:00
2019-08-23 10:55:34 +00:00
Настройки логирования.
2017-10-25 05:27:09 +00:00
Ключи:
2020-03-21 04:11:51 +00:00
- level - Уровень логирования. Допустимые значения: `trace` , `debug` , `information` , `warning` , `error` .
- log - Файл лога. Содержит все записи согласно `level` .
- errorlog - Файл лога ошибок.
- size - Размер файла. Действует для `log` и `errorlog` . Как только файл достиг размера `size` , ClickHouse архивирует и переименовывает е г о , а на е г о месте создает новый файл лога.
- count - Количество заархивированных файлов логов, которые сохраняет ClickHouse.
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +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-06-01 15:06:45 +00:00
Также, существует поддержка записи в syslog. Пример конфига:
2020-03-20 18:20:59 +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-03-20 18:20:59 +00:00
- use\_syslog - обязательная настройка, если требуется запись в syslog
- address - хост\[:порт\] демона syslogd. Если не указан, используется локальный
2018-06-01 15:06:45 +00:00
- hostname - опционально, имя хоста, с которого отсылаются логи
2018-07-20 17:35:34 +00:00
- facility - [категория syslog ](https://en.wikipedia.org/wiki/Syslog#Facility ),
2020-03-20 18:20:59 +00:00
записанная в верхнем регистре, с префиксом «LOG\_»: (`LOG_USER`, `LOG_DAEMON` , `LOG_LOCAL3` и прочие).
Значения по умолчанию: при указанном `address` - `LOG_USER` , иначе - `LOG_DAEMON`
- format - формат сообщений. Возможные значения - `bsd` и `syslog`
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
## macros {#macros}
2017-10-25 05:27:09 +00:00
Подстановки параметров реплицируемых таблиц.
Можно не указывать, если реплицируемых таблицы не используются.
2020-03-20 18:20:59 +00:00
Подробнее смотрите в разделе «[Создание реплицируемых таблиц](../../operations/table_engines/replication.md)».
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< macros incl = "macros" optional = "true" / >
```
2020-03-20 18:20:59 +00:00
## mark\_cache\_size {#server-mark-cache-size}
2017-10-25 05:27:09 +00:00
2020-01-24 12:26:31 +00:00
Приблизительный размер (в байтах) кэша засечек, используемых движками таблиц семейства [MergeTree ](../table_engines/mergetree.md ).
2017-10-25 05:27:09 +00:00
2019-12-31 02:47:10 +00:00
Кэш общий для сервера, память выделяется по мере необходимости.
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< mark_cache_size > 5368709120< / mark_cache_size >
```
2020-03-20 18:20:59 +00:00
## max\_concurrent\_queries {#max-concurrent-queries}
2017-10-25 05:27:09 +00:00
Максимальное количество одновременно обрабатываемых запросов.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< max_concurrent_queries > 100< / max_concurrent_queries >
```
2020-03-20 18:20:59 +00:00
## max\_connections {#max-connections}
2017-10-25 05:27:09 +00:00
Максимальное количество входящих соединений.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< max_connections > 4096< / max_connections >
```
2020-03-20 18:20:59 +00:00
## max\_open\_files {#max-open-files}
2017-10-25 05:27:09 +00:00
Максимальное количество открытых файлов.
По умолчанию - `maximum` .
2019-08-23 10:55:34 +00:00
Рекомендуется использовать в Mac OS X, поскольку функция `getrlimit()` возвращает некорректное значение.
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< max_open_files > 262144< / max_open_files >
```
2020-03-20 18:20:59 +00:00
## max\_table\_size\_to\_drop {#max-table-size-to-drop}
2017-10-25 05:27:09 +00:00
Ограничение на удаление таблиц.
2020-01-24 12:26:31 +00:00
Если размер таблицы семейства [MergeTree ](../table_engines/mergetree.md ) превышает `max_table_size_to_drop` (в байтах), то е е нельзя удалить запросом DROP.
2017-10-25 05:27:09 +00:00
Если таблицу все же необходимо удалить, не перезапуская при этом сервер ClickHouse, то необходимо создать файл `<clickhouse-path>/flags/force_drop_table` и выполнить запрос DROP.
Значение по умолчанию - 50GB.
Значение 0 означает, что можно удалять все таблицы без ограничений.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< max_table_size_to_drop > 0< / max_table_size_to_drop >
```
2020-03-22 09:14:59 +00:00
## merge\_tree {#server_settings-merge_tree}
2017-10-25 05:27:09 +00:00
2020-01-24 12:26:31 +00:00
Тонкая настройка таблиц семейства [MergeTree ](../table_engines/mergetree.md ).
2017-10-25 05:27:09 +00:00
Подробнее смотрите в заголовочном файле MergeTreeSettings.h.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< merge_tree >
< max_suspicious_broken_parts > 5< / max_suspicious_broken_parts >
< / merge_tree >
```
2020-03-22 09:14:59 +00:00
## openSSL {#server_settings-openssl}
2017-10-25 05:27:09 +00:00
Настройки клиента/сервера SSL.
2020-03-20 18:20:59 +00:00
Поддержку SSL обеспечивает библиотека `libpoco` . Описание интерфейса находится в файле [SSLManager.h ](https://github.com/ClickHouse-Extras/poco/blob/master/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h )
2017-10-25 05:27:09 +00:00
Ключи настроек сервера/клиента:
2020-03-21 04:11:51 +00:00
- privateKeyFile - Путь к файлу с секретным ключом сертификата в формате PEM. Файл может содержать ключ и сертификат одновременно.
- certificateFile - Путь к файлу сертификата клиента/сервера в формате PEM. Можно не указывать, если `privateKeyFile` содержит сертификат.
- caConfig - Путь к файлу или каталогу, которые содержат доверенные корневые сертификаты.
- verificationMode - Способ проверки сертификатов узла. Подробности находятся в описании класса [Context ](https://github.com/ClickHouse-Extras/poco/blob/master/NetSSL_OpenSSL/include/Poco/Net/Context.h ). Допустимые значения: `none` , `relaxed` , `strict` , `once` .
- verificationDepth - Максимальная длина верификационной цепи. Верификация завершится ошибкой, если длина цепи сертификатов превысит установленное значение.
- loadDefaultCAFile - Признак того, что будут использоваться встроенные CA-сертификаты для OpenSSL. Допустимые значения: `true` , `false` . \|
- cipherList - Поддерживаемые OpenSSL-шифры. Например, `ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH` .
- cacheSessions - Включение/выключение кеширования сессии. Использовать обязательно вместе с `sessionIdContext` . Допустимые значения: `true` , `false` .
- sessionIdContext - Уникальный набор произвольных символов, которые сервер добавляет к каждому сгенерированному идентификатору. Длина строки не должна превышать `SSL_MAX_SSL_SESSION_ID_LENGTH` . Рекомендуется к использованию всегда, поскольку позволяет избежать проблем как в случае, если сервер кеширует сессию, так и если клиент затребовал кеширование. По умолчанию `${application.name}` .
- sessionCacheSize - Максимальное количество сессий, которые кэширует сервер. По умолчанию - 1024\*20. 0 - неограниченное количество сессий.
- sessionTimeout - Время кеширования сессии на сервере.
- extendedVerification - Автоматическая расширенная проверка сертификатов после завершении сессии. Допустимые значения: `true` , `false` .
- requireTLSv1 - Требование соединения TLSv1. Допустимые значения: `true` , `false` .
- requireTLSv1\_1 - Требование соединения TLSv1.1. Допустимые значения: `true` , `false` .
- requireTLSv1\_2 - Требование соединения TLSv1.2. Допустимые значения: `true` , `false` .
- fips - Активация режима OpenSSL FIPS. Поддерживается, если версия OpenSSL, с которой собрана библиотека поддерживает fips.
- privateKeyPassphraseHandler - Класс (подкласс PrivateKeyPassphraseHandler)запрашивающий кодовую фразу доступа к секретному ключу. Например, `<privateKeyPassphraseHandler>` , `<name>KeyFileHandler</name>` , `<options><password>test</password></options>` , `</privateKeyPassphraseHandler>` .
- invalidCertificateHandler - Класс (подкласс CertificateHandler) для подтверждения не валидных сертификатов. Например, `<invalidCertificateHandler> <name>ConsoleCertificateHandler</name> </invalidCertificateHandler>` .
- disableProtocols - Запрещенные к использованию протоколы.
- preferServerCiphers - Предпочтение серверных шифров на клиенте.
2017-10-25 05:27:09 +00:00
**Пример настройки:**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +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-03-22 09:14:59 +00:00
## part\_log {#server_settings-part-log}
2017-10-25 05:27:09 +00:00
2020-01-24 12:26:31 +00:00
Логирование событий, связанных с данными типа [MergeTree ](../table_engines/mergetree.md ). Например, события добавления или мержа данных. Лог можно использовать для симуляции алгоритмов слияния, чтобы сравнивать их характеристики. Также, можно визуализировать процесс слияния.
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
Запросы логируются не в отдельный файл, а в таблицу [system.part\_log ](../system_tables.md#system_tables-part-log ). Вы можете изменить название этой таблицы в параметре `table` (см. ниже).
2017-10-25 05:27:09 +00:00
2019-08-23 10:55:34 +00:00
При настройке логирования используются следующие параметры:
2017-10-25 05:27:09 +00:00
2020-03-21 04:11:51 +00:00
- `database` — имя базы данных;
- `table` — имя таблицы;
- `partition_by` — устанавливает [произвольный ключ партиционирования ](../../operations/table_engines/custom_partitioning_key.md );
- `flush_interval_milliseconds` — период с б р о с а данных из буфера в памяти в таблицу.
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +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-10-25 05:27:09 +00:00
< flush_interval_milliseconds > 7500< / flush_interval_milliseconds >
< / part_log >
```
2020-03-22 09:14:59 +00:00
## path {#server_settings-path}
2017-10-25 05:27:09 +00:00
Путь к каталогу с данными.
2018-07-20 17:35:34 +00:00
!!! warning "Обратите внимание"
Завершающий слеш обязателен.
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< path > /var/lib/clickhouse/< / path >
```
2020-03-22 09:14:59 +00:00
## query\_log {#server_settings-query-log}
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
Настройка логирования запросов, принятых с настройкой [log\_queries=1 ](../settings/settings.md ).
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
Запросы логируются не в отдельный файл, а в системную таблицу [system.query\_log ](../system_tables.md#system_tables-query-log ). Вы можете изменить название этой таблицы в параметре `table` (см. ниже).
2017-10-25 05:27:09 +00:00
2019-04-18 11:23:34 +00:00
При настройке логирования используются следующие параметры:
2017-10-25 05:27:09 +00:00
2020-03-21 04:11:51 +00:00
- `database` — имя базы данных;
- `table` — имя таблицы, куда будет записываться лог;
- `partition_by` — [произвольный ключ партиционирования ](../../operations/table_engines/custom_partitioning_key.md ) для таблицы с логами;
- `flush_interval_milliseconds` — период с б р о с а данных из буфера в памяти в таблицу.
2017-10-25 05:27:09 +00:00
Если таблица не существует, то ClickHouse создаст её. Если структура журнала запросов изменилась при обновлении сервера ClickHouse, то таблица с о старой структурой переименовывается, а новая таблица создается автоматически.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< query_log >
< database > system< / database >
< table > query_log< / table >
2018-02-14 08:01:41 +00:00
< partition_by > toMonday(event_date)< / partition_by >
2017-10-25 05:27:09 +00:00
< flush_interval_milliseconds > 7500< / flush_interval_milliseconds >
< / query_log >
```
2020-03-22 09:14:59 +00:00
## query\_thread\_log {#server_settings-query-thread-log}
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
Настройка логирования потоков выполнения запросов, принятых с настройкой [log\_query\_threads=1 ](../settings/settings.md#settings-log-query-threads ).
2019-10-23 22:52:22 +00:00
2020-03-20 18:20:59 +00:00
Запросы логируются не в отдельный файл, а в системную таблицу [system.query\_thread\_log ](../system_tables.md#system_tables-query-thread-log ). Вы можете изменить название этой таблицы в параметре `table` (см. ниже).
2019-10-23 22:52:22 +00:00
При настройке логирования используются следующие параметры:
2020-03-21 04:11:51 +00:00
- `database` — имя базы данных;
- `table` — имя таблицы, куда будет записываться лог;
- `partition_by` — [произвольный ключ партиционирования ](../../operations/table_engines/custom_partitioning_key.md ) для таблицы с логами;
- `flush_interval_milliseconds` — период с б р о с а данных из буфера в памяти в таблицу.
2019-10-23 22:52:22 +00:00
Если таблица не существует, то ClickHouse создаст её. Если структура журнала запросов изменилась при обновлении сервера ClickHouse, то таблица с о старой структурой переименовывается, а новая таблица создается автоматически.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2019-10-23 22:52:22 +00:00
< query_thread_log >
< database > system< / database >
2019-12-02 22:34:02 +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-03-22 09:14:59 +00:00
## trace\_log {#server_settings-trace_log}
2020-02-03 13:30:11 +00:00
2020-03-20 18:20:59 +00:00
Settings for the [trace\_log ](../system_tables.md#system_tables-trace_log ) system table operation.
2020-02-03 13:30:11 +00:00
Parameters:
2020-03-21 04:11:51 +00:00
- `database` — Database for storing a table.
- `table` — Table name.
- `partition_by` — [Custom partitioning key ](../../operations/table_engines/custom_partitioning_key.md ) for a system table.
- `flush_interval_milliseconds` — Interval for flushing data from the buffer in memory to the table.
2020-02-03 13:30:11 +00:00
The default server configuration file `config.xml` contains the following settings section:
2020-03-20 18:20:59 +00:00
``` xml
2020-02-03 13:30:11 +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 >
```
2019-10-23 22:52:22 +00:00
2020-03-20 18:20:59 +00:00
## remote\_servers {#server-settings-remote-servers}
2017-10-25 05:27:09 +00:00
2019-11-05 19:15:54 +00:00
Конфигурация кластеров, которые использует движок таблиц [Distributed ](../../operations/table_engines/distributed.md ) и табличная функция `cluster` .
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< remote_servers incl = "clickhouse_remote_servers" / >
```
2020-03-20 18:20:59 +00:00
Значение атрибута `incl` смотрите в разделе «[Конфигурационные файлы](../configuration_files.md#configuration_files)».
2017-10-25 05:27:09 +00:00
2019-11-05 19:15:54 +00:00
**Смотрите также**
2020-03-21 04:11:51 +00:00
- [skip\_unavailable\_shards ](../settings/settings.md#settings-skip_unavailable_shards )
2017-10-25 05:27:09 +00:00
2020-03-22 09:14:59 +00:00
## timezone {#server_settings-timezone}
2017-10-25 05:27:09 +00:00
Временная зона сервера.
Указывается идентификатором IANA в виде часового пояса UTC или географического положения (например, Africa/Abidjan).
Временная зона необходима при преобразованиях между форматами String и DateTime, которые возникают при выводе полей DateTime в текстовый формат (на экран или в файл) и при получении DateTime из строки. Также, временная зона используется в функциях, которые работают с о временем и датой, если они не получили временную зону в параметрах вызова.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< timezone > Europe/Moscow< / timezone >
```
2020-03-22 09:14:59 +00:00
## tcp\_port {#server_settings-tcp_port}
2017-10-25 05:27:09 +00:00
Порт для взаимодействия с клиентами по протоколу TCP.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< tcp_port > 9000< / tcp_port >
```
2020-03-22 09:14:59 +00:00
## tcp\_port\_secure {#server_settings-tcp_port-secure}
2019-03-20 12:57:03 +00:00
TCP порт для защищённого обмена данными с клиентами. Используйте с настройкой [OpenSSL ](#server_settings-openssl ).
**Возможные значения**
Положительное целое число.
**Значение по умолчанию**
2020-03-20 18:20:59 +00:00
``` xml
2019-03-20 12:57:03 +00:00
< tcp_port_secure > 9440< / tcp_port_secure >
```
2017-10-25 05:27:09 +00:00
2020-03-22 09:14:59 +00:00
## mysql\_port {#server_settings-mysql_port}
2020-01-19 05:57:21 +00:00
Порт для взаимодействия с клиентами по протоколу MySQL.
Пример
2020-03-20 18:20:59 +00:00
``` xml
2020-01-19 05:57:21 +00:00
< mysql_port > 9004< / mysql_port >
```
2020-03-20 18:20:59 +00:00
## tmp\_path {#tmp-path}
2017-10-25 05:27:09 +00:00
Путь ко временным данным для обработки больших запросов.
2018-07-20 17:35:34 +00:00
!!! warning "Обратите внимание"
Завершающий слеш обязателен.
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< tmp_path > /var/lib/clickhouse/tmp/< / tmp_path >
```
2020-03-22 09:14:59 +00:00
## uncompressed\_cache\_size {#server-settings-uncompressed_cache_size}
2017-10-25 05:27:09 +00:00
2020-01-24 12:26:31 +00:00
Размер кеша (в байтах) для несжатых данных, используемых движками таблиц семейства [MergeTree ](../table_engines/mergetree.md ).
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
Кеш единый для сервера. Память выделяется по требованию. Кеш используется в том случае, если включена опция [use\_uncompressed\_cache ](../settings/settings.md ).
2017-10-25 05:27:09 +00:00
Несжатый кеш выгодно использовать для очень коротких запросов в отдельных случаях.
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< uncompressed_cache_size > 8589934592< / uncompressed_cache_size >
```
2020-03-22 09:14:59 +00:00
## user\_files\_path {#server_settings-user_files_path}
2018-05-14 19:58:49 +00:00
2018-12-12 17:28:00 +00:00
Каталог с пользовательскими файлами. Используется в табличной функции [file() ](../../query_language/table_functions/file.md ).
2018-05-14 19:58:49 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2018-05-14 19:58:49 +00:00
< user_files_path > /var/lib/clickhouse/user_files/< / user_files_path >
```
2020-03-20 18:20:59 +00:00
## users\_config {#users-config}
2017-10-25 05:27:09 +00:00
Путь к файлу, который содержит:
2020-03-21 04:11:51 +00:00
- Конфигурации пользователей.
- Права доступа.
- Профили настроек.
- Настройки квот.
2017-10-25 05:27:09 +00:00
**Пример**
2020-03-20 18:20:59 +00:00
``` xml
2017-10-25 05:27:09 +00:00
< users_config > users.xml< / users_config >
```
2020-03-22 09:14:59 +00:00
## zookeeper {#server-settings_zookeeper}
2017-10-25 05:27:09 +00:00
2019-06-13 03:14:04 +00:00
Содержит параметры, позволяющие ClickHouse взаимодействовать с кластером [ZooKeeper ](http://zookeeper.apache.org/ ).
2017-10-25 05:27:09 +00:00
2019-06-13 03:14:04 +00:00
ClickHouse использует ZooKeeper для хранения метаданных о репликах при использовании реплицированных таблиц. Если реплицированные таблицы не используются, этот раздел параметров может отсутствовать.
2017-10-25 05:27:09 +00:00
2019-06-13 03:14:04 +00:00
Раздел содержит следующие параметры:
2019-05-23 11:55:31 +00:00
2020-03-21 04:11:51 +00:00
- `node` — адрес ноды (сервера) ZooKeeper. Можно сконфигурировать несколько нод.
2017-10-25 05:27:09 +00:00
2020-03-21 04:11:51 +00:00
Например:
2019-05-23 11:55:31 +00:00
2020-03-20 18:20:59 +00:00
<!-- -->
``` xml
2019-05-23 11:55:31 +00:00
< node index = "1" >
< host > example_host< / host >
< port > 2181< / port >
< / node >
2019-11-21 12:24:42 +00:00
```
2019-05-23 11:55:31 +00:00
2020-03-21 04:11:51 +00:00
Атрибут `index` задает порядок опроса нод при попытках подключиться к кластеру ZooKeeper.
2019-05-23 11:55:31 +00:00
2020-03-21 04:11:51 +00:00
- `session_timeout` — максимальный таймаут клиентской сессии в миллисекундах.
- `root` — [znode ](http://zookeeper.apache.org/doc/r3.5.5/zookeeperOver.html#Nodes+and+ephemeral+nodes ), который используется как корневой для всех znode, которые использует сервер ClickHouse. Необязательный.
- `identity` — пользователь и пароль, которые может потребовать ZooKeeper для доступа к запрошенным znode. Необязательный.
2017-10-25 05:27:09 +00:00
2019-06-13 03:14:04 +00:00
**Пример конфигурации**
2017-10-25 05:27:09 +00:00
2020-03-20 18:20:59 +00:00
``` xml
2018-12-21 10:21:24 +00:00
< zookeeper >
2019-05-23 11:55:31 +00:00
< node >
2018-12-21 10:21:24 +00:00
< host > example1< / host >
< port > 2181< / port >
< / node >
2019-05-23 11:55:31 +00:00
< node >
2018-12-21 10:21:24 +00:00
< host > example2< / host >
< port > 2181< / port >
< / node >
2019-05-23 11:55:31 +00:00
< session_timeout_ms > 30000< / session_timeout_ms >
<!-- Optional. Chroot suffix. Should exist. -->
< root > /path/to/zookeeper/node< / root >
<!-- Optional. Zookeeper digest ACL string. -->
< identity > user:password< / identity >
2018-12-21 10:21:24 +00:00
< / zookeeper >
2017-10-25 05:27:09 +00:00
```
2018-10-16 10:47:17 +00:00
2019-06-13 03:14:04 +00:00
**Смотрите также**
2019-05-23 11:55:31 +00:00
2020-03-21 04:11:51 +00:00
- [Репликация ](../../operations/table_engines/replication.md )
- [ZooKeeper Programmer’ s Guide ](http://zookeeper.apache.org/doc/current/zookeeperProgrammers.html )
2019-05-23 11:55:31 +00:00
2020-03-22 09:14:59 +00:00
## use\_minimalistic\_part\_header\_in\_zookeeper {#server-settings-use_minimalistic_part_header_in_zookeeper}
2019-04-10 12:13:45 +00:00
Способ хранения заголовков кусков данных в ZooKeeper.
Параметр применяется только к семейству таблиц `MergeTree` . Е г о можно установить:
2020-03-21 04:11:51 +00:00
- Глобально в разделе [merge\_tree ](#server_settings-merge_tree ) файла `config.xml` .
2019-04-10 12:13:45 +00:00
2020-03-21 04:11:51 +00:00
ClickHouse использует этот параметр для всех таблиц на сервере. Вы можете изменить настройку в любое время. Существующие таблицы изменяют свое поведение при изменении параметра.
2019-04-10 12:13:45 +00:00
2020-03-21 04:11:51 +00:00
- Для каждой отдельной таблицы.
2019-04-10 12:13:45 +00:00
2020-03-21 04:11:51 +00:00
При создании таблицы укажите соответствующую [настройку движка ](../table_engines/mergetree.md#table_engine-mergetree-creating-a-table ). Поведение существующей таблицы с установленным параметром не изменяется даже при изменении глобального параметра.
2019-04-10 12:13:45 +00:00
**Возможные значения**
2020-03-21 04:11:51 +00:00
- 0 — функциональность выключена.
- 1 — функциональность включена.
2019-04-10 12:13:45 +00:00
2020-02-02 21:46:31 +00:00
Если `use_minimalistic_part_header_in_zookeeper = 1` , то [реплицированные ](../table_engines/replication.md ) таблицы хранят заголовки кусков данных в компактном виде, используя только одну `znode` . Если таблица содержит много столбцов, этот метод хранения значительно уменьшает объём данных, хранящихся в Zookeeper.
2019-04-10 12:13:45 +00:00
!!! attention "Внимание"
После того как вы установили `use_minimalistic_part_header_in_zookeeper = 1` , невозможно откатить ClickHouse до версии, которая не поддерживает этот параметр. Будьте осторожны при обновлении ClickHouse на серверах в кластере. Н е обновляйте все серверы сразу. Безопаснее проверять новые версии ClickHouse в тестовой среде или только на некоторых серверах кластера.
2020-03-21 04:11:51 +00:00
Заголовки частей данных, ранее сохранённые с этим параметром, не могут быть восстановлены в их предыдущем (некомпактном) представлении.
2019-04-10 12:13:45 +00:00
**Значение по умолчанию**: 0.
2020-03-20 18:20:59 +00:00
## disable\_internal\_dns\_cache {#server-settings-disable-internal-dns-cache}
2019-09-12 16:58:19 +00:00
Отключает внутренний кеш DNS записей. Используется при эксплуатации ClickHouse в системах
с часто меняющейся инфраструктурой, таких как Kubernetes.
**Значение по умолчанию**: 0.
2020-03-20 18:20:59 +00:00
## dns\_cache\_update\_period {#server-settings-dns-cache-update-period}
2019-09-12 16:58:19 +00:00
Период обновления IP адресов у записей во внутреннем DNS кеше ClickHouse (в секундах).
Обновление выполняется асинхронно, отдельным системным потоком.
**Значение по умолчанию**: 15.
2020-01-30 10:34:55 +00:00
[Оригинальная статья ](https://clickhouse.tech/docs/ru/operations/server_settings/settings/ ) <!--hide-->