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

Commit d5f2b4a

Browse files
Merge pull request #25 from wiktor2200/master
Update config template with new official config.xml.
2 parents c06b196 + 3edba7b commit d5f2b4a

File tree

2 files changed

+70
-24
lines changed

2 files changed

+70
-24
lines changed

defaults/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ clickhouse_http_port: 8123
3232

3333
clickhouse_tcp_port: 9000
3434

35+
clickhouse_https_port: 8443
36+
clickhouse_tcp_secure_port: 9440
37+
3538
clickhouse_interserver_http: 9009
3639

3740
clickhouse_networks_default:
@@ -80,3 +83,5 @@ clickhouse_config:
8083
clickhouse_dicts: []
8184

8285
clickhouse_path_user_files: /var/lib/clickhouse/user_files/
86+
87+
clickhouse_mlock_status: false

templates/config.j2

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,26 @@
22
<!-- {{ ansible_managed }} -->
33
<yandex>
44
<logger>
5+
<!-- Possible levels: https://github.com/pocoproject/poco/blob/develop/Foundation/include/Poco/Logger.h#L105 -->
56
<level>{{ clickhouse_logger.level }}</level>
67
<log>{{ clickhouse_logger.log }}</log>
78
<errorlog>{{ clickhouse_logger.errorlog }}</errorlog>
89
<size>{{ clickhouse_logger.size }}</size>
910
<count>{{ clickhouse_logger.count }}</count>
1011
</logger>
1112

12-
1313
<http_port>{{ clickhouse_http_port }}</http_port>
14+
<tcp_port>{{ clickhouse_tcp_port }}</tcp_port>
1415

16+
<!-- For HTTPS and SSL over native protocol. -->
1517
<!--
16-
<https_port>8443</https_port>
18+
<https_port>{{ clickhouse_https_port }}</https_port>
19+
<tcp_port_secure>{{ clickhouse_tcp_secure_port }}</tcp_port_secure>
1720
-->
18-
<!-- Used only with https_port. Full ssl options list: https://github.com/yandex/ClickHouse/blob/master/contrib/libpoco/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h#L71 -->
21+
22+
<!-- Used with https_port and tcp_port_secure. Full ssl options list: https://github.com/ClickHouse-Extras/poco/blob/master/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h#L71 -->
1923
<openSSL>
20-
<server>
24+
<server> <!-- Used for https server AND secure tcp port -->
2125
<!-- openssl req -subj "/CN=localhost" -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /etc/clickhouse-server/server.key -out /etc/clickhouse-server/server.crt -->
2226
<certificateFile>/etc/clickhouse-server/server.crt</certificateFile>
2327
<privateKeyFile>/etc/clickhouse-server/server.key</privateKeyFile>
@@ -29,7 +33,8 @@
2933
<disableProtocols>sslv2,sslv3</disableProtocols>
3034
<preferServerCiphers>true</preferServerCiphers>
3135
</server>
32-
<client>
36+
37+
<client> <!-- Used for connecting to https dictionary source -->
3338
<loadDefaultCAFile>true</loadDefaultCAFile>
3439
<cacheSessions>true</cacheSessions>
3540
<disableProtocols>sslv2,sslv3</disableProtocols>
@@ -47,8 +52,6 @@
4752
<http_server_default_response><![CDATA[<html ng-app="SMI2"><head><base href="http://ui.tabix.io/"></head><body><div ui-view="" class="content-ui"></div><script src="http://loader.tabix.io/master.js"></script></body></html>]]></http_server_default_response>
4853
-->
4954

50-
<tcp_port>{{ clickhouse_tcp_port }}</tcp_port>
51-
5255
<!-- Port for communication between replicas. Used for data exchange. -->
5356
<interserver_http_port>{{ clickhouse_interserver_http }}</interserver_http_port>
5457

@@ -62,8 +65,11 @@
6265
{% if clickhouse_interserver_http_host is defined %}
6366
<interserver_http_host>{{ clickhouse_interserver_http_host }}</interserver_http_host>
6467
{% endif %}
68+
6569
<!-- Listen specified host. use :: (wildcard IPv6 address), if you want to accept connections both with IPv4 and IPv6 from everywhere. -->
6670
<!-- <listen_host>::</listen_host> -->
71+
<!-- Same for hosts with disabled ipv6: -->
72+
<!-- <listen_host>0.0.0.0</listen_host> -->
6773
{% for host in clickhouse_listen_host %}
6874
<listen_host>{{ host }}</listen_host>
6975
{% endfor %}
@@ -97,14 +103,19 @@
97103

