Doc fixups

This commit is contained in:
Robert Schulze 2024-03-13 15:13:17 +00:00
parent 9338b681ef
commit ce665eae30
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
3 changed files with 7 additions and 6 deletions

View File

@ -95,9 +95,11 @@ which is equal to
## Substituting Configuration {#substitution} ## Substituting Configuration {#substitution}
The config can also define “substitutions”. If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](../operations/server-configuration-parameters/settings.md#server_configuration_parameters-include_from) element in the server config. The substitution values are specified in `/clickhouse/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros](../operations/server-configuration-parameters/settings.md#macros)). The config can define substitutions. There are two types of substitutions:
If you want to replace an entire element with a substitution use `include` as the element name. - If an element has the `incl` attribute, the corresponding substitution from the file will be used as the value. By default, the path to the file with substitutions is `/etc/metrika.xml`. This can be changed in the [include_from](../operations/server-configuration-parameters/settings.md#server_configuration_parameters-include_from) element in the server config. The substitution values are specified in `/clickhouse/substitution_name` elements in this file. If a substitution specified in `incl` does not exist, it is recorded in the log. To prevent ClickHouse from logging missing substitutions, specify the `optional="true"` attribute (for example, settings for [macros](../operations/server-configuration-parameters/settings.md#macros)).
- If you want to replace an entire element with a substitution, use `include` as the element name. Substitutions can also be performed from ZooKeeper by specifying attribute `from_zk = "/path/to/node"`. In this case, the element value is replaced with the contents of the Zookeeper node at `/path/to/node`. This also works with you store an entire XML subtree as a Zookeeper node, it will be fully inserted into the source element.
XML substitution example: XML substitution example:
@ -114,9 +116,7 @@ XML substitution example:
</clickhouse> </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. If you want to merge the substituting content with the existing configuration instead of appending you can use attribute `merge="true"`, for example: `<include from_zk="/some_path" merge="true">`. In this case, the existing configuration will be merged with the content from the substitution and the existing configuration settings will be replaced with values from substitution.
If you want to merge substitution content with existing configuration instead of append you can use attribute `merge="true`, for example: `<include from_zk="/some_path" merge="true">`. In this case existing configuration will be merged with content from substitution and existing configuration settings will be replaced with values from substitution.
## Encrypting and Hiding Configuration {#encryption} ## Encrypting and Hiding Configuration {#encryption}

View File

@ -910,7 +910,7 @@ try
/// We need to reload server settings because config could be updated via zookeeper. /// We need to reload server settings because config could be updated via zookeeper.
server_settings.loadSettingsFromConfig(config()); server_settings.loadSettingsFromConfig(config());
/// NOTE: Do sanity checks after we loaded all possible substitutions from ZK /// NOTE: Do sanity checks after we loaded all possible substitutions (for the configuration) from ZK
sanityChecks(*this); sanityChecks(*this);
#if defined(OS_LINUX) #if defined(OS_LINUX)

View File

@ -427,6 +427,7 @@ void ConfigProcessor::doIncludesRecursive(
/// Replace the original contents, not add to it. /// Replace the original contents, not add to it.
bool replace = attributes->getNamedItem("replace"); bool replace = attributes->getNamedItem("replace");
/// Merge with the original contents
bool merge = attributes->getNamedItem("merge"); bool merge = attributes->getNamedItem("merge");
bool included_something = false; bool included_something = false;