From e31c54878e019c1dda96b599ada8a5f1ca0c99d3 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Wed, 15 May 2024 09:34:08 +0200 Subject: [PATCH] Improve documentation for from_env and from_zk - Add a new paragraph to make it possible to find - Add documentation for default values when using these attributes --- docs/en/operations/configuration-files.md | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/docs/en/operations/configuration-files.md b/docs/en/operations/configuration-files.md index 089704705d0..0675e0edcb6 100644 --- a/docs/en/operations/configuration-files.md +++ b/docs/en/operations/configuration-files.md @@ -67,6 +67,8 @@ generates merged configuration file: ``` +### Using from_env and from_zk + To specify that a value of an element should be replaced by the value of an environment variable, you can use attribute `from_env`. Example with `$MAX_QUERY_SIZE = 150000`: @@ -93,6 +95,59 @@ which is equal to ``` +The same is possible using `from_zk`: + +``` xml + + + +``` + +``` +# clickhouse-keeper-client +/ :) touch /zk_configs +/ :) create /zk_configs/postgresql_port "9005" +/ :) get /zk_configs/postgresql_port +9005 +``` + +which is equal to + + +``` xml + + 9005 + +``` + +#### Default values for from_env and from_zk attributes + +It's possible to set the default value and substitute it only if the environment variable or zookeeper node is set using `replace="1"`. + +With previous example, but `MAX_QUERY_SIZE` is unset: + +``` xml + + + + 150000 + + + +``` + +will take the default value + +``` xml + + + + 150000 + + + +``` + ## Substituting Configuration {#substitution} The config can define substitutions. There are two types of substitutions: