Merge pull request #30662 from azat/conf-clickhouse

Switch everything left from `<yandex>` to `<clickhouse>`
This commit is contained in:
alexey-milovidov 2021-10-31 14:56:51 +03:00 committed by GitHub
commit 15b9d65221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
64 changed files with 224 additions and 229 deletions

View File

@ -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 <<EOT > /etc/clickhouse-server/users.d/default-user.xml
<yandex>
<clickhouse>
<!-- Docs: <https://clickhouse.com/docs/en/operations/settings/settings_users/> -->
<users>
<!-- Remove default user -->
@ -103,7 +103,7 @@ if [ -n "$CLICKHOUSE_USER" ] && [ "$CLICKHOUSE_USER" != "default" ] || [ -n "$CL
<access_management>${CLICKHOUSE_ACCESS_MANAGEMENT}</access_management>
</${CLICKHOUSE_USER}>
</users>
</yandex>
</clickhouse>
EOT
fi

View File

@ -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 "<yandex><asynchronous_metrics_update_period_s>1</asynchronous_metrics_update_period_s></yandex>" \
echo "<clickhouse><asynchronous_metrics_update_period_s>1</asynchronous_metrics_update_period_s></clickhouse>" \
> /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 "<yandex><max_server_memory_usage_to_ram_ratio>0.5</max_server_memory_usage_to_ram_ratio></yandex>" \
echo "<clickhouse><max_server_memory_usage_to_ram_ratio>0.5</max_server_memory_usage_to_ram_ratio></clickhouse>" \
> /etc/clickhouse-server/config.d/max_server_memory_usage_to_ram_ratio.xml
}

View File

@ -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 `<yandex>`. As for YAML, `yandex:` should not be present, the parser will insert it automatically.
All XML files should have the same root element, usually `<clickhouse>`. As for YAML, `clickhouse:` 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
<yandex>
<clickhouse>
<macros>
<replica from_env="REPLICA" />
<layer from_env="LAYER" />
<shard from_env="SHARD" />
</macros>
</yandex>
</clickhouse>
```
## 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
<yandex>
<clickhouse>
<!-- Appends XML subtree found at `/profiles-in-zookeeper` ZK path to `<profiles>` element. -->
<profiles from_zk="/profiles-in-zookeeper" />
@ -48,7 +48,7 @@ XML substitution example:
<include from_zk="/users-in-zookeeper" />
<include from_zk="/other-users-in-zookeeper" />
</users>
</yandex>
</clickhouse>
```
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
<yandex>
<clickhouse>
<users>
<alice>
<profile>analytics</profile>
@ -83,7 +83,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
<quota>analytics</quota>
</alice>
</users>
</yandex>
</clickhouse>
```
## YAML examples {#example}

View File

@ -23,32 +23,32 @@ To enable Kerberos, one should include `kerberos` section in `config.xml`. This
Example (goes into `config.xml`):
```xml
<yandex>
<clickhouse>
<!- ... -->
<kerberos />
</yandex>
</clickhouse>
```
With principal specification:
```xml
<yandex>
<clickhouse>
<!- ... -->
<kerberos>
<principal>HTTP/clickhouse.example.com@EXAMPLE.COM</principal>
</kerberos>
</yandex>
</clickhouse>
```
With filtering by realm:
```xml
<yandex>
<clickhouse>
<!- ... -->
<kerberos>
<realm>EXAMPLE.COM</realm>
</kerberos>
</yandex>
</clickhouse>
```
!!! warning "Note"
@ -80,7 +80,7 @@ Parameters:
Example (goes into `users.xml`):
```xml
<yandex>
<clickhouse>
<!- ... -->
<users>
<!- ... -->
@ -91,7 +91,7 @@ Example (goes into `users.xml`):
</kerberos>
</my_user>
</users>
</yandex>
</clickhouse>
```
!!! warning "Warning"

View File

@ -14,7 +14,7 @@ To define LDAP server you must add `ldap_servers` section to the `config.xml`.
**Example**
```xml
<yandex>
<clickhouse>
<!- ... -->
<ldap_servers>
<!- Typical LDAP server. -->
@ -45,7 +45,7 @@ To define LDAP server you must add `ldap_servers` section to the `config.xml`.
<enable_tls>no</enable_tls>
</my_ad_server>
</ldap_servers>
</yandex>
</clickhouse>
```
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
<yandex>
<clickhouse>
<!- ... -->
<users>
<!- ... -->
@ -101,7 +101,7 @@ At each login attempt, ClickHouse tries to "bind" to the specified DN defined by
</ldap>
</my_user>
</users>
</yandex>
</clickhouse>
```
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
<yandex>
<clickhouse>
<!- ... -->
<user_directories>
<!- Typical LDAP server. -->
@ -156,7 +156,7 @@ Goes into `config.xml`.
</role_mapping>
</ldap>
</user_directories>
</yandex>
</clickhouse>
```
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)).

View File

@ -790,14 +790,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
<yandex>
<clickhouse>
<metric_log>
<database>system</database>
<table>metric_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
</metric_log>
</yandex>
</clickhouse>
```
**Disabling**
@ -805,9 +805,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
<yandex>
<clickhouse>
<metric_log remove="1" />
</yandex>
</clickhouse>
```
## replicated_merge_tree {#server_configuration_parameters-replicated_merge_tree}
@ -1043,7 +1043,7 @@ Parameters:
**Example**
```xml
<yandex>
<clickhouse>
<text_log>
<level>notice</level>
<database>system</database>
@ -1052,7 +1052,7 @@ Parameters:
<!-- <partition_by>event_date</partition_by> -->
<engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day</engine>
</text_log>
</yandex>
</clickhouse>
```

View File

@ -22,7 +22,7 @@ ClickHouse supports zero-copy replication for `S3` and `HDFS` disks, which means
Configuration markup:
``` xml
<yandex>
<clickhouse>
<storage_configuration>
<disks>
<hdfs>
@ -44,7 +44,7 @@ Configuration markup:
<merge_tree>
<min_bytes_for_wide_part>0</min_bytes_for_wide_part>
</merge_tree>
</yandex>
</clickhouse>
```
Required parameters:
@ -96,7 +96,7 @@ Optional parameters:
Example of disk configuration:
``` xml
<yandex>
<clickhouse>
<storage_configuration>
<disks>
<disk_s3>
@ -113,7 +113,7 @@ Example of disk configuration:
</disk_s3_encrypted>
</disks>
</storage_configuration>
</yandex>
</clickhouse>
```
## 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
<yandex>
<clickhouse>
<storage_configuration>
<disks>
<web>
@ -145,7 +145,7 @@ A ready test case. You need to add this configuration to config:
</web>
</policies>
</storage_configuration>
</yandex>
</clickhouse>
```
And then execute this query:

View File

@ -34,7 +34,7 @@ System log tables can be customized by creating a config file with the same name
An example:
```xml
<yandex>
<clickhouse>
<query_log>
<database>system</database>
<table>query_log</table>
@ -45,7 +45,7 @@ An example:
-->
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</query_log>
</yandex>
</clickhouse>
```
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.

View File

@ -47,7 +47,7 @@ Parameters:
## Format of Zookeeper.xml {#format-of-zookeeper-xml}
``` xml
<yandex>
<clickhouse>
<logger>
<level>trace</level>
<size>100M</size>
@ -60,13 +60,13 @@ Parameters:
<port>2181</port>
</node>
</zookeeper>
</yandex>
</clickhouse>
```
## Configuration of Copying Tasks {#configuration-of-copying-tasks}
``` xml
<yandex>
<clickhouse>
<!-- Configuration of clusters as in an ordinary server config -->
<remote_servers>
<source_cluster>
@ -179,7 +179,7 @@ Parameters:
</table_visits>
...
</tables>
</yandex>
</clickhouse>
```
`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.

View File

@ -26,7 +26,7 @@ You can view the list of external dictionaries and their statuses in the `system
The configuration looks like this:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
<layout>
@ -36,7 +36,7 @@ The configuration looks like this:
</layout>
...
</dictionary>
</yandex>
</clickhouse>
```
Corresponding [DDL-query](../../../sql-reference/statements/create/dictionary.md):
@ -289,7 +289,7 @@ Details of the algorithm:
Configuration example:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
@ -317,7 +317,7 @@ Configuration example:
</structure>
</dictionary>
</yandex>
</clickhouse>
```
or

View File

@ -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
<yandex>
<clickhouse>
<dictionary>
...
<source>
@ -21,7 +21,7 @@ If dictionary is configured using xml-file, the configuration looks like this:
...
</dictionary>
...
</yandex>
</clickhouse>
```
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
<yandex>
<clickhouse>
<dictionary>
<name>table_name</name>
<source>
@ -340,7 +340,7 @@ The dictionary configuration in ClickHouse:
</attribute>
</structure>
</dictionary>
</yandex>
</clickhouse>
```
or
@ -416,7 +416,7 @@ Remarks:
Configuring the dictionary in ClickHouse:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>test</name>
<source>
@ -446,7 +446,7 @@ Configuring the dictionary in ClickHouse:
</attribute>
</structure>
</dictionary>
</yandex>
</clickhouse>
```
or

View File

@ -26,7 +26,7 @@ The [dictionaries](../../../operations/system-tables/dictionaries.md#system_tabl
The dictionary configuration file has the following format:
``` xml
<yandex>
<clickhouse>
<comment>An optional element with any content. Ignored by the ClickHouse server.</comment>
<!--Optional element. File name with substitutions-->
@ -38,7 +38,7 @@ The dictionary configuration file has the following format:
<!-- There can be any number of <dictionary> sections in the configuration file. -->
</dictionary>
</yandex>
</clickhouse>
```
You can [configure](../../../sql-reference/dictionaries/external-dictionaries/external-dicts-dict.md) any number of dictionaries in the same file.

View File

@ -53,7 +53,7 @@ The first column is `id`, the second column is `c1`.
Configure the external dictionary:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>ext-dict-test</name>
<source>
@ -77,7 +77,7 @@ Configure the external dictionary:
</structure>
<lifetime>0</lifetime>
</dictionary>
</yandex>
</clickhouse>
```
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
<yandex>
<clickhouse>
<dictionary>
<name>ext-dict-mult</name>
<source>
@ -142,7 +142,7 @@ Configure the external dictionary:
</structure>
<lifetime>0</lifetime>
</dictionary>
</yandex>
</clickhouse>
```
Perform the query:

View File

@ -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形式である必要があります。 また、通常は同じルート要素を持つ必要があります `<yandex>`.
すべての構成ファイルはXML形式である必要があります。 また、通常は同じルート要素を持つ必要があります `<clickhouse>`.
メイン構成ファイルで指定された一部の設定は、他の構成ファイルで上書きできます。 その `replace` または `remove` これらの構成ファイルの要素に属性を指定できます。
@ -36,7 +36,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
```
``` xml
<yandex>
<clickhouse>
<users>
<alice>
<profile>analytics</profile>
@ -47,7 +47,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
<quota>analytics</quota>
</alice>
</users>
</yandex>
</clickhouse>
```
各設定ファイルでは、サーバともある `file-preprocessed.xml` 起動時のファイル。 これらのファイルには、完了したすべての置換と上書きが含まれており、情報提供を目的としています。 設定ファイルでZooKeeperの置換が使用されていても、サーバーの起動時にZooKeeperが使用できない場合、サーバーは前処理されたファイルから設定をロードします。

