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.
config.xml file can specify a separate config with user settings, profiles, and quotas. The relative path to this config is set in the
users_config element. By default, it is
users_config is omitted, the user settings, profiles, and quotas are specified directly in
Users configuration can be splitted into separate files similar to
Directory name is defined as
users_config setting without
.xml postfix concatenated with
users.d is used by default, as
users_config defaults to
For example, you can have separate config file for each user like this:
$ cat /etc/clickhouse-server/users.d/alice.xml
<yandex> <users> <alice> <profile>analytics</profile> <networks> <ip>::/0</ip> </networks> <password_sha256_hex>...</password_sha256_hex> <quota>analytics</quota> </alice> </users> </yandex>
For each config file, the server also generates
file-preprocessed.xml files when starting. These files contain all the completed substitutions and overrides, and they are intended for informational use. If ZooKeeper substitutions were used in the config files but ZooKeeper is not available on the server start, the server loads the configuration from the preprocessed file.
The server tracks changes in config files, as well as files and ZooKeeper nodes that were used when performing substitutions and overrides, and reloads the settings for users and clusters on the fly. This means that you can modify the cluster, users, and their settings without restarting the server.