98104
<!-- Path to temporary data for processing hard queries. -->
99105
<tmp_path>{{ clickhouse_path_tmp }}</tmp_path>
100-
106+
107+
<!-- Directory with user provided files that are accessible by 'file' table function. -->
101108
<user_files_path>{{ clickhouse_path_user_files }}</user_files_path>
109+
102110
<!-- Path to configuration file with users, access rights, profiles of settings, quotas. -->
103111
<users_config>users.xml</users_config>
104112

105-
<!-- Default profile of settings.. -->
113+
<!-- Default profile of settings. -->
106114
<default_profile>default</default_profile>
107115

116+
<!-- System profile of settings. This settings are used by internal processes (Buffer storage, Distibuted DDL worker and so on). -->
117+
<!-- <system_profile>default</system_profile> -->
118+
108119
<!-- Default database. -->
109120
<default_database>default</default_database>
110121

@@ -127,8 +138,14 @@
127138
-->
128139
<!-- <umask>022</umask> -->
129140

141+
<!-- Perform mlockall after startup to lower first queries latency
142+
and to prevent clickhouse executable from being paged out under high IO load.
143+
Enabling this option is recommended but will lead to increased startup time for up to a few seconds.
144+
-->
145+
<mlock_executable>{{ clickhouse_mlock_status }}</mlock_executable>
146+
130147
<!-- Configuration of clusters that could be used in Distributed tables.
131-
https://clickhouse.yandex/reference_en.html#Distributed
148+
https://clickhouse.yandex/docs/en/table_engines/distributed/
132149
-->
133150
<remote_servers incl="clickhouse_remote_servers" />
134151

@@ -141,14 +158,14 @@
141158
<!-- ZooKeeper is used to store metadata about replicas, when using Replicated tables.
142159
Optional. If you don't use replicated tables, you could omit that.
143160
144-
See https://clickhouse.yandex/reference_en.html#Data%20replication
161+
See https://clickhouse.yandex/docs/en/table_engines/replication/
145162
-->
146163
<zookeeper incl="zookeeper-servers" optional="true" />
147164

148165
<!-- Substitutions for parameters of replicated tables.
149166
Optional. If you don't use replicated tables, you could omit that.
150167
151-
See https://clickhouse.yandex/reference_en.html#Creating%20replicated%20tables
168+
See https://clickhouse.yandex/docs/en/table_engines/replication/#creating-replicated-tables
152169
-->
153170
<macros incl="macros" optional="true" />
154171

@@ -167,6 +184,7 @@
167184
<!--
168185
interval - send every X second
169186
root_path - prefix for keys
187+
hostname_in_path - append hostname to root_path (default = true)
170188
metrics - send data from table system.metrics
171189
events - send data from table system.events
172190
asynchronous_metrics - send data from table system.asynchronous_metrics
@@ -178,6 +196,7 @@
178196
<timeout>0.1</timeout>
179197
<interval>60</interval>
180198
<root_path>one_min</root_path>
199+
<hostname_in_path>true</hostname_in_path>
181200
182201
<metrics>true</metrics>
183202
<events>true</events>
@@ -205,24 +224,40 @@
205224
-->
206225
<database>system</database>
207226
<table>query_log</table>
227+
<!--
228+
PARTITION BY expr https://clickhouse.yandex/docs/en/table_engines/custom_partitioning_key/
229+
Example:
230+
event_date
231+
toMonday(event_date)
232+
toYYYYMM(event_date)
233+
toStartOfHour(event_time)
234+
-->
208235
<partition_by>toYYYYMM(event_date)</partition_by>
209236
<!-- Interval of flushing data. -->
210237
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
211238
</query_log>
212239

240+
<!-- Query thread log. Has information about all threads participated in query execution.
241+
Used only for queries with setting log_query_threads = 1. -->
242+
<query_thread_log>
243+
<database>system</database>
244+
<table>query_thread_log</table>
245+
<partition_by>toYYYYMM(event_date)</partition_by>
246+
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
247+
</query_thread_log>
213248

