Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Consider overriding configuration instead of replacing the default ones #70

Closed
AntonFriberg opened this issue Jan 10, 2022 · 0 comments
Closed

Comments

@AntonFriberg
Copy link
Contributor

Hi!

According to the ClickHouse Tutorial and recommendation from users in the Telegram channel, one should not replace the default configuration but instead override the config by placing them under config.d directory or users.d instead.

If you want to adjust the configuration, it’s not handy to directly edit config.xml file, considering it might get rewritten on future package updates. The recommended way to override the config elements is to create files in config.d directory which serve as “patches” to config.xml.

https://clickhouse.com/docs/en/getting-started/tutorial/#clickhouse-tutorial

The resulting configuration of all system settings and user settings can be seen in /var/lib/clickhouse/preprocessed_configs/config.xml and /var/lib/clickhouse/preprocessed_configs/users.xml which is useful during debugging.

I tried making a small change in https://github.com/AlexeySetevoi/ansible-clickhouse/blob/master/tasks/configure/sys.yml that seems to work as expected.

 - name: Config | Generate system config
   template:
     src: config.j2
-     dest: "{{ clickhouse_path_configdir }}/config.xml"
+     dest: "{{ clickhouse_path_configdir }}/config.d/config.xml"
 - name: Config | Generate users config
   template:
     src: users.j2
-     dest: "{{ clickhouse_path_configdir }}/users.xml"
+     dest: "{{ clickhouse_path_configdir }}/users.d/users.xml"

Additionally, I think it is better if we move the conf.d configuration to config.d since then it will not be included in /var/lib/clickhouse/preprocessed_configs/users.xml and only in /var/lib/clickhouse/preprocessed_configs/config.xml

I could provide a PR with the changes so that you can try it if you want?

AntonFriberg added a commit to AntonFriberg/ansible-clickhouse that referenced this issue Jan 10, 2022
Solves AlexeySetevoi#70

Change-Id: I2229aed59c09b426e8f1d33d214aa7e1dc3f0c22
AntonFriberg added a commit to AntonFriberg/ansible-clickhouse that referenced this issue Jan 10, 2022
Solves AlexeySetevoi#70

Change-Id: I2229aed59c09b426e8f1d33d214aa7e1dc3f0c22
AntonFriberg added a commit to AntonFriberg/ansible-clickhouse that referenced this issue Jan 11, 2022
Solves AlexeySetevoi#70

Change-Id: I2229aed59c09b426e8f1d33d214aa7e1dc3f0c22
AlexeySetevoi pushed a commit that referenced this issue Jan 12, 2022
* Change to override instead of replace for user config

Solves #70

Change-Id: I2229aed59c09b426e8f1d33d214aa7e1dc3f0c22

* Fix paths and config_files in molecule tests

Change-Id: I7b6198fe4e1fb5ad055fe7f67e3d253449e5be17
AntonFriberg added a commit to AntonFriberg/ansible-clickhouse that referenced this issue Mar 25, 2022
…Setevoi#72)

* Change to override instead of replace for user config

Solves AlexeySetevoi#70

Change-Id: I2229aed59c09b426e8f1d33d214aa7e1dc3f0c22

* Fix paths and config_files in molecule tests

Change-Id: I7b6198fe4e1fb5ad055fe7f67e3d253449e5be17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant