mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Merge pull request #30662 from azat/conf-clickhouse
Switch everything left from `<yandex>` to `<clickhouse>`
This commit is contained in:
commit
15b9d65221
@ -86,7 +86,7 @@ done
|
|||||||
if [ -n "$CLICKHOUSE_USER" ] && [ "$CLICKHOUSE_USER" != "default" ] || [ -n "$CLICKHOUSE_PASSWORD" ]; then
|
if [ -n "$CLICKHOUSE_USER" ] && [ "$CLICKHOUSE_USER" != "default" ] || [ -n "$CLICKHOUSE_PASSWORD" ]; then
|
||||||
echo "$0: create new user '$CLICKHOUSE_USER' instead 'default'"
|
echo "$0: create new user '$CLICKHOUSE_USER' instead 'default'"
|
||||||
cat <<EOT > /etc/clickhouse-server/users.d/default-user.xml
|
cat <<EOT > /etc/clickhouse-server/users.d/default-user.xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!-- Docs: <https://clickhouse.com/docs/en/operations/settings/settings_users/> -->
|
<!-- Docs: <https://clickhouse.com/docs/en/operations/settings/settings_users/> -->
|
||||||
<users>
|
<users>
|
||||||
<!-- Remove default user -->
|
<!-- Remove default user -->
|
||||||
@ -103,7 +103,7 @@ if [ -n "$CLICKHOUSE_USER" ] && [ "$CLICKHOUSE_USER" != "default" ] || [ -n "$CL
|
|||||||
<access_management>${CLICKHOUSE_ACCESS_MANAGEMENT}</access_management>
|
<access_management>${CLICKHOUSE_ACCESS_MANAGEMENT}</access_management>
|
||||||
</${CLICKHOUSE_USER}>
|
</${CLICKHOUSE_USER}>
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
EOT
|
EOT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -46,11 +46,11 @@ function configure()
|
|||||||
sudo chown root: /var/lib/clickhouse
|
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).
|
# 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
|
> /etc/clickhouse-server/config.d/asynchronous_metrics_update_period_s.xml
|
||||||
|
|
||||||
# Set maximum memory usage as half of total memory (less chance of OOM).
|
# 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
|
> /etc/clickhouse-server/config.d/max_server_memory_usage_to_ram_ratio.xml
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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`.
|
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}
|
## 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"`:
|
You can also declare attributes as coming from environment variables by using `from_env="VARIABLE_NAME"`:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<macros>
|
<macros>
|
||||||
<replica from_env="REPLICA" />
|
<replica from_env="REPLICA" />
|
||||||
<layer from_env="LAYER" />
|
<layer from_env="LAYER" />
|
||||||
<shard from_env="SHARD" />
|
<shard from_env="SHARD" />
|
||||||
</macros>
|
</macros>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Substitution {#substitution}
|
## 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 substitution example:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!-- Appends XML subtree found at `/profiles-in-zookeeper` ZK path to `<profiles>` element. -->
|
<!-- Appends XML subtree found at `/profiles-in-zookeeper` ZK path to `<profiles>` element. -->
|
||||||
<profiles from_zk="/profiles-in-zookeeper" />
|
<profiles from_zk="/profiles-in-zookeeper" />
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ XML substitution example:
|
|||||||
<include from_zk="/users-in-zookeeper" />
|
<include from_zk="/users-in-zookeeper" />
|
||||||
<include from_zk="/other-users-in-zookeeper" />
|
<include from_zk="/other-users-in-zookeeper" />
|
||||||
</users>
|
</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.
|
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
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<users>
|
<users>
|
||||||
<alice>
|
<alice>
|
||||||
<profile>analytics</profile>
|
<profile>analytics</profile>
|
||||||
@ -83,7 +83,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
|
|||||||
<quota>analytics</quota>
|
<quota>analytics</quota>
|
||||||
</alice>
|
</alice>
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## YAML examples {#example}
|
## YAML examples {#example}
|
||||||
|
@ -23,32 +23,32 @@ To enable Kerberos, one should include `kerberos` section in `config.xml`. This
|
|||||||
Example (goes into `config.xml`):
|
Example (goes into `config.xml`):
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<kerberos />
|
<kerberos />
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
With principal specification:
|
With principal specification:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<kerberos>
|
<kerberos>
|
||||||
<principal>HTTP/clickhouse.example.com@EXAMPLE.COM</principal>
|
<principal>HTTP/clickhouse.example.com@EXAMPLE.COM</principal>
|
||||||
</kerberos>
|
</kerberos>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
With filtering by realm:
|
With filtering by realm:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<kerberos>
|
<kerberos>
|
||||||
<realm>EXAMPLE.COM</realm>
|
<realm>EXAMPLE.COM</realm>
|
||||||
</kerberos>
|
</kerberos>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! warning "Note"
|
!!! warning "Note"
|
||||||
@ -80,7 +80,7 @@ Parameters:
|
|||||||
Example (goes into `users.xml`):
|
Example (goes into `users.xml`):
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<users>
|
<users>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
@ -91,7 +91,7 @@ Example (goes into `users.xml`):
|
|||||||
</kerberos>
|
</kerberos>
|
||||||
</my_user>
|
</my_user>
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! warning "Warning"
|
!!! warning "Warning"
|
||||||
|
@ -14,7 +14,7 @@ To define LDAP server you must add `ldap_servers` section to the `config.xml`.
|
|||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<ldap_servers>
|
<ldap_servers>
|
||||||
<!- Typical LDAP server. -->
|
<!- 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>
|
<enable_tls>no</enable_tls>
|
||||||
</my_ad_server>
|
</my_ad_server>
|
||||||
</ldap_servers>
|
</ldap_servers>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Note, that you can define multiple LDAP servers inside the `ldap_servers` section using distinct names.
|
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**
|
**Example**
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<users>
|
<users>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
@ -101,7 +101,7 @@ At each login attempt, ClickHouse tries to "bind" to the specified DN defined by
|
|||||||
</ldap>
|
</ldap>
|
||||||
</my_user>
|
</my_user>
|
||||||
</users>
|
</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.
|
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`.
|
Goes into `config.xml`.
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<user_directories>
|
<user_directories>
|
||||||
<!- Typical LDAP server. -->
|
<!- Typical LDAP server. -->
|
||||||
@ -156,7 +156,7 @@ Goes into `config.xml`.
|
|||||||
</role_mapping>
|
</role_mapping>
|
||||||
</ldap>
|
</ldap>
|
||||||
</user_directories>
|
</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)).
|
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)).
|
||||||
|
@ -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:
|
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
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<metric_log>
|
<metric_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>metric_log</table>
|
<table>metric_log</table>
|
||||||
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
</metric_log>
|
</metric_log>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Disabling**
|
**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:
|
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
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<metric_log remove="1" />
|
<metric_log remove="1" />
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## replicated_merge_tree {#server_configuration_parameters-replicated_merge_tree}
|
## replicated_merge_tree {#server_configuration_parameters-replicated_merge_tree}
|
||||||
@ -1043,7 +1043,7 @@ Parameters:
|
|||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<text_log>
|
<text_log>
|
||||||
<level>notice</level>
|
<level>notice</level>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
@ -1052,7 +1052,7 @@ Parameters:
|
|||||||
<!-- <partition_by>event_date</partition_by> -->
|
<!-- <partition_by>event_date</partition_by> -->
|
||||||
<engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day</engine>
|
<engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day</engine>
|
||||||
</text_log>
|
</text_log>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ ClickHouse supports zero-copy replication for `S3` and `HDFS` disks, which means
|
|||||||
Configuration markup:
|
Configuration markup:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<storage_configuration>
|
<storage_configuration>
|
||||||
<disks>
|
<disks>
|
||||||
<hdfs>
|
<hdfs>
|
||||||
@ -44,7 +44,7 @@ Configuration markup:
|
|||||||
<merge_tree>
|
<merge_tree>
|
||||||
<min_bytes_for_wide_part>0</min_bytes_for_wide_part>
|
<min_bytes_for_wide_part>0</min_bytes_for_wide_part>
|
||||||
</merge_tree>
|
</merge_tree>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Required parameters:
|
Required parameters:
|
||||||
@ -96,7 +96,7 @@ Optional parameters:
|
|||||||
Example of disk configuration:
|
Example of disk configuration:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<storage_configuration>
|
<storage_configuration>
|
||||||
<disks>
|
<disks>
|
||||||
<disk_s3>
|
<disk_s3>
|
||||||
@ -113,7 +113,7 @@ Example of disk configuration:
|
|||||||
</disk_s3_encrypted>
|
</disk_s3_encrypted>
|
||||||
</disks>
|
</disks>
|
||||||
</storage_configuration>
|
</storage_configuration>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Storing Data on Web Server {#storing-data-on-webserver}
|
## 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:
|
A ready test case. You need to add this configuration to config:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<storage_configuration>
|
<storage_configuration>
|
||||||
<disks>
|
<disks>
|
||||||
<web>
|
<web>
|
||||||
@ -145,7 +145,7 @@ A ready test case. You need to add this configuration to config:
|
|||||||
</web>
|
</web>
|
||||||
</policies>
|
</policies>
|
||||||
</storage_configuration>
|
</storage_configuration>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
And then execute this query:
|
And then execute this query:
|
||||||
|
@ -34,7 +34,7 @@ System log tables can be customized by creating a config file with the same name
|
|||||||
An example:
|
An example:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<query_log>
|
<query_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>query_log</table>
|
<table>query_log</table>
|
||||||
@ -45,7 +45,7 @@ An example:
|
|||||||
-->
|
-->
|
||||||
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
</query_log>
|
</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.
|
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.
|
||||||
|
@ -47,7 +47,7 @@ Parameters:
|
|||||||
## Format of Zookeeper.xml {#format-of-zookeeper-xml}
|
## Format of Zookeeper.xml {#format-of-zookeeper-xml}
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<logger>
|
<logger>
|
||||||
<level>trace</level>
|
<level>trace</level>
|
||||||
<size>100M</size>
|
<size>100M</size>
|
||||||
@ -60,13 +60,13 @@ Parameters:
|
|||||||
<port>2181</port>
|
<port>2181</port>
|
||||||
</node>
|
</node>
|
||||||
</zookeeper>
|
</zookeeper>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration of Copying Tasks {#configuration-of-copying-tasks}
|
## Configuration of Copying Tasks {#configuration-of-copying-tasks}
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!-- Configuration of clusters as in an ordinary server config -->
|
<!-- Configuration of clusters as in an ordinary server config -->
|
||||||
<remote_servers>
|
<remote_servers>
|
||||||
<source_cluster>
|
<source_cluster>
|
||||||
@ -179,7 +179,7 @@ Parameters:
|
|||||||
</table_visits>
|
</table_visits>
|
||||||
...
|
...
|
||||||
</tables>
|
</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.
|
`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.
|
||||||
|
@ -26,7 +26,7 @@ You can view the list of external dictionaries and their statuses in the `system
|
|||||||
The configuration looks like this:
|
The configuration looks like this:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
...
|
...
|
||||||
<layout>
|
<layout>
|
||||||
@ -36,7 +36,7 @@ The configuration looks like this:
|
|||||||
</layout>
|
</layout>
|
||||||
...
|
...
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Corresponding [DDL-query](../../../sql-reference/statements/create/dictionary.md):
|
Corresponding [DDL-query](../../../sql-reference/statements/create/dictionary.md):
|
||||||
@ -289,7 +289,7 @@ Details of the algorithm:
|
|||||||
Configuration example:
|
Configuration example:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ Configuration example:
|
|||||||
</structure>
|
</structure>
|
||||||
|
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
@ -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:
|
If dictionary is configured using xml-file, the configuration looks like this:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
...
|
...
|
||||||
<source>
|
<source>
|
||||||
@ -21,7 +21,7 @@ If dictionary is configured using xml-file, the configuration looks like this:
|
|||||||
...
|
...
|
||||||
</dictionary>
|
</dictionary>
|
||||||
...
|
...
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
In case of [DDL-query](../../../sql-reference/statements/create/dictionary.md), equal configuration will looks like:
|
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:
|
The dictionary configuration in ClickHouse:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>table_name</name>
|
<name>table_name</name>
|
||||||
<source>
|
<source>
|
||||||
@ -340,7 +340,7 @@ The dictionary configuration in ClickHouse:
|
|||||||
</attribute>
|
</attribute>
|
||||||
</structure>
|
</structure>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
@ -416,7 +416,7 @@ Remarks:
|
|||||||
Configuring the dictionary in ClickHouse:
|
Configuring the dictionary in ClickHouse:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>test</name>
|
<name>test</name>
|
||||||
<source>
|
<source>
|
||||||
@ -446,7 +446,7 @@ Configuring the dictionary in ClickHouse:
|
|||||||
</attribute>
|
</attribute>
|
||||||
</structure>
|
</structure>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
@ -26,7 +26,7 @@ The [dictionaries](../../../operations/system-tables/dictionaries.md#system_tabl
|
|||||||
The dictionary configuration file has the following format:
|
The dictionary configuration file has the following format:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<comment>An optional element with any content. Ignored by the ClickHouse server.</comment>
|
<comment>An optional element with any content. Ignored by the ClickHouse server.</comment>
|
||||||
|
|
||||||
<!--Optional element. File name with substitutions-->
|
<!--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. -->
|
<!-- There can be any number of <dictionary> sections in the configuration file. -->
|
||||||
</dictionary>
|
</dictionary>
|
||||||
|
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
You can [configure](../../../sql-reference/dictionaries/external-dictionaries/external-dicts-dict.md) any number of dictionaries in the same file.
|
You can [configure](../../../sql-reference/dictionaries/external-dictionaries/external-dicts-dict.md) any number of dictionaries in the same file.
|
||||||
|
@ -53,7 +53,7 @@ The first column is `id`, the second column is `c1`.
|
|||||||
Configure the external dictionary:
|
Configure the external dictionary:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>ext-dict-test</name>
|
<name>ext-dict-test</name>
|
||||||
<source>
|
<source>
|
||||||
@ -77,7 +77,7 @@ Configure the external dictionary:
|
|||||||
</structure>
|
</structure>
|
||||||
<lifetime>0</lifetime>
|
<lifetime>0</lifetime>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Perform the query:
|
Perform the query:
|
||||||
@ -113,7 +113,7 @@ The first column is `id`, the second is `c1`, the third is `c2`.
|
|||||||
Configure the external dictionary:
|
Configure the external dictionary:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>ext-dict-mult</name>
|
<name>ext-dict-mult</name>
|
||||||
<source>
|
<source>
|
||||||
@ -142,7 +142,7 @@ Configure the external dictionary:
|
|||||||
</structure>
|
</structure>
|
||||||
<lifetime>0</lifetime>
|
<lifetime>0</lifetime>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Perform the query:
|
Perform the query:
|
||||||
|
@ -10,7 +10,7 @@ toc_title: "\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB"
|
|||||||
ClickHouseは複数のファイル構成管理をサポートします。 主サーバ設定ファイルで指定することがで `/etc/clickhouse-server/config.xml`. その他のファイルは `/etc/clickhouse-server/config.d` ディレクトリ。
|
ClickHouseは複数のファイル構成管理をサポートします。 主サーバ設定ファイルで指定することがで `/etc/clickhouse-server/config.xml`. その他のファイルは `/etc/clickhouse-server/config.d` ディレクトリ。
|
||||||
|
|
||||||
!!! note "注"
|
!!! note "注"
|
||||||
すべての構成ファイルはXML形式である必要があります。 また、通常は同じルート要素を持つ必要があります `<yandex>`.
|
すべての構成ファイルはXML形式である必要があります。 また、通常は同じルート要素を持つ必要があります `<clickhouse>`.
|
||||||
|
|
||||||
メイン構成ファイルで指定された一部の設定は、他の構成ファイルで上書きできます。 その `replace` または `remove` これらの構成ファイルの要素に属性を指定できます。
|
メイン構成ファイルで指定された一部の設定は、他の構成ファイルで上書きできます。 その `replace` または `remove` これらの構成ファイルの要素に属性を指定できます。
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
|
|||||||
```
|
```
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<users>
|
<users>
|
||||||
<alice>
|
<alice>
|
||||||
<profile>analytics</profile>
|
<profile>analytics</profile>
|
||||||
@ -47,7 +47,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
|
|||||||
<quota>analytics</quota>
|
<quota>analytics</quota>
|
||||||
</alice>
|
</alice>
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
各設定ファイルでは、サーバともある `file-preprocessed.xml` 起動時のファイル。 これらのファイルには、完了したすべての置換と上書きが含まれており、情報提供を目的としています。 設定ファイルでZooKeeperの置換が使用されていても、サーバーの起動時にZooKeeperが使用できない場合、サーバーは前処理されたファイルから設定をロードします。
|
各設定ファイルでは、サーバともある `file-preprocessed.xml` 起動時のファイル。 これらのファイルには、完了したすべての置換と上書きが含まれており、情報提供を目的としています。 設定ファイルでZooKeeperの置換が使用されていても、サーバーの起動時にZooKeeperが使用できない場合、サーバーは前処理されたファイルから設定をロードします。
|
||||||
|
@ -335,14 +335,14 @@ SELECT * FROM system.metrics LIMIT 10
|
|||||||
メトリック履歴の収集を有効にするには `system.metric_log`,作成 `/etc/clickhouse-server/config.d/metric_log.xml` 次の内容を使って:
|
メトリック履歴の収集を有効にするには `system.metric_log`,作成 `/etc/clickhouse-server/config.d/metric_log.xml` 次の内容を使って:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<metric_log>
|
<metric_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>metric_log</table>
|
<table>metric_log</table>
|
||||||
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
</metric_log>
|
</metric_log>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
**例**
|
**例**
|
||||||
|
@ -46,7 +46,7 @@ $ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/pat
|
|||||||
## 飼育係の形式。xml {#format-of-zookeeper-xml}
|
## 飼育係の形式。xml {#format-of-zookeeper-xml}
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<logger>
|
<logger>
|
||||||
<level>trace</level>
|
<level>trace</level>
|
||||||
<size>100M</size>
|
<size>100M</size>
|
||||||
@ -59,13 +59,13 @@ $ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/pat
|
|||||||
<port>2181</port>
|
<port>2181</port>
|
||||||
</node>
|
</node>
|
||||||
</zookeeper>
|
</zookeeper>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## コピータスクの構成 {#configuration-of-copying-tasks}
|
## コピータスクの構成 {#configuration-of-copying-tasks}
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!-- Configuration of clusters as in an ordinary server config -->
|
<!-- Configuration of clusters as in an ordinary server config -->
|
||||||
<remote_servers>
|
<remote_servers>
|
||||||
<source_cluster>
|
<source_cluster>
|
||||||
@ -168,7 +168,7 @@ $ clickhouse-copier copier --daemon --config zookeeper.xml --task-path /task/pat
|
|||||||
</table_visits>
|
</table_visits>
|
||||||
...
|
...
|
||||||
</tables>
|
</tables>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
`clickhouse-copier` の変更を追跡します `/task/path/description` そしてその場でそれらを適用します。 たとえば、次の値を変更すると `max_workers`、タスクを実行しているプロセスの数も変更されます。
|
`clickhouse-copier` の変更を追跡します `/task/path/description` そしてその場でそれらを適用します。 たとえば、次の値を変更すると `max_workers`、タスクを実行しているプロセスの数も変更されます。
|
||||||
|
@ -28,7 +28,7 @@ ClickHouseは、辞書のエラーに対して例外を生成します。 エラ
|
|||||||
設定は次のようになります:
|
設定は次のようになります:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
...
|
...
|
||||||
<layout>
|
<layout>
|
||||||
@ -38,7 +38,7 @@ ClickHouseは、辞書のエラーに対して例外を生成します。 エラ
|
|||||||
</layout>
|
</layout>
|
||||||
...
|
...
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
対応する [DDL-クエリ](../../statements/create.md#create-dictionary-query):
|
対応する [DDL-クエリ](../../statements/create.md#create-dictionary-query):
|
||||||
@ -208,7 +208,7 @@ dictGetT('dict_name', 'attr_name', id, date)
|
|||||||
設定例:
|
設定例:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
|
|
||||||
...
|
...
|
||||||
@ -237,7 +237,7 @@ dictGetT('dict_name', 'attr_name', id, date)
|
|||||||
</structure>
|
</structure>
|
||||||
|
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
または
|
または
|
||||||
|
@ -12,7 +12,7 @@ toc_title: "\u5916\u90E8\u8F9E\u66F8\u306E\u30BD\u30FC\u30B9"
|
|||||||
辞書がxml-fileを使用して構成されている場合、構成は次のようになります:
|
辞書がxml-fileを使用して構成されている場合、構成は次のようになります:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
...
|
...
|
||||||
<source>
|
<source>
|
||||||
@ -23,7 +23,7 @@ toc_title: "\u5916\u90E8\u8F9E\u66F8\u306E\u30BD\u30FC\u30B9"
|
|||||||
...
|
...
|
||||||
</dictionary>
|
</dictionary>
|
||||||
...
|
...
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
の場合 [DDL-クエリ](../../statements/create.md#create-dictionary-query)、等しい構成は次のようになります:
|
の場合 [DDL-クエリ](../../statements/create.md#create-dictionary-query)、等しい構成は次のようになります:
|
||||||
@ -272,7 +272,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql
|
|||||||
ClickHouseの辞書構成:
|
ClickHouseの辞書構成:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>table_name</name>
|
<name>table_name</name>
|
||||||
<source>
|
<source>
|
||||||
@ -301,7 +301,7 @@ ClickHouseの辞書構成:
|
|||||||
</attribute>
|
</attribute>
|
||||||
</structure>
|
</structure>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
または
|
または
|
||||||
@ -367,7 +367,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
|
|||||||
ClickHouseでの辞書の構成:
|
ClickHouseでの辞書の構成:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>test</name>
|
<name>test</name>
|
||||||
<source>
|
<source>
|
||||||
@ -397,7 +397,7 @@ ClickHouseでの辞書の構成:
|
|||||||
</attribute>
|
</attribute>
|
||||||
</structure>
|
</structure>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
または
|
または
|
||||||
|
@ -28,7 +28,7 @@ toc_title: "\u4E00\u822C\u7684\u306A\u8AAC\u660E"
|
|||||||
辞書構成ファイルの形式は次のとおりです:
|
辞書構成ファイルの形式は次のとおりです:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<comment>An optional element with any content. Ignored by the ClickHouse server.</comment>
|
<comment>An optional element with any content. Ignored by the ClickHouse server.</comment>
|
||||||
|
|
||||||
<!--Optional element. File name with substitutions-->
|
<!--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. -->
|
<!-- There can be any number of <dictionary> sections in the configuration file. -->
|
||||||
</dictionary>
|
</dictionary>
|
||||||
|
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
あなたはできる [設定](external-dicts-dict.md) 同じファイル内の任意の数の辞書。
|
あなたはできる [設定](external-dicts-dict.md) 同じファイル内の任意の数の辞書。
|
||||||
|
@ -50,7 +50,7 @@ ClickHouseは、属性の値を解析できない場合、または値が属性
|
|||||||
外部辞書の構成:
|
外部辞書の構成:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>ext-dict-test</name>
|
<name>ext-dict-test</name>
|
||||||
<source>
|
<source>
|
||||||
@ -74,7 +74,7 @@ ClickHouseは、属性の値を解析できない場合、または値が属性
|
|||||||
</structure>
|
</structure>
|
||||||
<lifetime>0</lifetime>
|
<lifetime>0</lifetime>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
クエリの実行:
|
クエリの実行:
|
||||||
|
@ -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`.
|
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}
|
## Переопределение {#override}
|
||||||
|
|
||||||
@ -22,13 +22,13 @@ ClickHouse поддерживает многофайловое управлен
|
|||||||
Также возможно указать атрибуты как переменные среды с помощью `from_env="VARIABLE_NAME"`:
|
Также возможно указать атрибуты как переменные среды с помощью `from_env="VARIABLE_NAME"`:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<macros>
|
<macros>
|
||||||
<replica from_env="REPLICA" />
|
<replica from_env="REPLICA" />
|
||||||
<layer from_env="LAYER" />
|
<layer from_env="LAYER" />
|
||||||
<shard from_env="SHARD" />
|
<shard from_env="SHARD" />
|
||||||
</macros>
|
</macros>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Подстановки {#substitution}
|
## Подстановки {#substitution}
|
||||||
@ -40,7 +40,7 @@ ClickHouse поддерживает многофайловое управлен
|
|||||||
Пример подстановки XML:
|
Пример подстановки XML:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!-- Appends XML subtree found at `/profiles-in-zookeeper` ZK path to `<profiles>` element. -->
|
<!-- Appends XML subtree found at `/profiles-in-zookeeper` ZK path to `<profiles>` element. -->
|
||||||
<profiles from_zk="/profiles-in-zookeeper" />
|
<profiles from_zk="/profiles-in-zookeeper" />
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ ClickHouse поддерживает многофайловое управлен
|
|||||||
<include from_zk="/users-in-zookeeper" />
|
<include from_zk="/users-in-zookeeper" />
|
||||||
<include from_zk="/other-users-in-zookeeper" />
|
<include from_zk="/other-users-in-zookeeper" />
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Подстановки могут также выполняться из ZooKeeper. Для этого укажите у элемента атрибут `from_zk = "/path/to/node"`. Значение элемента заменится на содержимое узла `/path/to/node` в ZooKeeper. В ZooKeeper-узел также можно положить целое XML-поддерево, оно будет целиком вставлено в исходный элемент.
|
Подстановки могут также выполняться из 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
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<users>
|
<users>
|
||||||
<alice>
|
<alice>
|
||||||
<profile>analytics</profile>
|
<profile>analytics</profile>
|
||||||
@ -77,7 +77,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
|
|||||||
<quota>analytics</quota>
|
<quota>analytics</quota>
|
||||||
</alice>
|
</alice>
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Для каждого конфигурационного файла, сервер при запуске генерирует также файлы `file-preprocessed.xml`. Эти файлы содержат все выполненные подстановки и переопределения, и предназначены для информационных целей. Если в конфигурационных файлах были использованы ZooKeeper-подстановки, но при старте сервера ZooKeeper недоступен, то сервер загрузит конфигурацию из preprocessed-файла.
|
Для каждого конфигурационного файла, сервер при запуске генерирует также файлы `file-preprocessed.xml`. Эти файлы содержат все выполненные подстановки и переопределения, и предназначены для информационных целей. Если в конфигурационных файлах были использованы ZooKeeper-подстановки, но при старте сервера ZooKeeper недоступен, то сервер загрузит конфигурацию из preprocessed-файла.
|
||||||
|
@ -24,32 +24,32 @@ ClickHouse предоставляет возможность аутентифи
|
|||||||
Примеры, как должен выглядеть файл `config.xml`:
|
Примеры, как должен выглядеть файл `config.xml`:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<kerberos />
|
<kerberos />
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Или, с указанием принципала:
|
Или, с указанием принципала:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<kerberos>
|
<kerberos>
|
||||||
<principal>HTTP/clickhouse.example.com@EXAMPLE.COM</principal>
|
<principal>HTTP/clickhouse.example.com@EXAMPLE.COM</principal>
|
||||||
</kerberos>
|
</kerberos>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Или, с фильтрацией по реалм:
|
Или, с фильтрацией по реалм:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<kerberos>
|
<kerberos>
|
||||||
<realm>EXAMPLE.COM</realm>
|
<realm>EXAMPLE.COM</realm>
|
||||||
</kerberos>
|
</kerberos>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
!!! Warning "Важно"
|
!!! Warning "Важно"
|
||||||
@ -81,7 +81,7 @@ ClickHouse предоставляет возможность аутентифи
|
|||||||
Пример, как выглядит конфигурация Kerberos в `users.xml`:
|
Пример, как выглядит конфигурация Kerberos в `users.xml`:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<users>
|
<users>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
@ -92,7 +92,7 @@ ClickHouse предоставляет возможность аутентифи
|
|||||||
</kerberos>
|
</kerberos>
|
||||||
</my_user>
|
</my_user>
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
**Пример**
|
**Пример**
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<ldap_servers>
|
<ldap_servers>
|
||||||
<!- Typical LDAP server. -->
|
<!- Typical LDAP server. -->
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<enable_tls>no</enable_tls>
|
<enable_tls>no</enable_tls>
|
||||||
</my_ad_server>
|
</my_ad_server>
|
||||||
</ldap_servers>
|
</ldap_servers>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Обратите внимание, что можно определить несколько LDAP серверов внутри секции `ldap_servers`, используя различные имена.
|
Обратите внимание, что можно определить несколько LDAP серверов внутри секции `ldap_servers`, используя различные имена.
|
||||||
@ -90,7 +90,7 @@
|
|||||||
**Пример**
|
**Пример**
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<users>
|
<users>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
@ -101,7 +101,7 @@
|
|||||||
</ldap>
|
</ldap>
|
||||||
</my_user>
|
</my_user>
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Обратите внимание, что пользователь `my_user` ссылается на `my_ldap_server`. Этот LDAP сервер должен быть настроен в основном файле `config.xml`, как это было описано ранее.
|
Обратите внимание, что пользователь `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`.
|
В `config.xml`.
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!- ... -->
|
<!- ... -->
|
||||||
<user_directories>
|
<user_directories>
|
||||||
<!- Typical LDAP server. -->
|
<!- Typical LDAP server. -->
|
||||||
@ -156,7 +156,7 @@ CREATE USER my_user IDENTIFIED WITH ldap SERVER 'my_ldap_server';
|
|||||||
</role_mapping>
|
</role_mapping>
|
||||||
</ldap>
|
</ldap>
|
||||||
</user_directories>
|
</user_directories>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Обратите внимание, что `my_ldap_server`, указанный в секции `ldap` внутри секции `user_directories`, должен быть настроен в файле `config.xml`, как это было описано ранее. (см. [Определение LDAP сервера](#ldap-server-definition)).
|
Обратите внимание, что `my_ldap_server`, указанный в секции `ldap` внутри секции `user_directories`, должен быть настроен в файле `config.xml`, как это было описано ранее. (см. [Определение LDAP сервера](#ldap-server-definition)).
|
||||||
|
@ -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` следующего содержания:
|
Чтобы вручную включить сбор истории метрик в таблице [`system.metric_log`](../../operations/system-tables/metric_log.md), создайте `/etc/clickhouse-server/config.d/metric_log.xml` следующего содержания:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<metric_log>
|
<metric_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>metric_log</table>
|
<table>metric_log</table>
|
||||||
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
</metric_log>
|
</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` следующего содержания:
|
Чтобы отключить настройку `metric_log` , создайте файл `/etc/clickhouse-server/config.d/disable_metric_log.xml` следующего содержания:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<metric_log remove="1" />
|
<metric_log remove="1" />
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## replicated\_merge\_tree {#server_configuration_parameters-replicated_merge_tree}
|
## replicated\_merge\_tree {#server_configuration_parameters-replicated_merge_tree}
|
||||||
@ -1007,7 +1007,7 @@ ClickHouse проверяет условия для `min_part_size` и `min_part
|
|||||||
|
|
||||||
**Пример**
|
**Пример**
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<text_log>
|
<text_log>
|
||||||
<level>notice</level>
|
<level>notice</level>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
@ -1016,7 +1016,7 @@ ClickHouse проверяет условия для `min_part_size` и `min_part
|
|||||||
<!-- <partition_by>event_date</partition_by> -->
|
<!-- <partition_by>event_date</partition_by> -->
|
||||||
<engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day</engine>
|
<engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + INTERVAL 30 day</engine>
|
||||||
</text_log>
|
</text_log>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ toc_title: "Хранение данных на внешних дисках"
|
|||||||
|
|
||||||
Пример конфигурации:
|
Пример конфигурации:
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<storage_configuration>
|
<storage_configuration>
|
||||||
<disks>
|
<disks>
|
||||||
<hdfs>
|
<hdfs>
|
||||||
@ -41,7 +41,7 @@ toc_title: "Хранение данных на внешних дисках"
|
|||||||
<merge_tree>
|
<merge_tree>
|
||||||
<min_bytes_for_wide_part>0</min_bytes_for_wide_part>
|
<min_bytes_for_wide_part>0</min_bytes_for_wide_part>
|
||||||
</merge_tree>
|
</merge_tree>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Обязательные параметры:
|
Обязательные параметры:
|
||||||
@ -93,7 +93,7 @@ toc_title: "Хранение данных на внешних дисках"
|
|||||||
Пример конфигурации:
|
Пример конфигурации:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<storage_configuration>
|
<storage_configuration>
|
||||||
<disks>
|
<disks>
|
||||||
<disk_s3>
|
<disk_s3>
|
||||||
@ -110,7 +110,7 @@ toc_title: "Хранение данных на внешних дисках"
|
|||||||
</disk_s3_encrypted>
|
</disk_s3_encrypted>
|
||||||
</disks>
|
</disks>
|
||||||
</storage_configuration>
|
</storage_configuration>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Хранение данных на веб-сервере {#storing-data-on-webserver}
|
## Хранение данных на веб-сервере {#storing-data-on-webserver}
|
||||||
@ -124,7 +124,7 @@ toc_title: "Хранение данных на внешних дисках"
|
|||||||
Готовый тестовый пример. Добавьте эту конфигурацию в config:
|
Готовый тестовый пример. Добавьте эту конфигурацию в config:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<storage_configuration>
|
<storage_configuration>
|
||||||
<disks>
|
<disks>
|
||||||
<web>
|
<web>
|
||||||
@ -142,7 +142,7 @@ toc_title: "Хранение данных на внешних дисках"
|
|||||||
</web>
|
</web>
|
||||||
</policies>
|
</policies>
|
||||||
</storage_configuration>
|
</storage_configuration>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
А затем выполните этот запрос:
|
А затем выполните этот запрос:
|
||||||
|
@ -34,7 +34,7 @@ toc_title: "Системные таблицы"
|
|||||||
Пример:
|
Пример:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<query_log>
|
<query_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>query_log</table>
|
<table>query_log</table>
|
||||||
@ -45,7 +45,7 @@ toc_title: "Системные таблицы"
|
|||||||
-->
|
-->
|
||||||
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
</query_log>
|
</query_log>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
По умолчанию размер таблицы не ограничен. Управлять размером таблицы можно используя [TTL](../../sql-reference/statements/alter/ttl.md#manipuliatsii-s-ttl-tablitsy) для удаления устаревших записей журнала. Также вы можете использовать функцию партиционирования для таблиц `MergeTree`.
|
По умолчанию размер таблицы не ограничен. Управлять размером таблицы можно используя [TTL](../../sql-reference/statements/alter/ttl.md#manipuliatsii-s-ttl-tablitsy) для удаления устаревших записей журнала. Также вы можете использовать функцию партиционирования для таблиц `MergeTree`.
|
||||||
|
@ -44,7 +44,7 @@ $ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --bas
|
|||||||
## Формат Zookeeper.xml {#format-zookeeper-xml}
|
## Формат Zookeeper.xml {#format-zookeeper-xml}
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<logger>
|
<logger>
|
||||||
<level>trace</level>
|
<level>trace</level>
|
||||||
<size>100M</size>
|
<size>100M</size>
|
||||||
@ -57,13 +57,13 @@ $ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --bas
|
|||||||
<port>2181</port>
|
<port>2181</port>
|
||||||
</node>
|
</node>
|
||||||
</zookeeper>
|
</zookeeper>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Конфигурация заданий на копирование {#konfiguratsiia-zadanii-na-kopirovanie}
|
## Конфигурация заданий на копирование {#konfiguratsiia-zadanii-na-kopirovanie}
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!-- Configuration of clusters as in an ordinary server config -->
|
<!-- Configuration of clusters as in an ordinary server config -->
|
||||||
<remote_servers>
|
<remote_servers>
|
||||||
<source_cluster>
|
<source_cluster>
|
||||||
@ -176,7 +176,7 @@ $ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --bas
|
|||||||
</table_visits>
|
</table_visits>
|
||||||
...
|
...
|
||||||
</tables>
|
</tables>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
`clickhouse-copier` отслеживает изменения `/task/path/description` и применяет их «на лету». Если вы поменяете, например, значение `max_workers`, то количество процессов, выполняющих задания, также изменится.
|
`clickhouse-copier` отслеживает изменения `/task/path/description` и применяет их «на лету». Если вы поменяете, например, значение `max_workers`, то количество процессов, выполняющих задания, также изменится.
|
||||||
|
@ -26,7 +26,7 @@ toc_title: "Хранение словарей в памяти"
|
|||||||
Общий вид конфигурации:
|
Общий вид конфигурации:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
...
|
...
|
||||||
<layout>
|
<layout>
|
||||||
@ -36,7 +36,7 @@ toc_title: "Хранение словарей в памяти"
|
|||||||
</layout>
|
</layout>
|
||||||
...
|
...
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Соответствущий [DDL-запрос](../../statements/create/dictionary.md#create-dictionary-query):
|
Соответствущий [DDL-запрос](../../statements/create/dictionary.md#create-dictionary-query):
|
||||||
@ -284,7 +284,7 @@ RANGE(MIN first MAX last)
|
|||||||
Пример конфигурации:
|
Пример конфигурации:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
|
|
||||||
...
|
...
|
||||||
@ -313,7 +313,7 @@ RANGE(MIN first MAX last)
|
|||||||
</structure>
|
</structure>
|
||||||
|
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
или
|
или
|
||||||
|
@ -10,7 +10,7 @@ toc_title: "Источники внешних словарей"
|
|||||||
Общий вид XML-конфигурации:
|
Общий вид XML-конфигурации:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
...
|
...
|
||||||
<source>
|
<source>
|
||||||
@ -21,7 +21,7 @@ toc_title: "Источники внешних словарей"
|
|||||||
...
|
...
|
||||||
</dictionary>
|
</dictionary>
|
||||||
...
|
...
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Аналогичный [DDL-запрос](../../statements/create/dictionary.md#create-dictionary-query):
|
Аналогичный [DDL-запрос](../../statements/create/dictionary.md#create-dictionary-query):
|
||||||
@ -311,7 +311,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql
|
|||||||
Конфигурация словаря в ClickHouse:
|
Конфигурация словаря в ClickHouse:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>table_name</name>
|
<name>table_name</name>
|
||||||
<source>
|
<source>
|
||||||
@ -340,7 +340,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql
|
|||||||
</attribute>
|
</attribute>
|
||||||
</structure>
|
</structure>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
или
|
или
|
||||||
@ -416,7 +416,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
|
|||||||
Настройка словаря в ClickHouse:
|
Настройка словаря в ClickHouse:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>test</name>
|
<name>test</name>
|
||||||
<source>
|
<source>
|
||||||
@ -446,7 +446,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
|
|||||||
</attribute>
|
</attribute>
|
||||||
</structure>
|
</structure>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
или
|
или
|
||||||
|
@ -26,7 +26,7 @@ ClickHouse:
|
|||||||
Конфигурационный файл словарей имеет вид:
|
Конфигурационный файл словарей имеет вид:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<comment>Необязательный элемент с любым содержимым. Игнорируется сервером ClickHouse.</comment>
|
<comment>Необязательный элемент с любым содержимым. Игнорируется сервером ClickHouse.</comment>
|
||||||
|
|
||||||
<!--Необязательный элемент, имя файла с подстановками-->
|
<!--Необязательный элемент, имя файла с подстановками-->
|
||||||
@ -42,7 +42,7 @@ ClickHouse:
|
|||||||
<dictionary>
|
<dictionary>
|
||||||
<!-- Конфигурация словаря -->
|
<!-- Конфигурация словаря -->
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
В одном файле можно [сконфигурировать](external-dicts-dict.md) произвольное количество словарей.
|
В одном файле можно [сконфигурировать](external-dicts-dict.md) произвольное количество словарей.
|
||||||
|
@ -53,7 +53,7 @@ dictGetOrNull('dict_name', attr_name, id_expr)
|
|||||||
Настройка внешнего словаря:
|
Настройка внешнего словаря:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>ext-dict-test</name>
|
<name>ext-dict-test</name>
|
||||||
<source>
|
<source>
|
||||||
@ -77,7 +77,7 @@ dictGetOrNull('dict_name', attr_name, id_expr)
|
|||||||
</structure>
|
</structure>
|
||||||
<lifetime>0</lifetime>
|
<lifetime>0</lifetime>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Выполним запрос:
|
Выполним запрос:
|
||||||
@ -113,7 +113,7 @@ LIMIT 3;
|
|||||||
Настройка внешнего словаря:
|
Настройка внешнего словаря:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>ext-dict-mult</name>
|
<name>ext-dict-mult</name>
|
||||||
<source>
|
<source>
|
||||||
@ -142,7 +142,7 @@ LIMIT 3;
|
|||||||
</structure>
|
</structure>
|
||||||
<lifetime>0</lifetime>
|
<lifetime>0</lifetime>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
Выполним запрос:
|
Выполним запрос:
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
ClickHouse支持多配置文件管理。主配置文件是`/etc/clickhouse-server/config.xml`。其余文件须在目录`/etc/clickhouse-server/config.d`。
|
ClickHouse支持多配置文件管理。主配置文件是`/etc/clickhouse-server/config.xml`。其余文件须在目录`/etc/clickhouse-server/config.d`。
|
||||||
|
|
||||||
!!! 注意:
|
!!! 注意:
|
||||||
所有配置文件必须是XML格式。此外,配置文件须有相同的跟元素,通常是`<yandex>`。
|
所有配置文件必须是XML格式。此外,配置文件须有相同的跟元素,通常是`<clickhouse>`。
|
||||||
|
|
||||||
主配置文件中的一些配置可以通过`replace`或`remove`属性被配置文件覆盖。
|
主配置文件中的一些配置可以通过`replace`或`remove`属性被配置文件覆盖。
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
|
|||||||
```
|
```
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<users>
|
<users>
|
||||||
<alice>
|
<alice>
|
||||||
<profile>analytics</profile>
|
<profile>analytics</profile>
|
||||||
@ -37,7 +37,7 @@ $ cat /etc/clickhouse-server/users.d/alice.xml
|
|||||||
<quota>analytics</quota>
|
<quota>analytics</quota>
|
||||||
</alice>
|
</alice>
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
对于每个配置文件,服务器还会在启动时生成 `file-preprocessed.xml` 文件。这些文件包含所有已完成的替换和复盖,并且它们旨在提供信息。如果zookeeper替换在配置文件中使用,但ZooKeeper在服务器启动时不可用,则服务器将从预处理的文件中加载配置。
|
对于每个配置文件,服务器还会在启动时生成 `file-preprocessed.xml` 文件。这些文件包含所有已完成的替换和复盖,并且它们旨在提供信息。如果zookeeper替换在配置文件中使用,但ZooKeeper在服务器启动时不可用,则服务器将从预处理的文件中加载配置。
|
||||||
|
@ -36,7 +36,7 @@ toc_title: "\u7CFB\u7EDF\u8868"
|
|||||||
配置定义的示例如下:
|
配置定义的示例如下:
|
||||||
|
|
||||||
```
|
```
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<query_log>
|
<query_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>query_log</table>
|
<table>query_log</table>
|
||||||
@ -47,7 +47,7 @@ toc_title: "\u7CFB\u7EDF\u8868"
|
|||||||
-->
|
-->
|
||||||
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
</query_log>
|
</query_log>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
默认情况下,表增长是无限的。可以通过TTL 删除过期日志记录的设置来控制表的大小。 你也可以使用分区功能 `MergeTree`-引擎表。
|
默认情况下,表增长是无限的。可以通过TTL 删除过期日志记录的设置来控制表的大小。 你也可以使用分区功能 `MergeTree`-引擎表。
|
||||||
|
@ -9,14 +9,14 @@ machine_translated_rev: 5decc73b5dc60054f19087d3690c4eb99446a6c3
|
|||||||
打开指标历史记录收集 `system.metric_log`,创建 `/etc/clickhouse-server/config.d/metric_log.xml` 具有以下内容:
|
打开指标历史记录收集 `system.metric_log`,创建 `/etc/clickhouse-server/config.d/metric_log.xml` 具有以下内容:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<metric_log>
|
<metric_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>metric_log</table>
|
<table>metric_log</table>
|
||||||
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
</metric_log>
|
</metric_log>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
**示例**
|
**示例**
|
||||||
|
@ -41,7 +41,7 @@ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --base-
|
|||||||
## Zookeeper.xml格式 {#format-of-zookeeper-xml}
|
## Zookeeper.xml格式 {#format-of-zookeeper-xml}
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<logger>
|
<logger>
|
||||||
<level>trace</level>
|
<level>trace</level>
|
||||||
<size>100M</size>
|
<size>100M</size>
|
||||||
@ -54,13 +54,13 @@ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --base-
|
|||||||
<port>2181</port>
|
<port>2181</port>
|
||||||
</node>
|
</node>
|
||||||
</zookeeper>
|
</zookeeper>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
## 复制任务的配置 {#configuration-of-copying-tasks}
|
## 复制任务的配置 {#configuration-of-copying-tasks}
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<!-- Configuration of clusters as in an ordinary server config -->
|
<!-- Configuration of clusters as in an ordinary server config -->
|
||||||
<remote_servers>
|
<remote_servers>
|
||||||
<source_cluster>
|
<source_cluster>
|
||||||
@ -163,7 +163,7 @@ clickhouse-copier --daemon --config zookeeper.xml --task-path /task/path --base-
|
|||||||
</table_visits>
|
</table_visits>
|
||||||
...
|
...
|
||||||
</tables>
|
</tables>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
`clickhouse-copier` 跟踪更改 `/task/path/description` 并在飞行中应用它们。 例如,如果你改变的值 `max_workers`,运行任务的进程数也会发生变化。
|
`clickhouse-copier` 跟踪更改 `/task/path/description` 并在飞行中应用它们。 例如,如果你改变的值 `max_workers`,运行任务的进程数也会发生变化。
|
||||||
|
@ -28,7 +28,7 @@ ClickHouse为字典中的错误生成异常。 错误示例:
|
|||||||
配置如下所示:
|
配置如下所示:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
...
|
...
|
||||||
<layout>
|
<layout>
|
||||||
@ -38,7 +38,7 @@ ClickHouse为字典中的错误生成异常。 错误示例:
|
|||||||
</layout>
|
</layout>
|
||||||
...
|
...
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
相应的 [DDL-查询](../../statements/create.md#create-dictionary-query):
|
相应的 [DDL-查询](../../statements/create.md#create-dictionary-query):
|
||||||
@ -208,7 +208,7 @@ dictGetT('dict_name', 'attr_name', id, date)
|
|||||||
配置示例:
|
配置示例:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
|
|
||||||
...
|
...
|
||||||
@ -237,7 +237,7 @@ dictGetT('dict_name', 'attr_name', id, date)
|
|||||||
</structure>
|
</structure>
|
||||||
|
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
或
|
或
|
||||||
|
@ -12,7 +12,7 @@ toc_title: "\u5916\u90E8\u5B57\u5178\u7684\u6765\u6E90"
|
|||||||
如果使用xml-file配置字典,则配置如下所示:
|
如果使用xml-file配置字典,则配置如下所示:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
...
|
...
|
||||||
<source>
|
<source>
|
||||||
@ -23,7 +23,7 @@ toc_title: "\u5916\u90E8\u5B57\u5178\u7684\u6765\u6E90"
|
|||||||
...
|
...
|
||||||
</dictionary>
|
</dictionary>
|
||||||
...
|
...
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
在情况下 [DDL-查询](../../statements/create.md#create-dictionary-query),相等的配置将看起来像:
|
在情况下 [DDL-查询](../../statements/create.md#create-dictionary-query),相等的配置将看起来像:
|
||||||
@ -272,7 +272,7 @@ $ sudo apt-get install -y unixodbc odbcinst odbc-postgresql
|
|||||||
ClickHouse中的字典配置:
|
ClickHouse中的字典配置:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>table_name</name>
|
<name>table_name</name>
|
||||||
<source>
|
<source>
|
||||||
@ -301,7 +301,7 @@ ClickHouse中的字典配置:
|
|||||||
</attribute>
|
</attribute>
|
||||||
</structure>
|
</structure>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
或
|
或
|
||||||
@ -367,7 +367,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
|
|||||||
在ClickHouse中配置字典:
|
在ClickHouse中配置字典:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionary>
|
<dictionary>
|
||||||
<name>test</name>
|
<name>test</name>
|
||||||
<source>
|
<source>
|
||||||
@ -397,7 +397,7 @@ $ sudo apt-get install tdsodbc freetds-bin sqsh
|
|||||||
</attribute>
|
</attribute>
|
||||||
</structure>
|
</structure>
|
||||||
</dictionary>
|
</dictionary>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
或
|
或
|
||||||
|
@ -28,7 +28,7 @@ ClickHouse:
|
|||||||
字典配置文件具有以下格式:
|
字典配置文件具有以下格式:
|
||||||
|
|
||||||
``` xml
|
``` xml
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<comment>An optional element with any content. Ignored by the ClickHouse server.</comment>
|
<comment>An optional element with any content. Ignored by the ClickHouse server.</comment>
|
||||||
|
|
||||||
<!--Optional element. File name with substitutions-->
|
<!--Optional element. File name with substitutions-->
|
||||||
@ -40,7 +40,7 @@ ClickHouse:
|
|||||||
<!-- There can be any number of <dictionary> sections in the configuration file. -->
|
<!-- There can be any number of <dictionary> sections in the configuration file. -->
|
||||||
</dictionary>
|
</dictionary>
|
||||||
|
|
||||||
</yandex>
|
</clickhouse>
|
||||||
```
|
```
|
||||||
|
|
||||||
你可以 [配置](external-dicts-dict.md) 同一文件中的任意数量的字典。
|
你可以 [配置](external-dicts-dict.md) 同一文件中的任意数量的字典。
|
||||||
|
@ -495,12 +495,12 @@ int mainEntryClickHouseInstall(int argc, char ** argv)
|
|||||||
{
|
{
|
||||||
std::string data_file = config_d / "data-paths.xml";
|
std::string data_file = config_d / "data-paths.xml";
|
||||||
WriteBufferFromFile out(data_file);
|
WriteBufferFromFile out(data_file);
|
||||||
out << "<yandex>\n"
|
out << "<clickhouse>\n"
|
||||||
" <path>" << data_path.string() << "</path>\n"
|
" <path>" << data_path.string() << "</path>\n"
|
||||||
" <tmp_path>" << (data_path / "tmp").string() << "</tmp_path>\n"
|
" <tmp_path>" << (data_path / "tmp").string() << "</tmp_path>\n"
|
||||||
" <user_files_path>" << (data_path / "user_files").string() << "</user_files_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"
|
" <format_schema_path>" << (data_path / "format_schemas").string() << "</format_schema_path>\n"
|
||||||
"</yandex>\n";
|
"</clickhouse>\n";
|
||||||
out.sync();
|
out.sync();
|
||||||
out.finalize();
|
out.finalize();
|
||||||
fmt::print("Data path configuration override is saved to file {}.\n", data_file);
|
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";
|
std::string logger_file = config_d / "logger.xml";
|
||||||
WriteBufferFromFile out(logger_file);
|
WriteBufferFromFile out(logger_file);
|
||||||
out << "<yandex>\n"
|
out << "<clickhouse>\n"
|
||||||
" <logger>\n"
|
" <logger>\n"
|
||||||
" <log>" << (log_path / "clickhouse-server.log").string() << "</log>\n"
|
" <log>" << (log_path / "clickhouse-server.log").string() << "</log>\n"
|
||||||
" <errorlog>" << (log_path / "clickhouse-server.err.log").string() << "</errorlog>\n"
|
" <errorlog>" << (log_path / "clickhouse-server.err.log").string() << "</errorlog>\n"
|
||||||
" </logger>\n"
|
" </logger>\n"
|
||||||
"</yandex>\n";
|
"</clickhouse>\n";
|
||||||
out.sync();
|
out.sync();
|
||||||
out.finalize();
|
out.finalize();
|
||||||
fmt::print("Log path configuration override is saved to file {}.\n", logger_file);
|
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";
|
std::string user_directories_file = config_d / "user-directories.xml";
|
||||||
WriteBufferFromFile out(user_directories_file);
|
WriteBufferFromFile out(user_directories_file);
|
||||||
out << "<yandex>\n"
|
out << "<clickhouse>\n"
|
||||||
" <user_directories>\n"
|
" <user_directories>\n"
|
||||||
" <local_directory>\n"
|
" <local_directory>\n"
|
||||||
" <path>" << (data_path / "access").string() << "</path>\n"
|
" <path>" << (data_path / "access").string() << "</path>\n"
|
||||||
" </local_directory>\n"
|
" </local_directory>\n"
|
||||||
" </user_directories>\n"
|
" </user_directories>\n"
|
||||||
"</yandex>\n";
|
"</clickhouse>\n";
|
||||||
out.sync();
|
out.sync();
|
||||||
out.finalize();
|
out.finalize();
|
||||||
fmt::print("User directory path configuration override is saved to file {}.\n", user_directories_file);
|
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";
|
std::string openssl_file = config_d / "openssl.xml";
|
||||||
WriteBufferFromFile out(openssl_file);
|
WriteBufferFromFile out(openssl_file);
|
||||||
out << "<yandex>\n"
|
out << "<clickhouse>\n"
|
||||||
" <openSSL>\n"
|
" <openSSL>\n"
|
||||||
" <server>\n"
|
" <server>\n"
|
||||||
" <certificateFile>" << (config_dir / "server.crt").string() << "</certificateFile>\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"
|
" <dhParamsFile>" << (config_dir / "dhparam.pem").string() << "</dhParamsFile>\n"
|
||||||
" </server>\n"
|
" </server>\n"
|
||||||
" </openSSL>\n"
|
" </openSSL>\n"
|
||||||
"</yandex>\n";
|
"</clickhouse>\n";
|
||||||
out.sync();
|
out.sync();
|
||||||
out.finalize();
|
out.finalize();
|
||||||
fmt::print("OpenSSL path configuration override is saved to file {}.\n", openssl_file);
|
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);
|
hash_hex.resize(64);
|
||||||
for (size_t i = 0; i < 32; ++i)
|
for (size_t i = 0; i < 32; ++i)
|
||||||
writeHexByteLowercase(hash[i], &hash_hex[2 * i]);
|
writeHexByteLowercase(hash[i], &hash_hex[2 * i]);
|
||||||
out << "<yandex>\n"
|
out << "<clickhouse>\n"
|
||||||
" <users>\n"
|
" <users>\n"
|
||||||
" <default>\n"
|
" <default>\n"
|
||||||
" <password remove='1' />\n"
|
" <password remove='1' />\n"
|
||||||
" <password_sha256_hex>" << hash_hex << "</password_sha256_hex>\n"
|
" <password_sha256_hex>" << hash_hex << "</password_sha256_hex>\n"
|
||||||
" </default>\n"
|
" </default>\n"
|
||||||
" </users>\n"
|
" </users>\n"
|
||||||
"</yandex>\n";
|
"</clickhouse>\n";
|
||||||
out.sync();
|
out.sync();
|
||||||
out.finalize();
|
out.finalize();
|
||||||
fmt::print(HILITE "Password for default user is saved in file {}." END_HILITE "\n", password_file);
|
fmt::print(HILITE "Password for default user is saved in file {}." END_HILITE "\n", password_file);
|
||||||
#else
|
#else
|
||||||
out << "<yandex>\n"
|
out << "<clickhouse>\n"
|
||||||
" <users>\n"
|
" <users>\n"
|
||||||
" <default>\n"
|
" <default>\n"
|
||||||
" <password><![CDATA[" << password << "]]></password>\n"
|
" <password><![CDATA[" << password << "]]></password>\n"
|
||||||
" </default>\n"
|
" </default>\n"
|
||||||
" </users>\n"
|
" </users>\n"
|
||||||
"</yandex>\n";
|
"</clickhouse>\n";
|
||||||
out.sync();
|
out.sync();
|
||||||
out.finalize();
|
out.finalize();
|
||||||
fmt::print(HILITE "Password for default user is saved in plaintext in file {}." END_HILITE "\n", password_file);
|
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";
|
std::string listen_file = config_d / "listen.xml";
|
||||||
WriteBufferFromFile out(listen_file);
|
WriteBufferFromFile out(listen_file);
|
||||||
out << "<yandex>\n"
|
out << "<clickhouse>\n"
|
||||||
" <listen_host>::</listen_host>\n"
|
" <listen_host>::</listen_host>\n"
|
||||||
"</yandex>\n";
|
"</clickhouse>\n";
|
||||||
out.sync();
|
out.sync();
|
||||||
out.finalize();
|
out.finalize();
|
||||||
fmt::print("The choice is saved in file {}.\n", listen_file);
|
fmt::print("The choice is saved in file {}.\n", listen_file);
|
||||||
|
@ -359,7 +359,7 @@ static ConfigurationPtr getConfigurationFromXMLString(const char * xml_data)
|
|||||||
void LocalServer::setupUsers()
|
void LocalServer::setupUsers()
|
||||||
{
|
{
|
||||||
static const char * minimal_default_user_xml =
|
static const char * minimal_default_user_xml =
|
||||||
"<yandex>"
|
"<clickhouse>"
|
||||||
" <profiles>"
|
" <profiles>"
|
||||||
" <default></default>"
|
" <default></default>"
|
||||||
" </profiles>"
|
" </profiles>"
|
||||||
@ -376,7 +376,7 @@ void LocalServer::setupUsers()
|
|||||||
" <quotas>"
|
" <quotas>"
|
||||||
" <default></default>"
|
" <default></default>"
|
||||||
" </quotas>"
|
" </quotas>"
|
||||||
"</yandex>";
|
"</clickhouse>";
|
||||||
|
|
||||||
ConfigurationPtr users_config;
|
ConfigurationPtr users_config;
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<listen_host>::</listen_host>
|
<listen_host>::</listen_host>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<https_port>8443</https_port>
|
<https_port>8443</https_port>
|
||||||
<tcp_port_secure>9440</tcp_port_secure>
|
<tcp_port_secure>9440</tcp_port_secure>
|
||||||
<openSSL>
|
<openSSL>
|
||||||
@ -6,4 +6,4 @@
|
|||||||
<dhParamsFile remove="remove"/>
|
<dhParamsFile remove="remove"/>
|
||||||
</server>
|
</server>
|
||||||
</openSSL>
|
</openSSL>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -11,14 +11,14 @@ TEST(Common, getMultipleValuesFromConfig)
|
|||||||
{
|
{
|
||||||
std::istringstream // STYLE_CHECK_ALLOW_STD_STRING_STREAM
|
std::istringstream // STYLE_CHECK_ALLOW_STD_STRING_STREAM
|
||||||
xml_isteam(R"END(<?xml version="1.0"?>
|
xml_isteam(R"END(<?xml version="1.0"?>
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<first_level>
|
<first_level>
|
||||||
<second_level>0</second_level>
|
<second_level>0</second_level>
|
||||||
<second_level>1</second_level>
|
<second_level>1</second_level>
|
||||||
<second_level>2</second_level>
|
<second_level>2</second_level>
|
||||||
<second_level>3</second_level>
|
<second_level>3</second_level>
|
||||||
</first_level>
|
</first_level>
|
||||||
</yandex>)END");
|
</clickhouse>)END");
|
||||||
|
|
||||||
Poco::AutoPtr<Poco::Util::XMLConfiguration> config = new Poco::Util::XMLConfiguration(xml_isteam);
|
Poco::AutoPtr<Poco::Util::XMLConfiguration> config = new Poco::Util::XMLConfiguration(xml_isteam);
|
||||||
std::vector<std::string> answer = getMultipleValuesFromConfig(*config, "first_level", "second_level");
|
std::vector<std::string> answer = getMultipleValuesFromConfig(*config, "first_level", "second_level");
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<profiles>
|
<profiles>
|
||||||
<default>
|
<default>
|
||||||
<max_untracked_memory>1Mi</max_untracked_memory>
|
<max_untracked_memory>1Mi</max_untracked_memory>
|
||||||
<memory_profiler_step>1Mi</memory_profiler_step>
|
<memory_profiler_step>1Mi</memory_profiler_step>
|
||||||
</default>
|
</default>
|
||||||
</profiles>
|
</profiles>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<yandex>
|
<clickhouse>
|
||||||
<dictionaries_config>/etc/clickhouse-server/dictionaries/*.xml</dictionaries_config>
|
<dictionaries_config>/etc/clickhouse-server/dictionaries/*.xml</dictionaries_config>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<timezone>Europe/Moscow</timezone>
|
<timezone>Europe/Moscow</timezone>
|
||||||
<listen_host>0.0.0.0</listen_host>
|
<listen_host>0.0.0.0</listen_host>
|
||||||
<custom_settings_prefixes>custom_</custom_settings_prefixes>
|
<custom_settings_prefixes>custom_</custom_settings_prefixes>
|
||||||
@ -17,4 +17,4 @@
|
|||||||
<stderr>/var/log/clickhouse-server/stderr.log</stderr>
|
<stderr>/var/log/clickhouse-server/stderr.log</stderr>
|
||||||
<stdout>/var/log/clickhouse-server/stdout.log</stdout>
|
<stdout>/var/log/clickhouse-server/stdout.log</stdout>
|
||||||
</logger>
|
</logger>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<users>
|
<users>
|
||||||
<default>
|
<default>
|
||||||
<access_management>1</access_management>
|
<access_management>1</access_management>
|
||||||
</default>
|
</default>
|
||||||
</users>
|
</users>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -760,7 +760,7 @@ class ClickHouseCluster:
|
|||||||
hostname=None, env_variables=None, image="clickhouse/integration-test", tag=None,
|
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,
|
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,
|
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.
|
"""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,
|
main_config_name="config.xml", users_config_name="users.xml", copy_common_configs=True,
|
||||||
hostname=None, env_variables=None,
|
hostname=None, env_variables=None,
|
||||||
image="clickhouse/integration-test", tag="latest",
|
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.name = name
|
||||||
self.base_cmd = cluster.base_cmd
|
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.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))
|
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")
|
logging.debug("Create directory for configuration generated in this helper")
|
||||||
# used by all utils with any config
|
# used by all utils with any config
|
||||||
conf_d_dir = p.abspath(p.join(instance_config_dir, 'conf.d'))
|
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):
|
def write_embedded_config(name, dest_dir, fix_log_level=False):
|
||||||
with open(p.join(HELPERS_DIR, name), 'r') as f:
|
with open(p.join(HELPERS_DIR, name), 'r') as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
data = data.replace('yandex', self.config_root_name)
|
data = data.replace('clickhouse', self.config_root_name)
|
||||||
if fix_log_level:
|
if fix_log_level:
|
||||||
data = data.replace('<level>test</level>', '<level>trace</level>')
|
data = data.replace('<level>test</level>', '<level>trace</level>')
|
||||||
with open(p.join(dest_dir, name), 'w') as r:
|
with open(p.join(dest_dir, name), 'w') as r:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<zookeeper>
|
<zookeeper>
|
||||||
<node index="1">
|
<node index="1">
|
||||||
<host>zoo1</host>
|
<host>zoo1</host>
|
||||||
@ -14,4 +14,4 @@
|
|||||||
</node>
|
</node>
|
||||||
<session_timeout_ms>3000</session_timeout_ms>
|
<session_timeout_ms>3000</session_timeout_ms>
|
||||||
</zookeeper>
|
</zookeeper>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -111,7 +111,7 @@ def test_backup_from_old_version_config(started_cluster):
|
|||||||
|
|
||||||
def callback(n):
|
def callback(n):
|
||||||
n.replace_config("/etc/clickhouse-server/merge_tree_settings.xml",
|
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)
|
node3.restart_with_latest_version(callback_onstop=callback)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<mqs>99999</mqs>
|
<mqs>99999</mqs>
|
||||||
|
|
||||||
<users_1>
|
<users_1>
|
||||||
@ -14,4 +14,4 @@
|
|||||||
<profile>default</profile>
|
<profile>default</profile>
|
||||||
</user_2>
|
</user_2>
|
||||||
</users_2>
|
</users_2>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<compression>
|
<compression>
|
||||||
<case>
|
<case>
|
||||||
<!-- Conditions. All must be satisfied simultaneously. Some conditions may not be specified. -->
|
<!-- Conditions. All must be satisfied simultaneously. Some conditions may not be specified. -->
|
||||||
@ -26,4 +26,4 @@
|
|||||||
</case>
|
</case>
|
||||||
|
|
||||||
</compression>
|
</compression>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<merge_tree>
|
<merge_tree>
|
||||||
<min_rows_for_wide_part>0</min_rows_for_wide_part>
|
<min_rows_for_wide_part>0</min_rows_for_wide_part>
|
||||||
<min_bytes_for_wide_part>0</min_bytes_for_wide_part>
|
<min_bytes_for_wide_part>0</min_bytes_for_wide_part>
|
||||||
</merge_tree>
|
</merge_tree>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -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))
|
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>
|
<dictionaries_config>/etc/clickhouse-server/dictionaries/{dictionaries_config}</dictionaries_config>
|
||||||
</yandex>'''
|
</clickhouse>'''
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<remote_servers>
|
<remote_servers>
|
||||||
<test_cluster>
|
<test_cluster>
|
||||||
<shard>
|
<shard>
|
||||||
@ -15,4 +15,4 @@
|
|||||||
</shard>
|
</shard>
|
||||||
</test_cluster>
|
</test_cluster>
|
||||||
</remote_servers>
|
</remote_servers>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -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))
|
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>
|
<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")
|
@pytest.fixture(scope="module")
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<logger>
|
<logger>
|
||||||
<level>trace</level>
|
<level>trace</level>
|
||||||
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
|
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
|
||||||
</logger>
|
</logger>
|
||||||
</yandex>
|
</clickhouse>
|
@ -6,12 +6,12 @@ from helpers.cluster import ClickHouseCluster
|
|||||||
cluster = ClickHouseCluster(__file__, name="log_quries_probability")
|
cluster = ClickHouseCluster(__file__, name="log_quries_probability")
|
||||||
node = cluster.add_instance('node', with_zookeeper=False)
|
node = cluster.add_instance('node', with_zookeeper=False)
|
||||||
|
|
||||||
config = '''<yandex>
|
config = '''<clickhouse>
|
||||||
<logger>
|
<logger>
|
||||||
<level>information</level>
|
<level>information</level>
|
||||||
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
|
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
|
||||||
</logger>
|
</logger>
|
||||||
</yandex>'''
|
</clickhouse>'''
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<remote_servers>
|
<remote_servers>
|
||||||
<test_cluster>
|
<test_cluster>
|
||||||
<shard>
|
<shard>
|
||||||
@ -10,4 +10,4 @@
|
|||||||
</shard>
|
</shard>
|
||||||
</test_cluster>
|
</test_cluster>
|
||||||
</remote_servers>
|
</remote_servers>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<profiles>
|
<profiles>
|
||||||
<default>
|
<default>
|
||||||
<optimize_trivial_count_query>0</optimize_trivial_count_query>
|
<optimize_trivial_count_query>0</optimize_trivial_count_query>
|
||||||
</default>
|
</default>
|
||||||
</profiles>
|
</profiles>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<remote_servers>
|
<remote_servers>
|
||||||
<test_cluster>
|
<test_cluster>
|
||||||
<shard>
|
<shard>
|
||||||
@ -15,4 +15,4 @@
|
|||||||
</shard>
|
</shard>
|
||||||
</test_cluster>
|
</test_cluster>
|
||||||
</remote_servers>
|
</remote_servers>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<yandex>
|
<clickhouse>
|
||||||
<macros>
|
<macros>
|
||||||
<rabbitmq_host>rabbitmq1</rabbitmq_host>
|
<rabbitmq_host>rabbitmq1</rabbitmq_host>
|
||||||
<rabbitmq_port>5672</rabbitmq_port>
|
<rabbitmq_port>5672</rabbitmq_port>
|
||||||
<rabbitmq_exchange_name>macro</rabbitmq_exchange_name>
|
<rabbitmq_exchange_name>macro</rabbitmq_exchange_name>
|
||||||
<rabbitmq_format>JSONEachRow</rabbitmq_format>
|
<rabbitmq_format>JSONEachRow</rabbitmq_format>
|
||||||
</macros>
|
</macros>
|
||||||
</yandex>
|
</clickhouse>
|
||||||
|
Loading…
Reference in New Issue
Block a user