214-
<!-- Uncomment if use part_log
249+
<!-- Uncomment if use part log.
250+
Part log contains information about all actions with parts in MergeTree tables (creation, deletion, merges, downloads).
215251
<part_log>
216252
<database>system</database>
217253
<table>part_log</table>
218-
219254
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
220255
</part_log>
221256
-->
222257

223258

224259
<!-- Parameters for embedded dictionaries, used in Yandex.Metrica.
225-
See https://clickhouse.yandex/reference_en.html#Internal%20dictionaries
260+
See https://clickhouse.yandex/docs/en/dicts/internal_dicts/
226261
-->
227262

228263
<!-- Path to file with region hierarchy. -->
@@ -233,7 +268,7 @@
233268

234269

235270
<!-- Configuration of external dictionaries. See:
236-
https://clickhouse.yandex/reference_en.html#External%20Dictionaries
271+
https://clickhouse.yandex/docs/en/dicts/external_dicts/
237272
-->
238273
<dictionaries_config>*_dictionary.xml</dictionaries_config>
239274

@@ -247,23 +282,22 @@
247282
248283
<!- - Conditions. All must be satisfied. Some conditions may be omitted. - ->
249284
<min_part_size>10000000000</min_part_size> <!- - Min part size in bytes. - ->
250-
<min_part_size_ratio>0.01</min_part_size_ratio> <!- - Min size of part relative to whole table size. - ->
285+
<min_part_size_ratio>0.01</min_part_size_ratio> <!- - Min size of part relative to whole table size. - ->
251286
252287
<!- - What compression method to use. - ->
253-
<method>zstd</method> <!- - Keep in mind that zstd compression library is highly experimental. - ->
288+
<method>zstd</method>
254289
</case>
255290
-->
256291
</compression>
257292

258-
<resharding>
259-
<task_queue_path>/clickhouse/task_queue</task_queue_path>
260-
</resharding>
261-
262293
<!-- Allow to execute distributed DDL queries (CREATE, DROP, ALTER, RENAME) on cluster.
263294
Works only if ZooKeeper is enabled. Comment it if such functionality isn't required. -->
264295
<distributed_ddl>
265296
<!-- Path in ZooKeeper to queue with DDL queries -->
266297
<path>/clickhouse/task_queue/ddl</path>
298+
299+
<!-- Settings from this profile will be used to execute DDL queries -->
300+
<!-- <profile>default</profile> -->
267301
</distributed_ddl>
268302

269303
<!-- Settings to fine tune MergeTree tables. See documentation in source code, in MergeTreeSettings.h -->
@@ -276,10 +310,12 @@
276310
<!-- Protection from accidental DROP.
277311
If size of a MergeTree table is greater than max_table_size_to_drop (in bytes) than table could not be dropped with any DROP query.
278312
If you want do delete one table and don't want to restart clickhouse-server, you could create special file <clickhouse-path>/flags/force_drop_table and make DROP once.
279-
By default max_table_size_to_drop is 50GB, max_table_size_to_drop=0 allows to DROP any tables.
313+
By default max_table_size_to_drop is 50GB; max_table_size_to_drop=0 allows to DROP any tables.
314+
The same for max_partition_size_to_drop.
280315
Uncomment to disable protection.
281316
-->
282317
<!-- <max_table_size_to_drop>0</max_table_size_to_drop> -->
318+
<!-- <max_partition_size_to_drop>0</max_partition_size_to_drop> -->
283319

284320
<!-- Example of parameters for GraphiteMergeTree table engine -->
285321
<graphite_rollup_example>
@@ -312,6 +348,11 @@
312348
</default>
313349
</graphite_rollup_example>
314350

315-
<format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
351+
<!-- Directory in <clickhouse-path> containing schema files for various input formats.
352+
The directory will be created if it doesn't exist.
353+
-->
354+
<format_schema_path>{{ clickhouse_path_data }}/format_schemas/</format_schema_path>
316355

356+
<!-- Uncomment to disable ClickHouse internal DNS caching. -->
357+
<!-- <disable_internal_dns_cache>1</disable_internal_dns_cache> -->
317358
</yandex>

0 commit comments

Comments
 (0)