From ef7a00f397e462b5308536ab25e98f78aa8c1734 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 25 Oct 2021 21:15:41 +0300 Subject: [PATCH 01/10] clickhouse-local: switch root node from to --- programs/local/LocalServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/local/LocalServer.cpp b/programs/local/LocalServer.cpp index 69f7820909a..af8c4a3fe6a 100644 --- a/programs/local/LocalServer.cpp +++ b/programs/local/LocalServer.cpp @@ -354,7 +354,7 @@ static ConfigurationPtr getConfigurationFromXMLString(const char * xml_data) void LocalServer::setupUsers() { static const char * minimal_default_user_xml = - "" + "" " " " " " " @@ -371,7 +371,7 @@ void LocalServer::setupUsers() " " " " " " - ""; + ""; ConfigurationPtr users_config; From e0cd7a8304a2cb2b5a487a3e26417dab4d46cbf8 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Oct 2021 08:50:15 +0300 Subject: [PATCH 02/10] docs: switch to --- docs/en/operations/configuration-files.md | 14 +++++++------- .../external-authenticators/kerberos.md | 16 ++++++++-------- .../operations/external-authenticators/ldap.md | 12 ++++++------ .../server-configuration-parameters/settings.md | 12 ++++++------ docs/en/operations/storing-data.md | 12 ++++++------ docs/en/operations/system-tables/index.md | 4 ++-- .../en/operations/utilities/clickhouse-copier.md | 8 ++++---- .../external-dicts-dict-layout.md | 8 ++++---- .../external-dicts-dict-sources.md | 12 ++++++------ .../external-dictionaries/external-dicts.md | 4 ++-- .../functions/ext-dict-functions.md | 8 ++++---- docs/ja/operations/configuration-files.md | 6 +++--- docs/ja/operations/system-tables.md | 4 ++-- .../ja/operations/utilities/clickhouse-copier.md | 8 ++++---- .../external-dicts-dict-layout.md | 8 ++++---- .../external-dicts-dict-sources.md | 12 ++++++------ .../external-dictionaries/external-dicts.md | 4 ++-- .../functions/ext-dict-functions.md | 4 ++-- docs/ru/operations/configuration-files.md | 14 +++++++------- .../external-authenticators/kerberos.md | 16 ++++++++-------- .../operations/external-authenticators/ldap.md | 12 ++++++------ .../server-configuration-parameters/settings.md | 12 ++++++------ docs/ru/operations/storing-data.md | 12 ++++++------ docs/ru/operations/system-tables/index.md | 4 ++-- .../ru/operations/utilities/clickhouse-copier.md | 8 ++++---- .../external-dicts-dict-layout.md | 8 ++++---- .../external-dicts-dict-sources.md | 12 ++++++------ .../external-dictionaries/external-dicts.md | 4 ++-- .../functions/ext-dict-functions.md | 8 ++++---- docs/zh/operations/configuration-files.md | 6 +++--- docs/zh/operations/system-tables/index.md | 4 ++-- docs/zh/operations/system-tables/metric_log.md | 4 ++-- .../zh/operations/utilities/clickhouse-copier.md | 8 ++++---- .../external-dicts-dict-layout.md | 8 ++++---- .../external-dicts-dict-sources.md | 12 ++++++------ .../external-dictionaries/external-dicts.md | 4 ++-- 36 files changed, 156 insertions(+), 156 deletions(-) diff --git a/docs/en/operations/configuration-files.md b/docs/en/operations/configuration-files.md index f5073afcc23..318910b5b42 100644 --- a/docs/en/operations/configuration-files.md +++ b/docs/en/operations/configuration-files.md @@ -7,7 +7,7 @@ toc_title: Configuration Files ClickHouse supports multi-file configuration management. The main server configuration file is `/etc/clickhouse-server/config.xml` or `/etc/clickhouse-server/config.yaml`. Other files must be in the `/etc/clickhouse-server/config.d` directory. Note, that any configuration file can be written either in XML or YAML, but mixing formats in one file is not supported. For example, you can have main configs as `config.xml` and `users.xml` and write additional files in `config.d` and `users.d` directories in `.yaml`. -All XML files should have the same root element, usually ``. As for YAML, `yandex:` should not be present, the parser will insert it automatically. +All XML files should have the same root element, usually ``. As for YAML, `yandex:` should not be present, the parser will insert it automatically. ## Override {#override} @@ -21,13 +21,13 @@ Some settings specified in the main configuration file can be overridden in othe You can also declare attributes as coming from environment variables by using `from_env="VARIABLE_NAME"`: ```xml - + - + ``` ## Substitution {#substitution} @@ -39,7 +39,7 @@ If you want to replace an entire element with a substitution use `include` as el XML substitution example: ```xml - + @@ -48,7 +48,7 @@ XML substitution example: - + ``` Substitutions can also be performed from ZooKeeper. To do this, specify the attribute `from_zk = "/path/to/node"`. The element value is replaced with the contents of the node at `/path/to/node` in ZooKeeper. You can also put an entire XML subtree on the ZooKeeper node and it will be fully inserted into the source element. @@ -72,7 +72,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml ``` ``` xml - + analytics @@ -83,7 +83,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml analytics - + ``` ## YAML examples {#example} diff --git a/docs/en/operations/external-authenticators/kerberos.md b/docs/en/operations/external-authenticators/kerberos.md index 5fe0b2bfc37..2e2a88dc7a8 100644 --- a/docs/en/operations/external-authenticators/kerberos.md +++ b/docs/en/operations/external-authenticators/kerberos.md @@ -23,32 +23,32 @@ To enable Kerberos, one should include `kerberos` section in `config.xml`. This Example (goes into `config.xml`): ```xml - + - + ``` With principal specification: ```xml - + HTTP/clickhouse.example.com@EXAMPLE.COM - + ``` With filtering by realm: ```xml - + EXAMPLE.COM - + ``` !!! warning "Note" @@ -80,7 +80,7 @@ Parameters: Example (goes into `users.xml`): ```xml - + @@ -91,7 +91,7 @@ Example (goes into `users.xml`): - + ``` !!! warning "Warning" diff --git a/docs/en/operations/external-authenticators/ldap.md b/docs/en/operations/external-authenticators/ldap.md index c33700f0e31..57e6ec1a087 100644 --- a/docs/en/operations/external-authenticators/ldap.md +++ b/docs/en/operations/external-authenticators/ldap.md @@ -14,7 +14,7 @@ To define LDAP server you must add `ldap_servers` section to the `config.xml`. **Example** ```xml - + @@ -45,7 +45,7 @@ To define LDAP server you must add `ldap_servers` section to the `config.xml`. no - + ``` Note, that you can define multiple LDAP servers inside the `ldap_servers` section using distinct names. @@ -90,7 +90,7 @@ At each login attempt, ClickHouse tries to "bind" to the specified DN defined by **Example** ```xml - + @@ -101,7 +101,7 @@ At each login attempt, ClickHouse tries to "bind" to the specified DN defined by - + ``` Note, that user `my_user` refers to `my_ldap_server`. This LDAP server must be configured in the main `config.xml` file as described previously. @@ -125,7 +125,7 @@ At each login attempt, ClickHouse tries to find the user definition locally and Goes into `config.xml`. ```xml - + @@ -156,7 +156,7 @@ Goes into `config.xml`. - + ``` Note that `my_ldap_server` referred in the `ldap` section inside the `user_directories` section must be a previously defined LDAP server that is configured in the `config.xml` (see [LDAP Server Definition](#ldap-server-definition)). diff --git a/docs/en/operations/server-configuration-parameters/settings.md b/docs/en/operations/server-configuration-parameters/settings.md index cdf49678570..d6e4008b2a5 100644 --- a/docs/en/operations/server-configuration-parameters/settings.md +++ b/docs/en/operations/server-configuration-parameters/settings.md @@ -786,14 +786,14 @@ It is enabled by default. If it`s not, you can do this manually. To manually turn on metrics history collection [`system.metric_log`](../../operations/system-tables/metric_log.md), create `/etc/clickhouse-server/config.d/metric_log.xml` with the following content: ``` xml - + system metric_log
7500 1000
-
+ ``` **Disabling** @@ -801,9 +801,9 @@ To manually turn on metrics history collection [`system.metric_log`](../../opera To disable `metric_log` setting, you should create the following file `/etc/clickhouse-server/config.d/disable_metric_log.xml` with the following content: ``` xml - + - + ``` ## replicated_merge_tree {#server_configuration_parameters-replicated_merge_tree} @@ -1039,7 +1039,7 @@ Parameters: **Example** ```xml - + notice system @@ -1048,7 +1048,7 @@ Parameters: Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day - + ``` diff --git a/docs/en/operations/storing-data.md b/docs/en/operations/storing-data.md index bc764a909b8..beffd45bcbd 100644 --- a/docs/en/operations/storing-data.md +++ b/docs/en/operations/storing-data.md @@ -22,7 +22,7 @@ ClickHouse supports zero-copy replication for `S3` and `HDFS` disks, which means Configuration markup: ``` xml - + @@ -44,7 +44,7 @@ Configuration markup: 0 - + ``` Required parameters: @@ -96,7 +96,7 @@ Optional parameters: Example of disk configuration: ``` xml - + @@ -113,7 +113,7 @@ Example of disk configuration: - + ``` ## Storing Data on Web Server {#storing-data-on-webserver} @@ -127,7 +127,7 @@ Web server storage is supported only for the [MergeTree](../engines/table-engine A ready test case. You need to add this configuration to config: ``` xml - + @@ -145,7 +145,7 @@ A ready test case. You need to add this configuration to config: - + ``` And then execute this query: diff --git a/docs/en/operations/system-tables/index.md b/docs/en/operations/system-tables/index.md index 0cc5e834af1..5e8418d0af3 100644 --- a/docs/en/operations/system-tables/index.md +++ b/docs/en/operations/system-tables/index.md @@ -34,7 +34,7 @@ System log tables can be customized by creating a config file with the same name An example: ```xml - + system query_log
@@ -45,7 +45,7 @@ An example: --> 7500
-
+ ``` By default, table growth is unlimited. To control a size of a table, you can use [TTL](../../sql-reference/statements/alter/ttl.md#manipulations-with-table-ttl) settings for removing outdated log records. Also you can use the partitioning feature of `MergeTree`-engine tables. diff --git a/docs/en/operations/utilities/clickhouse-copier.md b/docs/en/operations/utilities/clickhouse-copier.md index 3e729a3a3dd..de3443fb845 100644 --- a/docs/en/operations/utilities/clickhouse-copier.md +++ b/docs/en/operations/utilities/clickhouse-copier.md @@ -47,7 +47,7 @@ Parameters: ## Format of Zookeeper.xml {#format-of-zookeeper-xml} ``` xml - + trace 100M @@ -60,13 +60,13 @@ Parameters: 2181 - + ``` ## Configuration of Copying Tasks {#configuration-of-copying-tasks} ``` xml - + @@ -179,7 +179,7 @@ Parameters: ... - + ``` `clickhouse-copier` tracks the changes in `/task/path/description` and applies them on the fly. For instance, if you change the value of `max_workers`, the number of processes running tasks will also change. diff --git a/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md b/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md index 40f9db12315..effcc614930 100644 --- a/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md +++ b/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md @@ -26,7 +26,7 @@ You can view the list of external dictionaries and their statuses in the `system The configuration looks like this: ``` xml - + ... @@ -36,7 +36,7 @@ The configuration looks like this: ... - + ``` Corresponding [DDL-query](../../../sql-reference/statements/create/dictionary.md): @@ -289,7 +289,7 @@ Details of the algorithm: Configuration example: ``` xml - + ... @@ -317,7 +317,7 @@ Configuration example: - + ``` or diff --git a/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md b/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md index a1d787a37ea..e9746e59d1d 100644 --- a/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md +++ b/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md @@ -10,7 +10,7 @@ An external dictionary can be connected from many different sources. If dictionary is configured using xml-file, the configuration looks like this: ``` xml - + ... @@ -21,7 +21,7 @@ If dictionary is configured using xml-file, the configuration looks like this: ... ... - + ``` In case of [DDL-query](../../../sql-reference/statements/create/dictionary.md), equal configuration will looks like: @@ -311,7 +311,7 @@ Configuring `/etc/odbc.ini` (or `~/.odbc.ini` if you signed in under a user that The dictionary configuration in ClickHouse: ``` xml - + table_name @@ -340,7 +340,7 @@ The dictionary configuration in ClickHouse: - + ``` or @@ -416,7 +416,7 @@ Remarks: Configuring the dictionary in ClickHouse: ``` xml - + test @@ -446,7 +446,7 @@ Configuring the dictionary in ClickHouse: - + ``` or diff --git a/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts.md b/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts.md index d229336c58d..00025c70c60 100644 --- a/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts.md +++ b/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts.md @@ -26,7 +26,7 @@ The [dictionaries](../../../operations/system-tables/dictionaries.md#system_tabl The dictionary configuration file has the following format: ``` xml - + An optional element with any content. Ignored by the ClickHouse server. @@ -38,7 +38,7 @@ The dictionary configuration file has the following format: - + ``` You can [configure](../../../sql-reference/dictionaries/external-dictionaries/external-dicts-dict.md) any number of dictionaries in the same file. diff --git a/docs/en/sql-reference/functions/ext-dict-functions.md b/docs/en/sql-reference/functions/ext-dict-functions.md index 54b72e77f01..0e8352d2d1e 100644 --- a/docs/en/sql-reference/functions/ext-dict-functions.md +++ b/docs/en/sql-reference/functions/ext-dict-functions.md @@ -53,7 +53,7 @@ The first column is `id`, the second column is `c1`. Configure the external dictionary: ``` xml - + ext-dict-test @@ -77,7 +77,7 @@ Configure the external dictionary: 0 - + ``` Perform the query: @@ -113,7 +113,7 @@ The first column is `id`, the second is `c1`, the third is `c2`. Configure the external dictionary: ``` xml - + ext-dict-mult @@ -142,7 +142,7 @@ Configure the external dictionary: 0 - + ``` Perform the query: diff --git a/docs/ja/operations/configuration-files.md b/docs/ja/operations/configuration-files.md index f170ceab907..e22fc96d3b5 100644 --- a/docs/ja/operations/configuration-files.md +++ b/docs/ja/operations/configuration-files.md @@ -10,7 +10,7 @@ toc_title: "\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB" ClickHouseは複数のファイル構成管理をサポートします。 主サーバ設定ファイルで指定することがで `/etc/clickhouse-server/config.xml`. その他のファイルは `/etc/clickhouse-server/config.d` ディレクトリ。 !!! note "注" - すべての構成ファイルはXML形式である必要があります。 また、通常は同じルート要素を持つ必要があります ``. + すべての構成ファイルはXML形式である必要があります。 また、通常は同じルート要素を持つ必要があります ``. メイン構成ファイルで指定された一部の設定は、他の構成ファイルで上書きできます。 その `replace` または `remove` これらの構成ファイルの要素に属性を指定できます。 @@ -36,7 +36,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml ``` ``` xml - + analytics @@ -47,7 +47,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml analytics - + ``` 各設定ファイルでは、サーバともある `file-preprocessed.xml` 起動時のファイル。 これらのファイルには、完了したすべての置換と上書きが含まれており、情報提供を目的としています。 設定ファイルでZooKeeperの置換が使用されていても、サーバーの起動時にZooKeeperが使用できない場合、サーバーは前処理されたファイルから設定をロードします。 diff --git a/docs/ja/operations/system-tables.md b/docs/ja/operations/system-tables.md index 4a18028c084..cdeeed7b584 100644 --- a/docs/ja/operations/system-tables.md +++ b/docs/ja/operations/system-tables.md @@ -335,14 +335,14 @@ SELECT * FROM system.metrics LIMIT 10 メトリック履歴の収集を有効にするには `system.metric_log`,作成 `/etc/clickhouse-server/config.d/metric_log.xml` 次の内容を使って: ``` xml - + system metric_log
7500 1000
-
+ ``` **例** diff --git a/docs/ja/operations/utilities/clickhouse-copier.md b/docs/ja/operations/utilities/clickhouse-copier.md index 4d825f02b76..614984af42b 100644 --- a/docs/ja/operations/utilities/clickhouse-copier.md +++ b/docs/ja/operations/utilities/clickhouse-copier.md @@ -46,7 +46,7 @@ $ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/pat ## 飼育係の形式。xml {#format-of-zookeeper-xml} ``` xml - + trace 100M @@ -59,13 +59,13 @@ $ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/pat 2181 - + ``` ## コピータスクの構成 {#configuration-of-copying-tasks} ``` xml - + @@ -168,7 +168,7 @@ $ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/pat ... - + ``` `clickhouse-copier` の変更を追跡します `/task/path/description` そしてその場でそれらを適用します。 たとえば、次の値を変更すると `max_workers`、タスクを実行しているプロセスの数も変更されます。 diff --git a/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md b/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md index 3286cf04113..4aef036b3bd 100644 --- a/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md +++ b/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md @@ -28,7 +28,7 @@ ClickHouseは、辞書のエラーに対して例外を生成します。 エラ 設定は次のようになります: ``` xml - + ... @@ -38,7 +38,7 @@ ClickHouseは、辞書のエラーに対して例外を生成します。 エラ ... - + ``` 対応する [DDL-クエリ](../../statements/create.md#create-dictionary-query): @@ -208,7 +208,7 @@ dictGetT('dict_name', 'attr_name', id, date) 設定例: ``` xml - + ... @@ -237,7 +237,7 @@ dictGetT('dict_name', 'attr_name', id, date) - + ``` または diff --git a/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md b/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md index 5aefd7050e3..e61218b8d1d 100644 --- a/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md +++ b/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md @@ -12,7 +12,7 @@ toc_title: "\u5916\u90E8\u8F9E\u66F8\u306E\u30BD\u30FC\u30B9" 辞書がxml-fileを使用して構成されている場合、構成は次のようになります: ``` xml - + ... @@ -23,7 +23,7 @@ toc_title: "\u5916\u90E8\u8F9E\u66F8\u306E\u30BD\u30FC\u30B9" ... ... - + ``` の場合 [DDL-クエリ](../../statements/create.md#create-dictionary-query)、等しい構成は次のようになります: @@ -272,7 +272,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql ClickHouseの辞書構成: ``` xml - + table_name @@ -301,7 +301,7 @@ ClickHouseの辞書構成: - + ``` または @@ -367,7 +367,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh ClickHouseでの辞書の構成: ``` xml - + test @@ -397,7 +397,7 @@ ClickHouseでの辞書の構成: - + ``` または diff --git a/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts.md b/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts.md index 4f90ac18267..725b77af7af 100644 --- a/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts.md +++ b/docs/ja/sql-reference/dictionaries/external-dictionaries/external-dicts.md @@ -28,7 +28,7 @@ toc_title: "\u4E00\u822C\u7684\u306A\u8AAC\u660E" 辞書構成ファイルの形式は次のとおりです: ``` xml - + An optional element with any content. Ignored by the ClickHouse server. @@ -40,7 +40,7 @@ toc_title: "\u4E00\u822C\u7684\u306A\u8AAC\u660E" - + ``` あなたはできる [設定](external-dicts-dict.md) 同じファイル内の任意の数の辞書。 diff --git a/docs/ja/sql-reference/functions/ext-dict-functions.md b/docs/ja/sql-reference/functions/ext-dict-functions.md index 6a90d99a5f0..0d21322eda3 100644 --- a/docs/ja/sql-reference/functions/ext-dict-functions.md +++ b/docs/ja/sql-reference/functions/ext-dict-functions.md @@ -50,7 +50,7 @@ ClickHouseは、属性の値を解析できない場合、または値が属性 外部辞書の構成: ``` xml - + ext-dict-test @@ -74,7 +74,7 @@ ClickHouseは、属性の値を解析できない場合、または値が属性 0 - + ``` クエリの実行: diff --git a/docs/ru/operations/configuration-files.md b/docs/ru/operations/configuration-files.md index 343fffdfaa5..5abb1ece455 100644 --- a/docs/ru/operations/configuration-files.md +++ b/docs/ru/operations/configuration-files.md @@ -8,7 +8,7 @@ toc_title: "Конфигурационные файлы" ClickHouse поддерживает многофайловое управление конфигурацией. Основной конфигурационный файл сервера — `/etc/clickhouse-server/config.xml` или `/etc/clickhouse-server/config.yaml`. Остальные файлы должны находиться в директории `/etc/clickhouse-server/config.d`. Обратите внимание, что конфигурационные файлы могут быть записаны в форматах XML или YAML, но смешение этих форматов в одном файле не поддерживается. Например, можно хранить основные конфигурационные файлы как `config.xml` и `users.xml`, а дополнительные файлы записать в директории `config.d` и `users.d` в формате `.yaml`. -Все XML файлы должны иметь одинаковый корневой элемент, обычно ``. Для YAML элемент `yandex:` должен отсутствовать, так как парсер вставляет его автоматически. +Все XML файлы должны иметь одинаковый корневой элемент, обычно ``. Для YAML элемент `yandex:` должен отсутствовать, так как парсер вставляет его автоматически. ## Переопределение {#override} @@ -22,13 +22,13 @@ ClickHouse поддерживает многофайловое управлен Также возможно указать атрибуты как переменные среды с помощью `from_env="VARIABLE_NAME"`: ```xml - + - + ``` ## Подстановки {#substitution} @@ -40,7 +40,7 @@ ClickHouse поддерживает многофайловое управлен Пример подстановки XML: ```xml - + @@ -49,7 +49,7 @@ ClickHouse поддерживает многофайловое управлен - + ``` Подстановки могут также выполняться из ZooKeeper. Для этого укажите у элемента атрибут `from_zk = "/path/to/node"`. Значение элемента заменится на содержимое узла `/path/to/node` в ZooKeeper. В ZooKeeper-узел также можно положить целое XML-поддерево, оно будет целиком вставлено в исходный элемент. @@ -66,7 +66,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml ``` ``` xml - + analytics @@ -77,7 +77,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml analytics - + ``` Для каждого конфигурационного файла, сервер при запуске генерирует также файлы `file-preprocessed.xml`. Эти файлы содержат все выполненные подстановки и переопределения, и предназначены для информационных целей. Если в конфигурационных файлах были использованы ZooKeeper-подстановки, но при старте сервера ZooKeeper недоступен, то сервер загрузит конфигурацию из preprocessed-файла. diff --git a/docs/ru/operations/external-authenticators/kerberos.md b/docs/ru/operations/external-authenticators/kerberos.md index 2d31e355bba..eeff1cb6011 100644 --- a/docs/ru/operations/external-authenticators/kerberos.md +++ b/docs/ru/operations/external-authenticators/kerberos.md @@ -24,32 +24,32 @@ ClickHouse предоставляет возможность аутентифи Примеры, как должен выглядеть файл `config.xml`: ```xml - + - + ``` Или, с указанием принципала: ```xml - + HTTP/clickhouse.example.com@EXAMPLE.COM - + ``` Или, с фильтрацией по реалм: ```xml - + EXAMPLE.COM - + ``` !!! Warning "Важно" @@ -81,7 +81,7 @@ ClickHouse предоставляет возможность аутентифи Пример, как выглядит конфигурация Kerberos в `users.xml`: ```xml - + @@ -92,7 +92,7 @@ ClickHouse предоставляет возможность аутентифи - + ``` diff --git a/docs/ru/operations/external-authenticators/ldap.md b/docs/ru/operations/external-authenticators/ldap.md index 7b4bab0290c..3a8f2c05ae8 100644 --- a/docs/ru/operations/external-authenticators/ldap.md +++ b/docs/ru/operations/external-authenticators/ldap.md @@ -14,7 +14,7 @@ **Пример** ```xml - + @@ -45,7 +45,7 @@ no - + ``` Обратите внимание, что можно определить несколько LDAP серверов внутри секции `ldap_servers`, используя различные имена. @@ -90,7 +90,7 @@ **Пример** ```xml - + @@ -101,7 +101,7 @@ - + ``` Обратите внимание, что пользователь `my_user` ссылается на `my_ldap_server`. Этот LDAP сервер должен быть настроен в основном файле `config.xml`, как это было описано ранее. @@ -125,7 +125,7 @@ CREATE USER my_user IDENTIFIED WITH ldap SERVER 'my_ldap_server'; В `config.xml`. ```xml - + @@ -156,7 +156,7 @@ CREATE USER my_user IDENTIFIED WITH ldap SERVER 'my_ldap_server'; - + ``` Обратите внимание, что `my_ldap_server`, указанный в секции `ldap` внутри секции `user_directories`, должен быть настроен в файле `config.xml`, как это было описано ранее. (см. [Определение LDAP сервера](#ldap-server-definition)). diff --git a/docs/ru/operations/server-configuration-parameters/settings.md b/docs/ru/operations/server-configuration-parameters/settings.md index 2d4ca1d3dcd..0b62ecf6680 100644 --- a/docs/ru/operations/server-configuration-parameters/settings.md +++ b/docs/ru/operations/server-configuration-parameters/settings.md @@ -754,14 +754,14 @@ ClickHouse проверяет условия для `min_part_size` и `min_part Чтобы вручную включить сбор истории метрик в таблице [`system.metric_log`](../../operations/system-tables/metric_log.md), создайте `/etc/clickhouse-server/config.d/metric_log.xml` следующего содержания: ``` xml - + system metric_log
7500 1000
-
+ ``` **Выключение** @@ -769,9 +769,9 @@ ClickHouse проверяет условия для `min_part_size` и `min_part Чтобы отключить настройку `metric_log` , создайте файл `/etc/clickhouse-server/config.d/disable_metric_log.xml` следующего содержания: ``` xml - + - + ``` ## replicated\_merge\_tree {#server_configuration_parameters-replicated_merge_tree} @@ -1007,7 +1007,7 @@ ClickHouse проверяет условия для `min_part_size` и `min_part **Пример** ```xml - + notice system @@ -1016,7 +1016,7 @@ ClickHouse проверяет условия для `min_part_size` и `min_part Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day - + ``` diff --git a/docs/ru/operations/storing-data.md b/docs/ru/operations/storing-data.md index ca9b60bded8..a544c7202e1 100644 --- a/docs/ru/operations/storing-data.md +++ b/docs/ru/operations/storing-data.md @@ -19,7 +19,7 @@ toc_title: "Хранение данных на внешних дисках" Пример конфигурации: ``` xml - + @@ -41,7 +41,7 @@ toc_title: "Хранение данных на внешних дисках" 0 - + ``` Обязательные параметры: @@ -93,7 +93,7 @@ toc_title: "Хранение данных на внешних дисках" Пример конфигурации: ``` xml - + @@ -110,7 +110,7 @@ toc_title: "Хранение данных на внешних дисках" - + ``` ## Хранение данных на веб-сервере {#storing-data-on-webserver} @@ -124,7 +124,7 @@ toc_title: "Хранение данных на внешних дисках" Готовый тестовый пример. Добавьте эту конфигурацию в config: ``` xml - + @@ -142,7 +142,7 @@ toc_title: "Хранение данных на внешних дисках" - + ``` А затем выполните этот запрос: diff --git a/docs/ru/operations/system-tables/index.md b/docs/ru/operations/system-tables/index.md index 73b839ddc1f..c560c1b7f49 100644 --- a/docs/ru/operations/system-tables/index.md +++ b/docs/ru/operations/system-tables/index.md @@ -34,7 +34,7 @@ toc_title: "Системные таблицы" Пример: ```xml - + system query_log
@@ -45,7 +45,7 @@ toc_title: "Системные таблицы" --> 7500
-
+ ``` По умолчанию размер таблицы не ограничен. Управлять размером таблицы можно используя [TTL](../../sql-reference/statements/alter/ttl.md#manipuliatsii-s-ttl-tablitsy) для удаления устаревших записей журнала. Также вы можете использовать функцию партиционирования для таблиц `MergeTree`. diff --git a/docs/ru/operations/utilities/clickhouse-copier.md b/docs/ru/operations/utilities/clickhouse-copier.md index 7e1364f9ee1..07467c3e5da 100644 --- a/docs/ru/operations/utilities/clickhouse-copier.md +++ b/docs/ru/operations/utilities/clickhouse-copier.md @@ -44,7 +44,7 @@ $ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --bas ## Формат Zookeeper.xml {#format-zookeeper-xml} ``` xml - + trace 100M @@ -57,13 +57,13 @@ $ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --bas 2181 - + ``` ## Конфигурация заданий на копирование {#konfiguratsiia-zadanii-na-kopirovanie} ``` xml - + @@ -176,7 +176,7 @@ $ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --bas ... - + ``` `clickhouse-copier` отслеживает изменения `/task/path/description` и применяет их «на лету». Если вы поменяете, например, значение `max_workers`, то количество процессов, выполняющих задания, также изменится. diff --git a/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md b/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md index 647e2c5f5a7..edc8b9bbc11 100644 --- a/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md +++ b/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md @@ -26,7 +26,7 @@ toc_title: "Хранение словарей в памяти" Общий вид конфигурации: ``` xml - + ... @@ -36,7 +36,7 @@ toc_title: "Хранение словарей в памяти" ... - + ``` Соответствущий [DDL-запрос](../../statements/create/dictionary.md#create-dictionary-query): @@ -284,7 +284,7 @@ RANGE(MIN first MAX last) Пример конфигурации: ``` xml - + ... @@ -313,7 +313,7 @@ RANGE(MIN first MAX last) - + ``` или diff --git a/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md b/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md index 828d69cf26b..0486f4931b0 100644 --- a/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md +++ b/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md @@ -10,7 +10,7 @@ toc_title: "Источники внешних словарей" Общий вид XML-конфигурации: ``` xml - + ... @@ -21,7 +21,7 @@ toc_title: "Источники внешних словарей" ... ... - + ``` Аналогичный [DDL-запрос](../../statements/create/dictionary.md#create-dictionary-query): @@ -311,7 +311,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql Конфигурация словаря в ClickHouse: ``` xml - + table_name @@ -340,7 +340,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql - + ``` или @@ -416,7 +416,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh Настройка словаря в ClickHouse: ``` xml - + test @@ -446,7 +446,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh - + ``` или diff --git a/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts.md b/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts.md index 04ef24b68c5..55324071efe 100644 --- a/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts.md +++ b/docs/ru/sql-reference/dictionaries/external-dictionaries/external-dicts.md @@ -26,7 +26,7 @@ ClickHouse: Конфигурационный файл словарей имеет вид: ``` xml - + Необязательный элемент с любым содержимым. Игнорируется сервером ClickHouse. @@ -42,7 +42,7 @@ ClickHouse: - + ``` В одном файле можно [сконфигурировать](external-dicts-dict.md) произвольное количество словарей. diff --git a/docs/ru/sql-reference/functions/ext-dict-functions.md b/docs/ru/sql-reference/functions/ext-dict-functions.md index 0e234f1d84e..ae62d98dd63 100644 --- a/docs/ru/sql-reference/functions/ext-dict-functions.md +++ b/docs/ru/sql-reference/functions/ext-dict-functions.md @@ -53,7 +53,7 @@ dictGetOrNull('dict_name', attr_name, id_expr) Настройка внешнего словаря: ``` xml - + ext-dict-test @@ -77,7 +77,7 @@ dictGetOrNull('dict_name', attr_name, id_expr) 0 - + ``` Выполним запрос: @@ -113,7 +113,7 @@ LIMIT 3; Настройка внешнего словаря: ``` xml - + ext-dict-mult @@ -142,7 +142,7 @@ LIMIT 3; 0 - + ``` Выполним запрос: diff --git a/docs/zh/operations/configuration-files.md b/docs/zh/operations/configuration-files.md index da76a3588e3..7998baafb6c 100644 --- a/docs/zh/operations/configuration-files.md +++ b/docs/zh/operations/configuration-files.md @@ -3,7 +3,7 @@ ClickHouse支持多配置文件管理。主配置文件是`/etc/clickhouse-server/config.xml`。其余文件须在目录`/etc/clickhouse-server/config.d`。 !!! 注意: - 所有配置文件必须是XML格式。此外,配置文件须有相同的跟元素,通常是``。 + 所有配置文件必须是XML格式。此外,配置文件须有相同的跟元素,通常是``。 主配置文件中的一些配置可以通过`replace`或`remove`属性被配置文件覆盖。 @@ -26,7 +26,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml ``` ``` xml - + analytics @@ -37,7 +37,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml analytics - + ``` 对于每个配置文件,服务器还会在启动时生成 `file-preprocessed.xml` 文件。这些文件包含所有已完成的替换和复盖,并且它们旨在提供信息。如果zookeeper替换在配置文件中使用,但ZooKeeper在服务器启动时不可用,则服务器将从预处理的文件中加载配置。 diff --git a/docs/zh/operations/system-tables/index.md b/docs/zh/operations/system-tables/index.md index 21e0bccc693..eb7d45f9388 100644 --- a/docs/zh/operations/system-tables/index.md +++ b/docs/zh/operations/system-tables/index.md @@ -36,7 +36,7 @@ toc_title: "\u7CFB\u7EDF\u8868" 配置定义的示例如下: ``` - + system query_log
@@ -47,7 +47,7 @@ toc_title: "\u7CFB\u7EDF\u8868" --> 7500
-
+ ``` 默认情况下,表增长是无限的。可以通过TTL 删除过期日志记录的设置来控制表的大小。 你也可以使用分区功能 `MergeTree`-引擎表。 diff --git a/docs/zh/operations/system-tables/metric_log.md b/docs/zh/operations/system-tables/metric_log.md index aaf04d74b0d..5eb038feea7 100644 --- a/docs/zh/operations/system-tables/metric_log.md +++ b/docs/zh/operations/system-tables/metric_log.md @@ -9,14 +9,14 @@ machine_translated_rev: 5decc73b5dc60054f19087d3690c4eb99446a6c3 打开指标历史记录收集 `system.metric_log`,创建 `/etc/clickhouse-server/config.d/metric_log.xml` 具有以下内容: ``` xml - + system metric_log
7500 1000
-
+ ``` **示例** diff --git a/docs/zh/operations/utilities/clickhouse-copier.md b/docs/zh/operations/utilities/clickhouse-copier.md index b68390fce04..537006ecf0d 100644 --- a/docs/zh/operations/utilities/clickhouse-copier.md +++ b/docs/zh/operations/utilities/clickhouse-copier.md @@ -41,7 +41,7 @@ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --base- ## Zookeeper.xml格式 {#format-of-zookeeper-xml} ``` xml - + trace 100M @@ -54,13 +54,13 @@ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --base- 2181 - + ``` ## 复制任务的配置 {#configuration-of-copying-tasks} ``` xml - + @@ -163,7 +163,7 @@ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --base- ... - + ``` `clickhouse-copier` 跟踪更改 `/task/path/description` 并在飞行中应用它们。 例如,如果你改变的值 `max_workers`,运行任务的进程数也会发生变化。 diff --git a/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md b/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md index 78d4c1ea236..083ed0318ba 100644 --- a/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md +++ b/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-layout.md @@ -28,7 +28,7 @@ ClickHouse为字典中的错误生成异常。 错误示例: 配置如下所示: ``` xml - + ... @@ -38,7 +38,7 @@ ClickHouse为字典中的错误生成异常。 错误示例: ... - + ``` 相应的 [DDL-查询](../../statements/create.md#create-dictionary-query): @@ -208,7 +208,7 @@ dictGetT('dict_name', 'attr_name', id, date) 配置示例: ``` xml - + ... @@ -237,7 +237,7 @@ dictGetT('dict_name', 'attr_name', id, date) - + ``` 或 diff --git a/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md b/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md index 399224cb8c4..c0a31535b08 100644 --- a/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md +++ b/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md @@ -12,7 +12,7 @@ toc_title: "\u5916\u90E8\u5B57\u5178\u7684\u6765\u6E90" 如果使用xml-file配置字典,则配置如下所示: ``` xml - + ... @@ -23,7 +23,7 @@ toc_title: "\u5916\u90E8\u5B57\u5178\u7684\u6765\u6E90" ... ... - + ``` 在情况下 [DDL-查询](../../statements/create.md#create-dictionary-query),相等的配置将看起来像: @@ -272,7 +272,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql ClickHouse中的字典配置: ``` xml - + table_name @@ -301,7 +301,7 @@ ClickHouse中的字典配置: - + ``` 或 @@ -367,7 +367,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh 在ClickHouse中配置字典: ``` xml - + test @@ -397,7 +397,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh - + ``` 或 diff --git a/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts.md b/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts.md index 609d1c11f56..036ba3d707f 100644 --- a/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts.md +++ b/docs/zh/sql-reference/dictionaries/external-dictionaries/external-dicts.md @@ -28,7 +28,7 @@ ClickHouse: 字典配置文件具有以下格式: ``` xml - + An optional element with any content. Ignored by the ClickHouse server. @@ -40,7 +40,7 @@ ClickHouse: - + ``` 你可以 [配置](external-dicts-dict.md) 同一文件中的任意数量的字典。 From 573994a4ed15060e729211ab48439436372bc316 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Oct 2021 08:51:22 +0300 Subject: [PATCH 03/10] clickhouse-install: switch to --- programs/install/Install.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/programs/install/Install.cpp b/programs/install/Install.cpp index 606af7ecd0d..f423ae4ac3e 100644 --- a/programs/install/Install.cpp +++ b/programs/install/Install.cpp @@ -495,12 +495,12 @@ int mainEntryClickHouseInstall(int argc, char ** argv) { std::string data_file = config_d / "data-paths.xml"; WriteBufferFromFile out(data_file); - out << "\n" + out << "\n" " " << data_path.string() << "\n" " " << (data_path / "tmp").string() << "\n" " " << (data_path / "user_files").string() << "\n" " " << (data_path / "format_schemas").string() << "\n" - "\n"; + "\n"; out.sync(); out.finalize(); fmt::print("Data path configuration override is saved to file {}.\n", data_file); @@ -510,12 +510,12 @@ int mainEntryClickHouseInstall(int argc, char ** argv) { std::string logger_file = config_d / "logger.xml"; WriteBufferFromFile out(logger_file); - out << "\n" + out << "\n" " \n" " " << (log_path / "clickhouse-server.log").string() << "\n" " " << (log_path / "clickhouse-server.err.log").string() << "\n" " \n" - "\n"; + "\n"; out.sync(); out.finalize(); fmt::print("Log path configuration override is saved to file {}.\n", logger_file); @@ -525,13 +525,13 @@ int mainEntryClickHouseInstall(int argc, char ** argv) { std::string user_directories_file = config_d / "user-directories.xml"; WriteBufferFromFile out(user_directories_file); - out << "\n" + out << "\n" " \n" " \n" " " << (data_path / "access").string() << "\n" " \n" " \n" - "\n"; + "\n"; out.sync(); out.finalize(); fmt::print("User directory path configuration override is saved to file {}.\n", user_directories_file); @@ -541,7 +541,7 @@ int mainEntryClickHouseInstall(int argc, char ** argv) { std::string openssl_file = config_d / "openssl.xml"; WriteBufferFromFile out(openssl_file); - out << "\n" + out << "\n" " \n" " \n" " " << (config_dir / "server.crt").string() << "\n" @@ -549,7 +549,7 @@ int mainEntryClickHouseInstall(int argc, char ** argv) " " << (config_dir / "dhparam.pem").string() << "\n" " \n" " \n" - "\n"; + "\n"; out.sync(); out.finalize(); fmt::print("OpenSSL path configuration override is saved to file {}.\n", openssl_file); @@ -716,25 +716,25 @@ int mainEntryClickHouseInstall(int argc, char ** argv) hash_hex.resize(64); for (size_t i = 0; i < 32; ++i) writeHexByteLowercase(hash[i], &hash_hex[2 * i]); - out << "\n" + out << "\n" " \n" " \n" " \n" " " << hash_hex << "\n" " \n" " \n" - "\n"; + "\n"; out.sync(); out.finalize(); fmt::print(HILITE "Password for default user is saved in file {}." END_HILITE "\n", password_file); #else - out << "\n" + out << "\n" " \n" " \n" " \n" " \n" " \n" - "\n"; + "\n"; out.sync(); out.finalize(); fmt::print(HILITE "Password for default user is saved in plaintext in file {}." END_HILITE "\n", password_file); @@ -777,9 +777,9 @@ int mainEntryClickHouseInstall(int argc, char ** argv) { std::string listen_file = config_d / "listen.xml"; WriteBufferFromFile out(listen_file); - out << "\n" + out << "\n" " ::\n" - "\n"; + "\n"; out.sync(); out.finalize(); fmt::print("The choice is saved in file {}.\n", listen_file); From e60c1f1061266ca5ecc98ee5d34578c092bcdc1b Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Oct 2021 08:51:37 +0300 Subject: [PATCH 04/10] programs: switch left configs from to --- programs/server/config.d/listen.xml.disabled | 4 ++-- programs/server/config.d/tls.xml.disabled | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/programs/server/config.d/listen.xml.disabled b/programs/server/config.d/listen.xml.disabled index de8c737ff75..f94e5c88568 100644 --- a/programs/server/config.d/listen.xml.disabled +++ b/programs/server/config.d/listen.xml.disabled @@ -1,3 +1,3 @@ - + :: - + diff --git a/programs/server/config.d/tls.xml.disabled b/programs/server/config.d/tls.xml.disabled index c81f005f2ed..b88b4b07231 100644 --- a/programs/server/config.d/tls.xml.disabled +++ b/programs/server/config.d/tls.xml.disabled @@ -1,4 +1,4 @@ - + 8443 9440 @@ -6,4 +6,4 @@ - + From 3a6f876abc30b254b7608d78682b92b024aa1275 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Oct 2021 08:52:46 +0300 Subject: [PATCH 05/10] gtest_getMultipleValuesFromConfig: switch to --- src/Common/tests/gtest_getMultipleValuesFromConfig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Common/tests/gtest_getMultipleValuesFromConfig.cpp b/src/Common/tests/gtest_getMultipleValuesFromConfig.cpp index 30aba9418ba..e813cf4c75c 100644 --- a/src/Common/tests/gtest_getMultipleValuesFromConfig.cpp +++ b/src/Common/tests/gtest_getMultipleValuesFromConfig.cpp @@ -11,14 +11,14 @@ TEST(Common, getMultipleValuesFromConfig) { std::istringstream // STYLE_CHECK_ALLOW_STD_STRING_STREAM xml_isteam(R"END( - + 0 1 2 3 -)END"); +)END"); Poco::AutoPtr config = new Poco::Util::XMLConfiguration(xml_isteam); std::vector answer = getMultipleValuesFromConfig(*config, "first_level", "second_level"); From da90df565826af4e48f247583d41eab375f7153a Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Mon, 25 Oct 2021 21:15:42 +0300 Subject: [PATCH 06/10] docker: switch to --- docker/server/entrypoint.sh | 4 ++-- docker/test/stress/run.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/server/entrypoint.sh b/docker/server/entrypoint.sh index 4dd54074d55..103f2fdb47f 100755 --- a/docker/server/entrypoint.sh +++ b/docker/server/entrypoint.sh @@ -86,7 +86,7 @@ done if [ -n "$CLICKHOUSE_USER" ] && [ "$CLICKHOUSE_USER" != "default" ] || [ -n "$CLICKHOUSE_PASSWORD" ]; then echo "$0: create new user '$CLICKHOUSE_USER' instead 'default'" cat < /etc/clickhouse-server/users.d/default-user.xml - + @@ -103,7 +103,7 @@ if [ -n "$CLICKHOUSE_USER" ] && [ "$CLICKHOUSE_USER" != "default" ] || [ -n "$CL ${CLICKHOUSE_ACCESS_MANAGEMENT} - + EOT fi diff --git a/docker/test/stress/run.sh b/docker/test/stress/run.sh index f42a3af17c9..a4e2f797210 100755 --- a/docker/test/stress/run.sh +++ b/docker/test/stress/run.sh @@ -46,11 +46,11 @@ function configure() sudo chown root: /var/lib/clickhouse # Set more frequent update period of asynchronous metrics to more frequently update information about real memory usage (less chance of OOM). - echo "1" \ + echo "1" \ > /etc/clickhouse-server/config.d/asynchronous_metrics_update_period_s.xml # Set maximum memory usage as half of total memory (less chance of OOM). - echo "0.5" \ + echo "0.5" \ > /etc/clickhouse-server/config.d/max_server_memory_usage_to_ram_ratio.xml } From 81436089dc7685677391fd83da5e8c60e646ca7c Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Oct 2021 08:53:23 +0300 Subject: [PATCH 07/10] tests: switch to --- tests/config/users.d/memory_profiler.xml | 4 ++-- tests/integration/helpers/0_common_enable_dictionaries.xml | 4 ++-- tests/integration/helpers/0_common_instance_config.xml | 4 ++-- tests/integration/helpers/0_common_instance_users.xml | 4 ++-- tests/integration/helpers/zookeeper_config.xml | 4 ++-- tests/integration/test_backup_with_other_granularity/test.py | 2 +- .../test_config_substitutions/configs/include_from_source.xml | 4 ++-- .../configs/default_compression.xml | 4 ++-- .../configs/wide_parts_only.xml | 4 ++-- .../config/dictionaries_config.xml | 4 ++-- tests/integration/test_dictionaries_config_reload/test.py | 4 ++-- .../configs/remote_servers.xml | 4 ++-- .../config/executable_user_defined_functions_config.xml | 4 ++-- .../test.py | 4 ++-- tests/integration/test_log_levels_update/configs/log.xml | 4 ++-- tests/integration/test_log_levels_update/test.py | 4 ++-- .../test_old_versions/configs/config.d/test_cluster.xml | 4 ++-- .../configs_old/users.d/not_optimize_count.xml | 4 ++-- .../configs/test_cluster.xml | 4 ++-- tests/integration/test_storage_rabbitmq/configs/macros.xml | 4 ++-- 20 files changed, 39 insertions(+), 39 deletions(-) diff --git a/tests/config/users.d/memory_profiler.xml b/tests/config/users.d/memory_profiler.xml index 56e9ba28347..a165ac701b0 100644 --- a/tests/config/users.d/memory_profiler.xml +++ b/tests/config/users.d/memory_profiler.xml @@ -1,8 +1,8 @@ - + 1Mi 1Mi - + diff --git a/tests/integration/helpers/0_common_enable_dictionaries.xml b/tests/integration/helpers/0_common_enable_dictionaries.xml index b6e52983db2..c7a763eb942 100644 --- a/tests/integration/helpers/0_common_enable_dictionaries.xml +++ b/tests/integration/helpers/0_common_enable_dictionaries.xml @@ -1,4 +1,4 @@ - + /etc/clickhouse-server/dictionaries/*.xml - + diff --git a/tests/integration/helpers/0_common_instance_config.xml b/tests/integration/helpers/0_common_instance_config.xml index c848ebdf45c..f4a9a0b6296 100644 --- a/tests/integration/helpers/0_common_instance_config.xml +++ b/tests/integration/helpers/0_common_instance_config.xml @@ -1,4 +1,4 @@ - + Europe/Moscow 0.0.0.0 custom_ @@ -17,4 +17,4 @@ /var/log/clickhouse-server/stderr.log /var/log/clickhouse-server/stdout.log - + diff --git a/tests/integration/helpers/0_common_instance_users.xml b/tests/integration/helpers/0_common_instance_users.xml index 7e799cb7b10..3399ef5915a 100644 --- a/tests/integration/helpers/0_common_instance_users.xml +++ b/tests/integration/helpers/0_common_instance_users.xml @@ -1,7 +1,7 @@ - + 1 - + diff --git a/tests/integration/helpers/zookeeper_config.xml b/tests/integration/helpers/zookeeper_config.xml index 9f864fef276..7a0d7c1de92 100644 --- a/tests/integration/helpers/zookeeper_config.xml +++ b/tests/integration/helpers/zookeeper_config.xml @@ -1,4 +1,4 @@ - + zoo1 @@ -14,4 +14,4 @@ 3000 - + diff --git a/tests/integration/test_backup_with_other_granularity/test.py b/tests/integration/test_backup_with_other_granularity/test.py index 832c1cf35ce..0f35c0f849e 100644 --- a/tests/integration/test_backup_with_other_granularity/test.py +++ b/tests/integration/test_backup_with_other_granularity/test.py @@ -111,7 +111,7 @@ def test_backup_from_old_version_config(started_cluster): def callback(n): n.replace_config("/etc/clickhouse-server/merge_tree_settings.xml", - "1") + "1") node3.restart_with_latest_version(callback_onstop=callback) diff --git a/tests/integration/test_config_substitutions/configs/include_from_source.xml b/tests/integration/test_config_substitutions/configs/include_from_source.xml index 6095180bb59..88a8b9d6e3d 100644 --- a/tests/integration/test_config_substitutions/configs/include_from_source.xml +++ b/tests/integration/test_config_substitutions/configs/include_from_source.xml @@ -1,4 +1,4 @@ - + 99999 @@ -14,4 +14,4 @@ default - + diff --git a/tests/integration/test_default_compression_codec/configs/default_compression.xml b/tests/integration/test_default_compression_codec/configs/default_compression.xml index abb2108f780..c0af422a4e6 100644 --- a/tests/integration/test_default_compression_codec/configs/default_compression.xml +++ b/tests/integration/test_default_compression_codec/configs/default_compression.xml @@ -1,4 +1,4 @@ - + @@ -26,4 +26,4 @@ - + diff --git a/tests/integration/test_default_compression_codec/configs/wide_parts_only.xml b/tests/integration/test_default_compression_codec/configs/wide_parts_only.xml index 42e2173f718..10b9edef36d 100644 --- a/tests/integration/test_default_compression_codec/configs/wide_parts_only.xml +++ b/tests/integration/test_default_compression_codec/configs/wide_parts_only.xml @@ -1,6 +1,6 @@ - + 0 0 - + diff --git a/tests/integration/test_dictionaries_config_reload/config/dictionaries_config.xml b/tests/integration/test_dictionaries_config_reload/config/dictionaries_config.xml index 7e62283a83c..3cbf717bb67 100644 --- a/tests/integration/test_dictionaries_config_reload/config/dictionaries_config.xml +++ b/tests/integration/test_dictionaries_config_reload/config/dictionaries_config.xml @@ -1,2 +1,2 @@ - - + + diff --git a/tests/integration/test_dictionaries_config_reload/test.py b/tests/integration/test_dictionaries_config_reload/test.py index 6f6e2488abc..4f338767304 100644 --- a/tests/integration/test_dictionaries_config_reload/test.py +++ b/tests/integration/test_dictionaries_config_reload/test.py @@ -17,9 +17,9 @@ def copy_file_to_container(local_path, dist_path, container_id): os.system("docker cp {local} {cont_id}:{dist}".format(local=local_path, cont_id=container_id, dist=dist_path)) -config = ''' +config = ''' /etc/clickhouse-server/dictionaries/{dictionaries_config} -''' +''' @pytest.fixture(scope="module") diff --git a/tests/integration/test_distributed_backward_compatability/configs/remote_servers.xml b/tests/integration/test_distributed_backward_compatability/configs/remote_servers.xml index ebce4697529..68b420f36b4 100644 --- a/tests/integration/test_distributed_backward_compatability/configs/remote_servers.xml +++ b/tests/integration/test_distributed_backward_compatability/configs/remote_servers.xml @@ -1,4 +1,4 @@ - + @@ -15,4 +15,4 @@ - + diff --git a/tests/integration/test_executable_user_defined_functions_config_reload/config/executable_user_defined_functions_config.xml b/tests/integration/test_executable_user_defined_functions_config_reload/config/executable_user_defined_functions_config.xml index 7e62283a83c..3cbf717bb67 100644 --- a/tests/integration/test_executable_user_defined_functions_config_reload/config/executable_user_defined_functions_config.xml +++ b/tests/integration/test_executable_user_defined_functions_config_reload/config/executable_user_defined_functions_config.xml @@ -1,2 +1,2 @@ - - + + diff --git a/tests/integration/test_executable_user_defined_functions_config_reload/test.py b/tests/integration/test_executable_user_defined_functions_config_reload/test.py index e5c4f4edb4e..3117b3e72b1 100644 --- a/tests/integration/test_executable_user_defined_functions_config_reload/test.py +++ b/tests/integration/test_executable_user_defined_functions_config_reload/test.py @@ -17,9 +17,9 @@ def copy_file_to_container(local_path, dist_path, container_id): os.system("docker cp {local} {cont_id}:{dist}".format(local=local_path, cont_id=container_id, dist=dist_path)) -config = ''' +config = ''' /etc/clickhouse-server/functions/{user_defined_executable_functions_config} -''' +''' @pytest.fixture(scope="module") diff --git a/tests/integration/test_log_levels_update/configs/log.xml b/tests/integration/test_log_levels_update/configs/log.xml index 668a15f6afd..a85417d05b8 100644 --- a/tests/integration/test_log_levels_update/configs/log.xml +++ b/tests/integration/test_log_levels_update/configs/log.xml @@ -1,6 +1,6 @@ - + trace /var/log/clickhouse-server/clickhouse-server.log - \ No newline at end of file + \ No newline at end of file diff --git a/tests/integration/test_log_levels_update/test.py b/tests/integration/test_log_levels_update/test.py index dca660a2982..f631677a400 100644 --- a/tests/integration/test_log_levels_update/test.py +++ b/tests/integration/test_log_levels_update/test.py @@ -6,12 +6,12 @@ from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__, name="log_quries_probability") node = cluster.add_instance('node', with_zookeeper=False) -config = ''' +config = ''' information /var/log/clickhouse-server/clickhouse-server.log -''' +''' @pytest.fixture(scope="module") diff --git a/tests/integration/test_old_versions/configs/config.d/test_cluster.xml b/tests/integration/test_old_versions/configs/config.d/test_cluster.xml index 56d53d63d78..f97538b35e3 100644 --- a/tests/integration/test_old_versions/configs/config.d/test_cluster.xml +++ b/tests/integration/test_old_versions/configs/config.d/test_cluster.xml @@ -1,4 +1,4 @@ - + @@ -10,4 +10,4 @@ - + diff --git a/tests/integration/test_polymorphic_parts/configs_old/users.d/not_optimize_count.xml b/tests/integration/test_polymorphic_parts/configs_old/users.d/not_optimize_count.xml index 5a06453b214..7f8036c4f87 100644 --- a/tests/integration/test_polymorphic_parts/configs_old/users.d/not_optimize_count.xml +++ b/tests/integration/test_polymorphic_parts/configs_old/users.d/not_optimize_count.xml @@ -1,7 +1,7 @@ - + 0 - + diff --git a/tests/integration/test_sharding_key_from_default_column/configs/test_cluster.xml b/tests/integration/test_sharding_key_from_default_column/configs/test_cluster.xml index 0437e047fad..a378e397011 100644 --- a/tests/integration/test_sharding_key_from_default_column/configs/test_cluster.xml +++ b/tests/integration/test_sharding_key_from_default_column/configs/test_cluster.xml @@ -1,4 +1,4 @@ - + @@ -15,4 +15,4 @@ - + diff --git a/tests/integration/test_storage_rabbitmq/configs/macros.xml b/tests/integration/test_storage_rabbitmq/configs/macros.xml index 6e9f3390b39..8f27ff51ed1 100644 --- a/tests/integration/test_storage_rabbitmq/configs/macros.xml +++ b/tests/integration/test_storage_rabbitmq/configs/macros.xml @@ -1,8 +1,8 @@ - + rabbitmq1 5672 macro JSONEachRow - + From e3b8557dd643471141bedb8672e2210df26e917c Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 26 Oct 2021 08:58:50 +0300 Subject: [PATCH 08/10] tests/integration/cluster: switch to --- tests/integration/helpers/cluster.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/integration/helpers/cluster.py b/tests/integration/helpers/cluster.py index 3854cadaba5..1bf2ce8c4c5 100644 --- a/tests/integration/helpers/cluster.py +++ b/tests/integration/helpers/cluster.py @@ -760,7 +760,7 @@ class ClickHouseCluster: hostname=None, env_variables=None, image="clickhouse/integration-test", tag=None, stay_alive=False, ipv4_address=None, ipv6_address=None, with_installed_binary=False, tmpfs=None, zookeeper_docker_compose_path=None, minio_certs_dir=None, use_keeper=True, - main_config_name="config.xml", users_config_name="users.xml", copy_common_configs=True, config_root_name="yandex"): + main_config_name="config.xml", users_config_name="users.xml", copy_common_configs=True, config_root_name="clickhouse"): """Add an instance to the cluster. @@ -1827,7 +1827,7 @@ class ClickHouseInstance: main_config_name="config.xml", users_config_name="users.xml", copy_common_configs=True, hostname=None, env_variables=None, image="clickhouse/integration-test", tag="latest", - stay_alive=False, ipv4_address=None, ipv6_address=None, with_installed_binary=False, tmpfs=None, config_root_name="yandex"): + stay_alive=False, ipv4_address=None, ipv6_address=None, with_installed_binary=False, tmpfs=None, config_root_name="clickhouse"): self.name = name self.base_cmd = cluster.base_cmd @@ -2341,11 +2341,6 @@ class ClickHouseInstance: shutil.copyfile(p.join(self.base_config_dir, self.main_config_name), p.join(instance_config_dir, self.main_config_name)) shutil.copyfile(p.join(self.base_config_dir, self.users_config_name), p.join(instance_config_dir, self.users_config_name)) - # For old images, keep 'yandex' as root element name. - if self.image.startswith('yandex/'): - os.system("sed -i 's!!!; s!!!;' '{}'".format(p.join(instance_config_dir, self.main_config_name))) - os.system("sed -i 's!!!; s!!!;' '{}'".format(p.join(instance_config_dir, self.users_config_name))) - logging.debug("Create directory for configuration generated in this helper") # used by all utils with any config conf_d_dir = p.abspath(p.join(instance_config_dir, 'conf.d')) @@ -2363,7 +2358,7 @@ class ClickHouseInstance: def write_embedded_config(name, dest_dir, fix_log_level=False): with open(p.join(HELPERS_DIR, name), 'r') as f: data = f.read() - data = data.replace('yandex', self.config_root_name) + data = data.replace('clickhouse', self.config_root_name) if fix_log_level: data = data.replace('test', 'trace') with open(p.join(dest_dir, name), 'w') as r: From 950d3acf3a6fb99fb8ba182f9954736cc7c4bf92 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 26 Oct 2021 12:26:44 +0300 Subject: [PATCH 09/10] Update configuration-files.md --- docs/en/operations/configuration-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/operations/configuration-files.md b/docs/en/operations/configuration-files.md index 318910b5b42..cbc139dd958 100644 --- a/docs/en/operations/configuration-files.md +++ b/docs/en/operations/configuration-files.md @@ -7,7 +7,7 @@ toc_title: Configuration Files ClickHouse supports multi-file configuration management. The main server configuration file is `/etc/clickhouse-server/config.xml` or `/etc/clickhouse-server/config.yaml`. Other files must be in the `/etc/clickhouse-server/config.d` directory. Note, that any configuration file can be written either in XML or YAML, but mixing formats in one file is not supported. For example, you can have main configs as `config.xml` and `users.xml` and write additional files in `config.d` and `users.d` directories in `.yaml`. -All XML files should have the same root element, usually ``. As for YAML, `yandex:` should not be present, the parser will insert it automatically. +All XML files should have the same root element, usually ``. As for YAML, `clickhouse:` should not be present, the parser will insert it automatically. ## Override {#override} From 49c776e77c791f3747b48ac4820220a6b0637fd0 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 26 Oct 2021 12:27:13 +0300 Subject: [PATCH 10/10] Update configuration-files.md --- docs/ru/operations/configuration-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ru/operations/configuration-files.md b/docs/ru/operations/configuration-files.md index 5abb1ece455..9a3beef22ab 100644 --- a/docs/ru/operations/configuration-files.md +++ b/docs/ru/operations/configuration-files.md @@ -8,7 +8,7 @@ toc_title: "Конфигурационные файлы" ClickHouse поддерживает многофайловое управление конфигурацией. Основной конфигурационный файл сервера — `/etc/clickhouse-server/config.xml` или `/etc/clickhouse-server/config.yaml`. Остальные файлы должны находиться в директории `/etc/clickhouse-server/config.d`. Обратите внимание, что конфигурационные файлы могут быть записаны в форматах XML или YAML, но смешение этих форматов в одном файле не поддерживается. Например, можно хранить основные конфигурационные файлы как `config.xml` и `users.xml`, а дополнительные файлы записать в директории `config.d` и `users.d` в формате `.yaml`. -Все XML файлы должны иметь одинаковый корневой элемент, обычно ``. Для YAML элемент `yandex:` должен отсутствовать, так как парсер вставляет его автоматически. +Все XML файлы должны иметь одинаковый корневой элемент, обычно ``. Для YAML элемент `clickhouse:` должен отсутствовать, так как парсер вставляет его автоматически. ## Переопределение {#override}