View File

@ -335,14 +335,14 @@ SELECT * FROM system.metrics LIMIT 10
メトリック履歴の収集を有効にするには `system.metric_log`,作成 `/etc/clickhouse-server/config.d/metric_log.xml` 次の内容を使って:
``` xml
<yandex>
<clickhouse>
<metric_log>
<database>system</database>
<table>metric_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
</metric_log>
</yandex>
</clickhouse>
```
**例**

View File

@ -46,7 +46,7 @@ $ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/pat
## 飼育係の形式。xml {#format-of-zookeeper-xml}
``` xml
<yandex>
<clickhouse>
<logger>
<level>trace</level>
<size>100M</size>
@ -59,13 +59,13 @@ $ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/pat
<port>2181</port>
</node>
</zookeeper>
</yandex>
</clickhouse>
```
## コピータスクの構成 {#configuration-of-copying-tasks}
``` xml
<yandex>
<clickhouse>
<!-- Configuration of clusters as in an ordinary server config -->
<remote_servers>
<source_cluster>
@ -168,7 +168,7 @@ $ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/pat
</table_visits>
...
</tables>
</yandex>
</clickhouse>
```
`clickhouse-copier` の変更を追跡します `/task/path/description` そしてその場でそれらを適用します。 たとえば、次の値を変更すると `max_workers`、タスクを実行しているプロセスの数も変更されます。

View File

@ -28,7 +28,7 @@ ClickHouseは、辞書のエラーに対して例外を生成します。 エラ
設定は次のようになります:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
<layout>
@ -38,7 +38,7 @@ ClickHouseは、辞書のエラーに対して例外を生成します。 エラ
</layout>
...
</dictionary>
</yandex>
</clickhouse>
```
対応する [DDL-クエリ](../../statements/create.md#create-dictionary-query):
@ -208,7 +208,7 @@ dictGetT('dict_name', 'attr_name', id, date)
設定例:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
@ -237,7 +237,7 @@ dictGetT('dict_name', 'attr_name', id, date)
</structure>
</dictionary>
</yandex>
</clickhouse>
```
または

View File

@ -12,7 +12,7 @@ toc_title: "\u5916\u90E8\u8F9E\u66F8\u306E\u30BD\u30FC\u30B9"
辞書がxml-fileを使用して構成されている場合、構成は次のようになります:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
<source>
@ -23,7 +23,7 @@ toc_title: "\u5916\u90E8\u8F9E\u66F8\u306E\u30BD\u30FC\u30B9"
...
</dictionary>
...
</yandex>
</clickhouse>
```
の場合 [DDL-クエリ](../../statements/create.md#create-dictionary-query)、等しい構成は次のようになります:
@ -272,7 +272,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql
ClickHouseの辞書構成:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>table_name</name>
<source>
@ -301,7 +301,7 @@ ClickHouseの辞書構成:
</attribute>
</structure>
</dictionary>
</yandex>
</clickhouse>
```
または
@ -367,7 +367,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
ClickHouseでの辞書の構成:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>test</name>
<source>
@ -397,7 +397,7 @@ ClickHouseでの辞書の構成:
</attribute>
</structure>
</dictionary>
</yandex>
</clickhouse>
```
または

View File

@ -28,7 +28,7 @@ toc_title: "\u4E00\u822C\u7684\u306A\u8AAC\u660E"
辞書構成ファイルの形式は次のとおりです:
``` xml
<yandex>
<clickhouse>
<comment>An optional element with any content. Ignored by the ClickHouse server.</comment>
<!--Optional element. File name with substitutions-->
@ -40,7 +40,7 @@ toc_title: "\u4E00\u822C\u7684\u306A\u8AAC\u660E"
<!-- There can be any number of <dictionary> sections in the configuration file. -->
</dictionary>
</yandex>
</clickhouse>
```
あなたはできる [設定](external-dicts-dict.md) 同じファイル内の任意の数の辞書。

View File

@ -50,7 +50,7 @@ ClickHouseは、属性の値を解析できない場合、または値が属性
外部辞書の構成:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>ext-dict-test</name>
<source>
@ -74,7 +74,7 @@ ClickHouseは、属性の値を解析できない場合、または値が属性
</structure>
<lifetime>0</lifetime>
</dictionary>
</yandex>
</clickhouse>
```
クエリの実行:

View File

@ -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 файлы должны иметь одинаковый корневой элемент, обычно `<yandex>`. Для YAML элемент `yandex:` должен отсутствовать, так как парсер вставляет его автоматически.
Все XML файлы должны иметь одинаковый корневой элемент, обычно `<clickhouse>`. Для YAML элемент `clickhouse:` должен отсутствовать, так как парсер вставляет его автоматически.
## Переопределение {#override}
@ -22,13 +22,13 @@ ClickHouse поддерживает многофайловое управлен
Также возможно указать атрибуты как переменные среды с помощью `from_env="VARIABLE_NAME"`:
```xml
<yandex>
<clickhouse>
<macros>
<replica from_env="REPLICA" />
<layer from_env="LAYER" />
<shard from_env="SHARD" />
</macros>
</yandex>
</clickhouse>
```
## Подстановки {#substitution}
@ -40,7 +40,7 @@ ClickHouse поддерживает многофайловое управлен
Пример подстановки XML:
```xml
<yandex>
<clickhouse>
<!-- Appends XML subtree found at `/profiles-in-zookeeper` ZK path to `<profiles>` element. -->
<profiles from_zk="/profiles-in-zookeeper" />
@ -49,7 +49,7 @@ ClickHouse поддерживает многофайловое управлен
<include from_zk="/users-in-zookeeper" />
<include from_zk="/other-users-in-zookeeper" />
</users>
</yandex>
</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
<yandex>
<clickhouse>
<users>
<alice>
<profile>analytics</profile>
@ -77,7 +77,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
<quota>analytics</quota>
</alice>
</users>
</yandex>
</clickhouse>
```
Для каждого конфигурационного файла, сервер при запуске генерирует также файлы `file-preprocessed.xml`. Эти файлы содержат все выполненные подстановки и переопределения, и предназначены для информационных целей. Если в конфигурационных файлах были использованы ZooKeeper-подстановки, но при старте сервера ZooKeeper недоступен, то сервер загрузит конфигурацию из preprocessed-файла.

View File

@ -24,32 +24,32 @@ ClickHouse предоставляет возможность аутентифи
Примеры, как должен выглядеть файл `config.xml`:
```xml
<yandex>
<clickhouse>
<!- ... -->
<kerberos />
</yandex>
</clickhouse>
```
Или, с указанием принципала:
```xml
<yandex>
<clickhouse>
<!- ... -->
<kerberos>
<principal>HTTP/clickhouse.example.com@EXAMPLE.COM</principal>
</kerberos>
</yandex>
</clickhouse>
```
Или, с фильтрацией по реалм:
```xml
<yandex>
<clickhouse>
<!- ... -->
<kerberos>
<realm>EXAMPLE.COM</realm>
</kerberos>
</yandex>
</clickhouse>
```
!!! Warning "Важно"
@ -81,7 +81,7 @@ ClickHouse предоставляет возможность аутентифи
Пример, как выглядит конфигурация Kerberos в `users.xml`:
```xml
<yandex>
<clickhouse>
<!- ... -->
<users>
<!- ... -->
@ -92,7 +92,7 @@ ClickHouse предоставляет возможность аутентифи
</kerberos>
</my_user>
</users>
</yandex>
</clickhouse>
```

View File

@ -14,7 +14,7 @@
**Пример**
```xml
<yandex>
<clickhouse>
<!- ... -->
<ldap_servers>
<!- Typical LDAP server. -->
@ -45,7 +45,7 @@
<enable_tls>no</enable_tls>
</my_ad_server>
</ldap_servers>
</yandex>
</clickhouse>
```
Обратите внимание, что можно определить несколько LDAP серверов внутри секции `ldap_servers`, используя различные имена.
@ -90,7 +90,7 @@
**Пример**
```xml
<yandex>
<clickhouse>
<!- ... -->
<users>
<!- ... -->
@ -101,7 +101,7 @@
</ldap>
</my_user>
</users>
</yandex>
</clickhouse>
```
Обратите внимание, что пользователь `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
<yandex>
<clickhouse>
<!- ... -->
<user_directories>
<!- Typical LDAP server. -->
@ -156,7 +156,7 @@ CREATE USER my_user IDENTIFIED WITH ldap SERVER 'my_ldap_server';
</role_mapping>
</ldap>
</user_directories>
</yandex>
</clickhouse>
```
Обратите внимание, что `my_ldap_server`, указанный в секции `ldap` внутри секции `user_directories`, должен быть настроен в файле `config.xml`, как это было описано ранее. (см. [Определение LDAP сервера](#ldap-server-definition)).

View File

@ -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
<yandex>
<clickhouse>
<metric_log>
<database>system</database>
<table>metric_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
</metric_log>
</yandex>
</clickhouse>
```
**Выключение**
@ -769,9 +769,9 @@ ClickHouse проверяет условия для `min_part_size` и `min_part
Чтобы отключить настройку `metric_log` , создайте файл `/etc/clickhouse-server/config.d/disable_metric_log.xml` следующего содержания:
``` xml
<yandex>
<clickhouse>
<metric_log remove="1" />
</yandex>
</clickhouse>
```
## replicated\_merge\_tree {#server_configuration_parameters-replicated_merge_tree}
@ -1007,7 +1007,7 @@ ClickHouse проверяет условия для `min_part_size` и `min_part
**Пример**
```xml
<yandex>
<clickhouse>
<text_log>
<level>notice</level>
<database>system</database>
@ -1016,7 +1016,7 @@ ClickHouse проверяет условия для `min_part_size` и `min_part
<!-- <partition_by>event_date</partition_by> -->
<engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day</engine>
</text_log>
</yandex>
</clickhouse>
```

View File

@ -19,7 +19,7 @@ toc_title: "Хранение данных на внешних дисках"
Пример конфигурации:
``` xml
<yandex>
<clickhouse>
<storage_configuration>
<disks>
<hdfs>
@ -41,7 +41,7 @@ toc_title: "Хранение данных на внешних дисках"
<merge_tree>
<min_bytes_for_wide_part>0</min_bytes_for_wide_part>
</merge_tree>
</yandex>
</clickhouse>
```
Обязательные параметры:
@ -93,7 +93,7 @@ toc_title: "Хранение данных на внешних дисках"
Пример конфигурации:
``` xml
<yandex>
<clickhouse>
<storage_configuration>
<disks>
<disk_s3>
@ -110,7 +110,7 @@ toc_title: "Хранение данных на внешних дисках"
</disk_s3_encrypted>
</disks>
</storage_configuration>
</yandex>
</clickhouse>
```
## Хранение данных на веб-сервере {#storing-data-on-webserver}
@ -124,7 +124,7 @@ toc_title: "Хранение данных на внешних дисках"
Готовый тестовый пример. Добавьте эту конфигурацию в config:
``` xml
<yandex>
<clickhouse>
<storage_configuration>
<disks>
<web>
@ -142,7 +142,7 @@ toc_title: "Хранение данных на внешних дисках"
</web>
</policies>
</storage_configuration>
</yandex>
</clickhouse>
```
А затем выполните этот запрос:

View File

@ -34,7 +34,7 @@ toc_title: "Системные таблицы"
Пример:
```xml
<yandex>
<clickhouse>
<query_log>
<database>system</database>
<table>query_log</table>
@ -45,7 +45,7 @@ toc_title: "Системные таблицы"
-->
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</query_log>
</yandex>
</clickhouse>
```
По умолчанию размер таблицы не ограничен. Управлять размером таблицы можно используя [TTL](../../sql-reference/statements/alter/ttl.md#manipuliatsii-s-ttl-tablitsy) для удаления устаревших записей журнала. Также вы можете использовать функцию партиционирования для таблиц `MergeTree`.

View File

@ -44,7 +44,7 @@ $ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --bas
## Формат Zookeeper.xml {#format-zookeeper-xml}
``` xml
<yandex>
<clickhouse>
<logger>
<level>trace</level>
<size>100M</size>
@ -57,13 +57,13 @@ $ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --bas
<port>2181</port>
</node>
</zookeeper>
</yandex>
</clickhouse>
```
## Конфигурация заданий на копирование {#konfiguratsiia-zadanii-na-kopirovanie}
``` xml
<yandex>
<clickhouse>
<!-- Configuration of clusters as in an ordinary server config -->
<remote_servers>
<source_cluster>
@ -176,7 +176,7 @@ $ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --bas
</table_visits>
...
</tables>
</yandex>
</clickhouse>
```
`clickhouse-copier` отслеживает изменения `/task/path/description` и применяет их «на лету». Если вы поменяете, например, значение `max_workers`, то количество процессов, выполняющих задания, также изменится.

View File

@ -26,7 +26,7 @@ toc_title: "Хранение словарей в памяти"
Общий вид конфигурации:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
<layout>
@ -36,7 +36,7 @@ toc_title: "Хранение словарей в памяти"
</layout>
...
</dictionary>
</yandex>
</clickhouse>
```
Соответствущий [DDL-запрос](../../statements/create/dictionary.md#create-dictionary-query):
@ -284,7 +284,7 @@ RANGE(MIN first MAX last)
Пример конфигурации:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
@ -313,7 +313,7 @@ RANGE(MIN first MAX last)
</structure>
</dictionary>
</yandex>
</clickhouse>
```
или

View File

@ -10,7 +10,7 @@ toc_title: "Источники внешних словарей"
Общий вид XML-конфигурации:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
<source>
@ -21,7 +21,7 @@ toc_title: "Источники внешних словарей"
...
</dictionary>
...
</yandex>
</clickhouse>
```
Аналогичный [DDL-запрос](../../statements/create/dictionary.md#create-dictionary-query):
@ -311,7 +311,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql
Конфигурация словаря в ClickHouse:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>table_name</name>
<source>
@ -340,7 +340,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql
</attribute>
</structure>
</dictionary>
</yandex>
</clickhouse>
```
или
@ -416,7 +416,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
Настройка словаря в ClickHouse:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>test</name>
<source>
@ -446,7 +446,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
</attribute>
</structure>
</dictionary>
</yandex>
</clickhouse>
```
или

View File

@ -26,7 +26,7 @@ ClickHouse:
Конфигурационный файл словарей имеет вид:
``` xml
<yandex>
<clickhouse>
<comment>Необязательный элемент с любым содержимым. Игнорируется сервером ClickHouse.</comment>
<!--Необязательный элемент, имя файла с подстановками-->
@ -42,7 +42,7 @@ ClickHouse:
<dictionary>
<!-- Конфигурация словаря -->
</dictionary>
</yandex>
</clickhouse>
```
В одном файле можно [сконфигурировать](external-dicts-dict.md) произвольное количество словарей.

View File

@ -53,7 +53,7 @@ dictGetOrNull('dict_name', attr_name, id_expr)
Настройка внешнего словаря:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>ext-dict-test</name>
<source>
@ -77,7 +77,7 @@ dictGetOrNull('dict_name', attr_name, id_expr)
</structure>
<lifetime>0</lifetime>
</dictionary>
</yandex>
</clickhouse>
```
Выполним запрос:
@ -113,7 +113,7 @@ LIMIT 3;
Настройка внешнего словаря:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>ext-dict-mult</name>
<source>
@ -142,7 +142,7 @@ LIMIT 3;
</structure>
<lifetime>0</lifetime>
</dictionary>
</yandex>
</clickhouse>
```
Выполним запрос:

View File

@ -3,7 +3,7 @@
ClickHouse支持多配置文件管理。主配置文件是`/etc/clickhouse-server/config.xml`。其余文件须在目录`/etc/clickhouse-server/config.d`。
!!! 注意:
所有配置文件必须是XML格式。此外配置文件须有相同的跟元素通常是`<yandex>`。
所有配置文件必须是XML格式。此外配置文件须有相同的跟元素通常是`<clickhouse>`。
主配置文件中的一些配置可以通过`replace`或`remove`属性被配置文件覆盖。
@ -26,7 +26,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
```
``` xml
<yandex>
<clickhouse>
<users>
<alice>
<profile>analytics</profile>
@ -37,7 +37,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
<quota>analytics</quota>
</alice>
</users>
</yandex>
</clickhouse>
```
对于每个配置文件,服务器还会在启动时生成 `file-preprocessed.xml` 文件。这些文件包含所有已完成的替换和复盖并且它们旨在提供信息。如果zookeeper替换在配置文件中使用但ZooKeeper在服务器启动时不可用则服务器将从预处理的文件中加载配置。

View File

@ -36,7 +36,7 @@ toc_title: "\u7CFB\u7EDF\u8868"
配置定义的示例如下:
```
<yandex>
<clickhouse>
<query_log>
<database>system</database>
<table>query_log</table>
@ -47,7 +47,7 @@ toc_title: "\u7CFB\u7EDF\u8868"
-->
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</query_log>
</yandex>
</clickhouse>
```
默认情况下表增长是无限的。可以通过TTL 删除过期日志记录的设置来控制表的大小。 你也可以使用分区功能 `MergeTree`-引擎表。

View File

@ -9,14 +9,14 @@ machine_translated_rev: 5decc73b5dc60054f19087d3690c4eb99446a6c3
打开指标历史记录收集 `system.metric_log`,创建 `/etc/clickhouse-server/config.d/metric_log.xml` 具有以下内容:
``` xml
<yandex>
<clickhouse>
<metric_log>
<database>system</database>
<table>metric_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
</metric_log>
</yandex>
</clickhouse>
```
**示例**

View File

@ -41,7 +41,7 @@ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --base-
## Zookeeper.xml格式 {#format-of-zookeeper-xml}
``` xml
<yandex>
<clickhouse>
<logger>
<level>trace</level>
<size>100M</size>
@ -54,13 +54,13 @@ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --base-
<port>2181</port>
</node>
</zookeeper>
</yandex>
</clickhouse>
```
## 复制任务的配置 {#configuration-of-copying-tasks}
``` xml
<yandex>
<clickhouse>
<!-- Configuration of clusters as in an ordinary server config -->
<remote_servers>
<source_cluster>
@ -163,7 +163,7 @@ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --base-
</table_visits>
...
</tables>
</yandex>
</clickhouse>
```
`clickhouse-copier` 跟踪更改 `/task/path/description` 并在飞行中应用它们。 例如,如果你改变的值 `max_workers`,运行任务的进程数也会发生变化。

View File

@ -28,7 +28,7 @@ ClickHouse为字典中的错误生成异常。 错误示例:
配置如下所示:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
<layout>
@ -38,7 +38,7 @@ ClickHouse为字典中的错误生成异常。 错误示例:
</layout>
...
</dictionary>
</yandex>
</clickhouse>
```
相应的 [DDL-查询](../../statements/create.md#create-dictionary-query):
@ -208,7 +208,7 @@ dictGetT('dict_name', 'attr_name', id, date)
配置示例:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
@ -237,7 +237,7 @@ dictGetT('dict_name', 'attr_name', id, date)
</structure>
</dictionary>
</yandex>
</clickhouse>
```

View File

@ -12,7 +12,7 @@ toc_title: "\u5916\u90E8\u5B57\u5178\u7684\u6765\u6E90"
如果使用xml-file配置字典则配置如下所示:
``` xml
<yandex>
<clickhouse>
<dictionary>
...
<source>
@ -23,7 +23,7 @@ toc_title: "\u5916\u90E8\u5B57\u5178\u7684\u6765\u6E90"
...
</dictionary>
...
</yandex>
</clickhouse>
```
在情况下 [DDL-查询](../../statements/create.md#create-dictionary-query),相等的配置将看起来像:
@ -272,7 +272,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql
ClickHouse中的字典配置:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>table_name</name>
<source>
@ -301,7 +301,7 @@ ClickHouse中的字典配置:
</attribute>
</structure>
</dictionary>
</yandex>
</clickhouse>
```
@ -367,7 +367,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
在ClickHouse中配置字典:
``` xml
<yandex>
<clickhouse>
<dictionary>
<name>test</name>
<source>
@ -397,7 +397,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
</attribute>
</structure>
</dictionary>
</yandex>
</clickhouse>
```

View File

@ -28,7 +28,7 @@ ClickHouse:
字典配置文件具有以下格式:
``` xml
<yandex>
<clickhouse>
<comment>An optional element with any content. Ignored by the ClickHouse server.</comment>
<!--Optional element. File name with substitutions-->
@ -40,7 +40,7 @@ ClickHouse:
<!-- There can be any number of <dictionary> sections in the configuration file. -->
</dictionary>
</yandex>
</clickhouse>
```
你可以 [配置](external-dicts-dict.md) 同一文件中的任意数量的字典。

View File

@ -495,12 +495,12 @@ int mainEntryClickHouseInstall(int argc, char ** argv)
{
std::string data_file = config_d / "data-paths.xml";
WriteBufferFromFile out(data_file);
out << "<yandex>\n"
out << "<clickhouse>\n"
" <path>" << data_path.string() << "</path>\n"
" <tmp_path>" << (data_path / "tmp").string() << "</tmp_path>\n"
" <user_files_path>" << (data_path / "user_files").string() << "</user_files_path>\n"
" <format_schema_path>" << (data_path / "format_schemas").string() << "</format_schema_path>\n"
"</yandex>\n";
"</clickhouse>\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 << "<yandex>\n"
out << "<clickhouse>\n"
" <logger>\n"
" <log>" << (log_path / "clickhouse-server.log").string() << "</log>\n"
" <errorlog>" << (log_path / "clickhouse-server.err.log").string() << "</errorlog>\n"
" </logger>\n"
"</yandex>\n";
"</clickhouse>\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 << "<yandex>\n"
out << "<clickhouse>\n"
" <user_directories>\n"
" <local_directory>\n"
" <path>" << (data_path / "access").string() << "</path>\n"
" </local_directory>\n"
" </user_directories>\n"
"</yandex>\n";
"</clickhouse>\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 << "<yandex>\n"
out << "<clickhouse>\n"
" <openSSL>\n"
" <server>\n"
" <certificateFile>" << (config_dir / "server.crt").string() << "</certificateFile>\n"
@ -549,7 +549,7 @@ int mainEntryClickHouseInstall(int argc, char ** argv)
" <dhParamsFile>" << (config_dir / "dhparam.pem").string() << "</dhParamsFile>\n"
" </server>\n"
" </openSSL>\n"
"</yandex>\n";
"</clickhouse>\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 << "<yandex>\n"
out << "<clickhouse>\n"
" <users>\n"
" <default>\n"
" <password remove='1' />\n"
" <password_sha256_hex>" << hash_hex << "</password_sha256_hex>\n"
" </default>\n"
" </users>\n"
"</yandex>\n";
"</clickhouse>\n";
out.sync();
out.finalize();
fmt::print(HILITE "Password for default user is saved in file {}." END_HILITE "\n", password_file);
#else
out << "<yandex>\n"
out << "<clickhouse>\n"
" <users>\n"
" <default>\n"
" <password><![CDATA[" << password << "]]></password>\n"
" </default>\n"
" </users>\n"
"</yandex>\n";
"</clickhouse>\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 << "<yandex>\n"
out << "<clickhouse>\n"
" <listen_host>::</listen_host>\n"
"</yandex>\n";
"</clickhouse>\n";
out.sync();
out.finalize();
fmt::print("The choice is saved in file {}.\n", listen_file);

View File

@ -359,7 +359,7 @@ static ConfigurationPtr getConfigurationFromXMLString(const char * xml_data)
void LocalServer::setupUsers()
{
static const char * minimal_default_user_xml =
"<yandex>"
"<clickhouse>"
" <profiles>"
" <default></default>"
" </profiles>"
@ -376,7 +376,7 @@ void LocalServer::setupUsers()
" <quotas>"
" <default></default>"
" </quotas>"
"</yandex>";
"</clickhouse>";
ConfigurationPtr users_config;

View File

@ -1,3 +1,3 @@
<yandex>
<clickhouse>
<listen_host>::</listen_host>
</yandex>
</clickhouse>

View File

@ -1,4 +1,4 @@
<yandex>
<clickhouse>
<https_port>8443</https_port>
<tcp_port_secure>9440</tcp_port_secure>
<openSSL>
@ -6,4 +6,4 @@
<dhParamsFile remove="remove"/>
</server>
</openSSL>
</yandex>
</clickhouse>

View File

@ -11,14 +11,14 @@ TEST(Common, getMultipleValuesFromConfig)
{
std::istringstream // STYLE_CHECK_ALLOW_STD_STRING_STREAM
xml_isteam(R"END(<?xml version="1.0"?>
<yandex>
<clickhouse>
<first_level>
<second_level>0</second_level>
<second_level>1</second_level>
<second_level>2</second_level>
<second_level>3</second_level>
</first_level>
</yandex>)END");
</clickhouse>)END");
Poco::AutoPtr<Poco::Util::XMLConfiguration> config = new Poco::Util::XMLConfiguration(xml_isteam);
std::vector<std::string> answer = getMultipleValuesFromConfig(*config, "first_level", "second_level");

View File

@ -1,8 +1,8 @@
<yandex>
<clickhouse>
<profiles>
<default>
<max_untracked_memory>1Mi</max_untracked_memory>
<memory_profiler_step>1Mi</memory_profiler_step>
</default>
</profiles>
</yandex>
</clickhouse>

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<yandex>
<clickhouse>
<dictionaries_config>/etc/clickhouse-server/dictionaries/*.xml</dictionaries_config>
</yandex>
</clickhouse>

View File

@ -1,4 +1,4 @@
<yandex>
<clickhouse>
<timezone>Europe/Moscow</timezone>
<listen_host>0.0.0.0</listen_host>
<custom_settings_prefixes>custom_</custom_settings_prefixes>
@ -17,4 +17,4 @@
<stderr>/var/log/clickhouse-server/stderr.log</stderr>
<stdout>/var/log/clickhouse-server/stdout.log</stdout>
</logger>
</yandex>
</clickhouse>

View File

@ -1,7 +1,7 @@
<yandex>
<clickhouse>
<users>
<default>
<access_management>1</access_management>
</default>
</users>
</yandex>
</clickhouse>

View File

@ -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
@ -2360,11 +2360,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!<clickhouse>!<yandex>!; s!</clickhouse>!</yandex>!;' '{}'".format(p.join(instance_config_dir, self.main_config_name)))
os.system("sed -i 's!<clickhouse>!<yandex>!; s!</clickhouse>!</yandex>!;' '{}'".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'))
@ -2382,7 +2377,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('<level>test</level>', '<level>trace</level>')
with open(p.join(dest_dir, name), 'w') as r:

View File

@ -1,4 +1,4 @@
<yandex>
<clickhouse>
<zookeeper>
<node index="1">
<host>zoo1</host>
@ -14,4 +14,4 @@
</node>
<session_timeout_ms>3000</session_timeout_ms>
</zookeeper>
</yandex>
</clickhouse>

View File

@ -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",
"<yandex><merge_tree><enable_mixed_granularity_parts>1</enable_mixed_granularity_parts></merge_tree></yandex>")
"<clickhouse><merge_tree><enable_mixed_granularity_parts>1</enable_mixed_granularity_parts></merge_tree></clickhouse>")
node3.restart_with_latest_version(callback_onstop=callback)

View File

@ -1,4 +1,4 @@
<yandex>
<clickhouse>
<mqs>99999</mqs>
<users_1>
@ -14,4 +14,4 @@
<profile>default</profile>
</user_2>
</users_2>
</yandex>
</clickhouse>

View File

@ -1,4 +1,4 @@
<yandex>
<clickhouse>
<compression>
<case>
<!-- Conditions. All must be satisfied simultaneously. Some conditions may not be specified. -->
@ -26,4 +26,4 @@
</case>
</compression>
</yandex>
</clickhouse>

View File

@ -1,6 +1,6 @@
<yandex>
<clickhouse>
<merge_tree>
<min_rows_for_wide_part>0</min_rows_for_wide_part>
<min_bytes_for_wide_part>0</min_bytes_for_wide_part>
</merge_tree>
</yandex>
</clickhouse>

View File

@ -1,2 +1,2 @@
<yandex>
</yandex>
<clickhouse>
</clickhouse>

View File

@ -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 = '''<yandex>
config = '''<clickhouse>
<dictionaries_config>/etc/clickhouse-server/dictionaries/{dictionaries_config}</dictionaries_config>
</yandex>'''
</clickhouse>'''
@pytest.fixture(scope="module")

View File

@ -1,4 +1,4 @@
<yandex>
<clickhouse>
<remote_servers>
<test_cluster>
<shard>
@ -15,4 +15,4 @@
</shard>
</test_cluster>
</remote_servers>
</yandex>
</clickhouse>

View File

@ -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 = '''<yandex>
config = '''<clickhouse>
<user_defined_executable_functions_config>/etc/clickhouse-server/functions/{user_defined_executable_functions_config}</user_defined_executable_functions_config>
</yandex>'''
</clickhouse>'''
@pytest.fixture(scope="module")

View File

@ -1,6 +1,6 @@
<yandex>
<clickhouse>
<logger>
<level>trace</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
</logger>
</yandex>
</clickhouse>

View File

@ -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 = '''<yandex>
config = '''<clickhouse>
<logger>
<level>information</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
</logger>
</yandex>'''
</clickhouse>'''
@pytest.fixture(scope="module")

View File

@ -1,4 +1,4 @@
<yandex>
<clickhouse>
<remote_servers>
<test_cluster>
<shard>
@ -10,4 +10,4 @@
</shard>
</test_cluster>
</remote_servers>
</yandex>
</clickhouse>

View File

@ -1,7 +1,7 @@
<yandex>
<clickhouse>
<profiles>
<default>
<optimize_trivial_count_query>0</optimize_trivial_count_query>
</default>
</profiles>
</yandex>
</clickhouse>

View File

@ -1,4 +1,4 @@
<yandex>
<clickhouse>
<remote_servers>
<test_cluster>
<shard>
@ -15,4 +15,4 @@
</shard>
</test_cluster>
</remote_servers>
</yandex>
</clickhouse>

View File

@ -1,8 +1,8 @@
<yandex>
<clickhouse>
<macros>
<rabbitmq_host>rabbitmq1</rabbitmq_host>
<rabbitmq_port>5672</rabbitmq_port>
<rabbitmq_exchange_name>macro</rabbitmq_exchange_name>
<rabbitmq_format>JSONEachRow</rabbitmq_format>
</macros>
</yandex>
</clickhouse>