· 4 years ago · Nov 18, 2020, 10:10 AM
1<!-- This file was generated automatically.
2 Do not edit it: it is likely to be discarded and generated again before it's read next time.
3 Files used to generate this file:
4 /etc/clickhouse-server/config.xml
5 /etc/clickhouse-server/conf.d/chop-generated-macros.xml
6 /etc/clickhouse-server/conf.d/chop-generated-zookeeper.xml
7 /etc/clickhouse-server/config.d/01-clickhouse-listen.xml
8 /etc/clickhouse-server/config.d/02-clickhouse-logger.xml
9 /etc/clickhouse-server/config.d/03-clickhouse-querylog.xml
10 /etc/clickhouse-server/config.d/chop-generated-remote_servers.xml
11 /etc/clickhouse-server/config.d/chop-generated-settings.xml -->
12
13<!--
14 NOTE: User and query level settings are set up in "users.xml" file.
15 If you have accidentally specified user-level settings here, server won't start.
16 You can either move the settings to the right place inside "users.xml" file
17 or add <skip_check_for_incorrect_settings>1</skip_check_for_incorrect_settings> here.
18--><yandex>
19 <logger>
20 <!-- Possible levels: https://github.com/pocoproject/poco/blob/poco-1.9.4-release/Foundation/include/Poco/Logger.h#L105 -->
21 <level>information</level>
22 <log>/var/log/clickhouse-server/clickhouse-server.log</log>
23 <errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
24 <size>1000M</size>
25 <count>10</count>
26 <!-- <console>1</console> --> <!-- Default behavior is autodetection (log to console if not daemon mode and is tty) -->
27
28 <!-- Per level overrides (legacy):
29
30 For example to suppress logging of the ConfigReloader you can use:
31 NOTE: levels.logger is reserved, see below.
32 -->
33 <!--
34 <levels>
35 <ConfigReloader>none</ConfigReloader>
36 </levels>
37 -->
38
39 <!-- Per level overrides:
40
41 For example to suppress logging of the RBAC for default user you can use:
42 (But please note that the logger name maybe changed from version to version, even after minor upgrade)
43 -->
44 <!--
45 <levels>
46 <logger>
47 <name>ContextAccess (default)</name>
48 <level>none</level>
49 </logger>
50 <logger>
51 <name>DatabaseOrdinary (test)</name>
52 <level>none</level>
53 </logger>
54 </levels>
55 -->
56
57 <!-- Possible levels: https://github.com/pocoproject/poco/blob/develop/Foundation/include/Poco/Logger.h#L105 -->
58
59
60
61
62
63 <!-- Default behavior is autodetection (log to console if not daemon mode and is tty) -->
64 <console>1</console>
65
66
67 </logger>
68
69 <send_crash_reports>
70 <!-- Changing <enabled> to true allows sending crash reports to -->
71 <!-- the ClickHouse core developers team via Sentry https://sentry.io -->
72 <!-- Doing so at least in pre-production environments is highly appreciated -->
73 <enabled>false</enabled>
74 <!-- Change <anonymize> to true if you don't feel comfortable attaching the server hostname to the crash report -->
75 <anonymize>false</anonymize>
76 <!-- Default endpoint should be changed to different Sentry DSN only if you have -->
77 <!-- some in-house engineers or hired consultants who're going to debug ClickHouse issues for you -->
78 <endpoint>https://6f33034cfe684dd7a3ab9875e57b1c8d@o388870.ingest.sentry.io/5226277</endpoint>
79 </send_crash_reports>
80
81 <!--display_name>production</display_name--> <!-- It is the name that will be shown in the client -->
82 <http_port>8123</http_port>
83 <tcp_port>9000</tcp_port>
84 <mysql_port>9004</mysql_port>
85 <!-- For HTTPS and SSL over native protocol. -->
86 <!--
87 <https_port>8443</https_port>
88 <tcp_port_secure>9440</tcp_port_secure>
89 -->
90 <!-- 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 -->
91 <openSSL>
92 <server> <!-- Used for https server AND secure tcp port -->
93 <!-- 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 -->
94 <certificateFile>/etc/clickhouse-server/server.crt</certificateFile>
95 <privateKeyFile>/etc/clickhouse-server/server.key</privateKeyFile>
96 <!-- openssl dhparam -out /etc/clickhouse-server/dhparam.pem 4096 -->
97 <dhParamsFile>/etc/clickhouse-server/dhparam.pem</dhParamsFile>
98 <verificationMode>none</verificationMode>
99 <loadDefaultCAFile>true</loadDefaultCAFile>
100 <cacheSessions>true</cacheSessions>
101 <disableProtocols>sslv2,sslv3</disableProtocols>
102 <preferServerCiphers>true</preferServerCiphers>
103 </server>
104
105 <client> <!-- Used for connecting to https dictionary source and secured Zookeeper communication -->
106 <loadDefaultCAFile>true</loadDefaultCAFile>
107 <cacheSessions>true</cacheSessions>
108 <disableProtocols>sslv2,sslv3</disableProtocols>
109 <preferServerCiphers>true</preferServerCiphers>
110 <!-- Use for self-signed: <verificationMode>none</verificationMode> -->
111 <invalidCertificateHandler>
112 <!-- Use for self-signed: <name>AcceptCertificateHandler</name> -->
113 <name>RejectCertificateHandler</name>
114 </invalidCertificateHandler>
115 </client>
116 </openSSL>
117
118 <!-- Default root page on http[s] server. For example load UI from https://tabix.io/ when opening http://localhost:8123 -->
119 <!--
120 <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>
121 -->
122
123 <!-- Port for communication between replicas. Used for data exchange. -->
124 <interserver_http_port>9009</interserver_http_port>
125
126 <!-- Hostname that is used by other replicas to request this server.
127 If not specified, than it is determined analogous to 'hostname -f' command.
128 This setting could be used to switch replication to another network interface.
129 -->
130 <!--
131 <interserver_http_host>example.yandex.ru</interserver_http_host>
132 -->
133
134 <!-- Listen specified host. use :: (wildcard IPv6 address), if you want to accept connections both with IPv4 and IPv6 from everywhere. -->
135 <!-- <listen_host>::</listen_host> -->
136 <!-- Same for hosts with disabled ipv6: -->
137 <!-- <listen_host>0.0.0.0</listen_host> -->
138
139 <!-- Default values - try listen localhost on ipv4 and ipv6: -->
140 <!--
141 <listen_host>::1</listen_host>
142 <listen_host>127.0.0.1</listen_host>
143 -->
144 <!-- Don't exit if ipv6 or ipv4 unavailable, but listen_host with this protocol specified -->
145 <!-- <listen_try>0</listen_try> -->
146
147 <!-- Allow listen on same address:port -->
148 <!-- <listen_reuse_port>0</listen_reuse_port> -->
149
150 <!-- <listen_backlog>64</listen_backlog> -->
151
152 <max_connections>4096</max_connections>
153 <keep_alive_timeout>3</keep_alive_timeout>
154
155 <!-- Maximum number of concurrent queries. -->
156 <max_concurrent_queries>100</max_concurrent_queries>
157
158 <!-- Maximum memory usage (resident set size) for server process.
159 Zero value or unset means default. Default is "max_server_memory_usage_to_ram_ratio" of available physical RAM.
160 If the value is larger than "max_server_memory_usage_to_ram_ratio" of available physical RAM, it will be cut down.
161
162 The constraint is checked on query execution time.
163 If a query tries to allocate memory and the current memory usage plus allocation is greater
164 than specified threshold, exception will be thrown.
165
166 It is not practical to set this constraint to small values like just a few gigabytes,
167 because memory allocator will keep this amount of memory in caches and the server will deny service of queries.
168 -->
169 <max_server_memory_usage>0</max_server_memory_usage>
170
171 <!-- Maximum number of threads in the Global thread pool.
172 This will default to a maximum of 10000 threads if not specified.
173 This setting will be useful in scenarios where there are a large number
174 of distributed queries that are running concurrently but are idling most
175 of the time, in which case a higher number of threads might be required.
176 -->
177
178 <max_thread_pool_size>10000</max_thread_pool_size>
179
180 <!-- On memory constrained environments you may have to set this to value larger than 1.
181 -->
182 <max_server_memory_usage_to_ram_ratio>0.9</max_server_memory_usage_to_ram_ratio>
183
184 <!-- Simple server-wide memory profiler. Collect a stack trace at every peak allocation step (in bytes).
185 Data will be stored in system.trace_log table with query_id = empty string.
186 Zero means disabled.
187 -->
188 <total_memory_profiler_step>4194304</total_memory_profiler_step>
189
190 <!-- Collect random allocations and deallocations and write them into system.trace_log with 'MemorySample' trace_type.
191 The probability is for every alloc/free regardless to the size of the allocation.
192 Note that sampling happens only when the amount of untracked memory exceeds the untracked memory limit,
193 which is 4 MiB by default but can be lowered if 'total_memory_profiler_step' is lowered.
194 You may want to set 'total_memory_profiler_step' to 1 for extra fine grained sampling.
195 -->
196 <total_memory_tracker_sample_probability>0</total_memory_tracker_sample_probability>
197
198 <!-- Set limit on number of open files (default: maximum). This setting makes sense on Mac OS X because getrlimit() fails to retrieve
199 correct maximum value. -->
200 <!-- <max_open_files>262144</max_open_files> -->
201
202 <!-- Size of cache of uncompressed blocks of data, used in tables of MergeTree family.
203 In bytes. Cache is single for server. Memory is allocated only on demand.
204 Cache is used when 'use_uncompressed_cache' user setting turned on (off by default).
205 Uncompressed cache is advantageous only for very short queries and in rare cases.
206 -->
207 <uncompressed_cache_size>8589934592</uncompressed_cache_size>
208
209 <!-- Approximate size of mark cache, used in tables of MergeTree family.
210 In bytes. Cache is single for server. Memory is allocated only on demand.
211 You should not lower this value.
212 -->
213 <mark_cache_size>5368709120</mark_cache_size>
214
215
216 <!-- Path to data directory, with trailing slash. -->
217 <path>/var/lib/clickhouse/</path>
218
219 <!-- Path to temporary data for processing hard queries. -->
220 <tmp_path>/var/lib/clickhouse/tmp/</tmp_path>
221
222 <!-- Policy from the <storage_configuration> for the temporary files.
223 If not set <tmp_path> is used, otherwise <tmp_path> is ignored.
224
225 Notes:
226 - move_factor is ignored
227 - keep_free_space_bytes is ignored
228 - max_data_part_size_bytes is ignored
229 - you must have exactly one volume in that policy
230 -->
231 <!-- <tmp_policy>tmp</tmp_policy> -->
232
233 <!-- Directory with user provided files that are accessible by 'file' table function. -->
234 <user_files_path>/var/lib/clickhouse/user_files/</user_files_path>
235
236 <!-- Path to folder where users and roles created by SQL commands are stored. -->
237 <access_control_path>/var/lib/clickhouse/access/</access_control_path>
238
239 <!-- External user directories (LDAP). -->
240 <ldap_servers>
241 <!-- List LDAP servers with their connection parameters here to later use them as authenticators for dedicated users,
242 who have 'ldap' authentication mechanism specified instead of 'password'.
243 Parameters:
244 host - LDAP server hostname or IP, this parameter is mandatory and cannot be empty.
245 port - LDAP server port, default is 636 if enable_tls is set to true, 389 otherwise.
246 auth_dn_prefix, auth_dn_suffix - prefix and suffix used to construct the DN to bind to.
247 Effectively, the resulting DN will be constructed as auth_dn_prefix + escape(user_name) + auth_dn_suffix string.
248 Note, that this implies that auth_dn_suffix should usually have comma ',' as its first non-space character.
249 enable_tls - flag to trigger use of secure connection to the LDAP server.
250 Specify 'no' for plain text (ldap://) protocol (not recommended).
251 Specify 'yes' for LDAP over SSL/TLS (ldaps://) protocol (recommended, the default).
252 Specify 'starttls' for legacy StartTLS protocol (plain text (ldap://) protocol, upgraded to TLS).
253 tls_minimum_protocol_version - the minimum protocol version of SSL/TLS.
254 Accepted values are: 'ssl2', 'ssl3', 'tls1.0', 'tls1.1', 'tls1.2' (the default).
255 tls_require_cert - SSL/TLS peer certificate verification behavior.
256 Accepted values are: 'never', 'allow', 'try', 'demand' (the default).
257 tls_cert_file - path to certificate file.
258 tls_key_file - path to certificate key file.
259 tls_ca_cert_file - path to CA certificate file.
260 tls_ca_cert_dir - path to the directory containing CA certificates.
261 tls_cipher_suite - allowed cipher suite.
262 Example:
263 <my_ldap_server>
264 <host>localhost</host>
265 <port>636</port>
266 <auth_dn_prefix>uid=</auth_dn_prefix>
267 <auth_dn_suffix>,ou=users,dc=example,dc=com</auth_dn_suffix>
268 <enable_tls>yes</enable_tls>
269 <tls_minimum_protocol_version>tls1.2</tls_minimum_protocol_version>
270 <tls_require_cert>demand</tls_require_cert>
271 <tls_cert_file>/path/to/tls_cert_file</tls_cert_file>
272 <tls_key_file>/path/to/tls_key_file</tls_key_file>
273 <tls_ca_cert_file>/path/to/tls_ca_cert_file</tls_ca_cert_file>
274 <tls_ca_cert_dir>/path/to/tls_ca_cert_dir</tls_ca_cert_dir>
275 <tls_cipher_suite>ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:AES256-GCM-SHA384</tls_cipher_suite>
276 </my_ldap_server>
277 -->
278 </ldap_servers>
279
280 <!-- Path to configuration file with users, access rights, profiles of settings, quotas. -->
281 <users_config>users.xml</users_config>
282
283 <!-- Default profile of settings. -->
284 <default_profile>default</default_profile>
285
286 <!-- Comma-separated list of prefixes for user-defined settings. -->
287 <custom_settings_prefixes/>
288
289 <!-- System profile of settings. This settings are used by internal processes (Buffer storage, Distributed DDL worker and so on). -->
290 <!-- <system_profile>default</system_profile> -->
291
292 <!-- Default database. -->
293 <default_database>default</default_database>
294
295 <!-- Server time zone could be set here.
296
297 Time zone is used when converting between String and DateTime types,
298 when printing DateTime in text formats and parsing DateTime from text,
299 it is used in date and time related functions, if specific time zone was not passed as an argument.
300
301 Time zone is specified as identifier from IANA time zone database, like UTC or Africa/Abidjan.
302 If not specified, system time zone at server startup is used.
303
304 Please note, that server could display time zone alias instead of specified name.
305 Example: W-SU is an alias for Europe/Moscow and Zulu is an alias for UTC.
306 -->
307 <!-- <timezone>Europe/Moscow</timezone> -->
308
309 <!-- You can specify umask here (see "man umask"). Server will apply it on startup.
310 Number is always parsed as octal. Default umask is 027 (other users cannot read logs, data files, etc; group can only read).
311 -->
312 <!-- <umask>022</umask> -->
313
314 <!-- Perform mlockall after startup to lower first queries latency
315 and to prevent clickhouse executable from being paged out under high IO load.
316 Enabling this option is recommended but will lead to increased startup time for up to a few seconds.
317 -->
318 <mlock_executable>true</mlock_executable>
319
320 <!-- Configuration of clusters that could be used in Distributed tables.
321 https://clickhouse.tech/docs/en/operations/table_engines/distributed/
322 -->
323 <remote_servers incl="clickhouse_remote_servers">
324 <!-- Test only shard config for testing distributed storage -->
325 <test_shard_localhost>
326 <shard>
327 <!-- Optional. Whether to write data to just one of the replicas. Default: false (write data to all replicas). -->
328 <!-- <internal_replication>false</internal_replication> -->
329 <!-- Optional. Shard weight when writing data. Default: 1. -->
330 <!-- <weight>1</weight> -->
331 <replica>
332 <host>localhost</host>
333 <port>9000</port>
334 <!-- Optional. Priority of the replica for load_balancing. Default: 1 (less value has more priority). -->
335 <!-- <priority>1</priority> -->
336 </replica>
337 </shard>
338 </test_shard_localhost>
339 <test_cluster_two_shards_localhost>
340 <shard>
341 <replica>
342 <host>localhost</host>
343 <port>9000</port>
344 </replica>
345 </shard>
346 <shard>
347 <replica>
348 <host>localhost</host>
349 <port>9000</port>
350 </replica>
351 </shard>
352 </test_cluster_two_shards_localhost>
353 <test_cluster_two_shards>
354 <shard>
355 <replica>
356 <host>127.0.0.1</host>
357 <port>9000</port>
358 </replica>
359 </shard>
360 <shard>
361 <replica>
362 <host>127.0.0.2</host>
363 <port>9000</port>
364 </replica>
365 </shard>
366 </test_cluster_two_shards>
367 <test_shard_localhost_secure>
368 <shard>
369 <replica>
370 <host>localhost</host>
371 <port>9440</port>
372 <secure>1</secure>
373 </replica>
374 </shard>
375 </test_shard_localhost_secure>
376 <test_unavailable_shard>
377 <shard>
378 <replica>
379 <host>localhost</host>
380 <port>9000</port>
381 </replica>
382 </shard>
383 <shard>
384 <replica>
385 <host>localhost</host>
386 <port>1</port>
387 </replica>
388 </shard>
389 </test_unavailable_shard>
390
391 <!-- User-specified clusters -->
392 <analytics>
393 <shard>
394 <internal_replication>true</internal_replication>
395 <replica>
396 <host>chi-clickhouse-analytics-0-0</host>
397 <port>9000</port>
398 </replica>
399 <replica>
400 <host>chi-clickhouse-analytics-0-1</host>
401 <port>9000</port>
402 </replica>
403 </shard>
404 <shard>
405 <internal_replication>true</internal_replication>
406 <replica>
407 <host>chi-clickhouse-analytics-1-0</host>
408 <port>9000</port>
409 </replica>
410 <replica>
411 <host>chi-clickhouse-analytics-1-1</host>
412 <port>9000</port>
413 </replica>
414 </shard>
415 <shard>
416 <internal_replication>true</internal_replication>
417 <replica>
418 <host>chi-clickhouse-analytics-2-0</host>
419 <port>9000</port>
420 </replica>
421 <replica>
422 <host>chi-clickhouse-analytics-2-1</host>
423 <port>9000</port>
424 </replica>
425 </shard>
426 </analytics>
427 <!-- Autogenerated clusters -->
428 <all-replicated>
429 <shard>
430 <internal_replication>true</internal_replication>
431 <replica>
432 <host>chi-clickhouse-analytics-0-0</host>
433 <port>9000</port>
434 </replica>
435 <replica>
436 <host>chi-clickhouse-analytics-0-1</host>
437 <port>9000</port>
438 </replica>
439 <replica>
440 <host>chi-clickhouse-analytics-1-0</host>
441 <port>9000</port>
442 </replica>
443 <replica>
444 <host>chi-clickhouse-analytics-1-1</host>
445 <port>9000</port>
446 </replica>
447 <replica>
448 <host>chi-clickhouse-analytics-2-0</host>
449 <port>9000</port>
450 </replica>
451 <replica>
452 <host>chi-clickhouse-analytics-2-1</host>
453 <port>9000</port>
454 </replica>
455 </shard>
456 </all-replicated>
457 <all-sharded>
458 <shard>
459 <internal_replication>false</internal_replication>
460 <replica>
461 <host>chi-clickhouse-analytics-0-0</host>
462 <port>9000</port>
463 </replica>
464 </shard>
465 <shard>
466 <internal_replication>false</internal_replication>
467 <replica>
468 <host>chi-clickhouse-analytics-0-1</host>
469 <port>9000</port>
470 </replica>
471 </shard>
472 <shard>
473 <internal_replication>false</internal_replication>
474 <replica>
475 <host>chi-clickhouse-analytics-1-0</host>
476 <port>9000</port>
477 </replica>
478 </shard>
479 <shard>
480 <internal_replication>false</internal_replication>
481 <replica>
482 <host>chi-clickhouse-analytics-1-1</host>
483 <port>9000</port>
484 </replica>
485 </shard>
486 <shard>
487 <internal_replication>false</internal_replication>
488 <replica>
489 <host>chi-clickhouse-analytics-2-0</host>
490 <port>9000</port>
491 </replica>
492 </shard>
493 <shard>
494 <internal_replication>false</internal_replication>
495 <replica>
496 <host>chi-clickhouse-analytics-2-1</host>
497 <port>9000</port>
498 </replica>
499 </shard>
500 </all-sharded>
501 </remote_servers>
502
503 <!-- The list of hosts allowed to use in URL-related storage engines and table functions.
504 If this section is not present in configuration, all hosts are allowed.
505 -->
506 <remote_url_allow_hosts>
507 <!-- Host should be specified exactly as in URL. The name is checked before DNS resolution.
508 Example: "yandex.ru", "yandex.ru." and "www.yandex.ru" are different hosts.
509 If port is explicitly specified in URL, the host:port is checked as a whole.
510 If host specified here without port, any port with this host allowed.
511 "yandex.ru" -> "yandex.ru:443", "yandex.ru:80" etc. is allowed, but "yandex.ru:80" -> only "yandex.ru:80" is allowed.
512 If the host is specified as IP address, it is checked as specified in URL. Example: "[2a02:6b8:a::a]".
513 If there are redirects and support for redirects is enabled, every redirect (the Location field) is checked.
514 -->
515
516 <!-- Regular expression can be specified. RE2 engine is used for regexps.
517 Regexps are not aligned: don't forget to add ^ and $. Also don't forget to escape dot (.) metacharacter
518 (forgetting to do so is a common source of error).
519 -->
520 </remote_url_allow_hosts>
521
522 <!-- If element has 'incl' attribute, then for it's value will be used corresponding substitution from another file.
523 By default, path to file with substitutions is /etc/metrika.xml. It could be changed in config in 'include_from' element.
524 Values for substitutions are specified in /yandex/name_of_substitution elements in that file.
525 -->
526
527 <!-- ZooKeeper is used to store metadata about replicas, when using Replicated tables.
528 Optional. If you don't use replicated tables, you could omit that.
529
530 See https://clickhouse.yandex/docs/en/table_engines/replication/
531 -->
532
533
534
535 <!-- Substitutions for parameters of replicated tables.
536 Optional. If you don't use replicated tables, you could omit that.
537
538 See https://clickhouse.yandex/docs/en/table_engines/replication/#creating-replicated-tables
539 -->
540
541
542
543 <!-- Reloading interval for embedded dictionaries, in seconds. Default: 3600. -->
544 <builtin_dictionaries_reload_interval>3600</builtin_dictionaries_reload_interval>
545
546
547 <!-- Maximum session timeout, in seconds. Default: 3600. -->
548 <max_session_timeout>3600</max_session_timeout>
549
550 <!-- Default session timeout, in seconds. Default: 60. -->
551 <default_session_timeout>60</default_session_timeout>
552
553 <!-- Sending data to Graphite for monitoring. Several sections can be defined. -->
554 <!--
555 interval - send every X second
556 root_path - prefix for keys
557 hostname_in_path - append hostname to root_path (default = true)
558 metrics - send data from table system.metrics
559 events - send data from table system.events
560 asynchronous_metrics - send data from table system.asynchronous_metrics
561 -->
562 <!--
563 <graphite>
564 <host>localhost</host>
565 <port>42000</port>
566 <timeout>0.1</timeout>
567 <interval>60</interval>
568 <root_path>one_min</root_path>
569 <hostname_in_path>true</hostname_in_path>
570
571 <metrics>true</metrics>
572 <events>true</events>
573 <events_cumulative>false</events_cumulative>
574 <asynchronous_metrics>true</asynchronous_metrics>
575 </graphite>
576 <graphite>
577 <host>localhost</host>
578 <port>42000</port>
579 <timeout>0.1</timeout>
580 <interval>1</interval>
581 <root_path>one_sec</root_path>
582
583 <metrics>true</metrics>
584 <events>true</events>
585 <events_cumulative>false</events_cumulative>
586 <asynchronous_metrics>false</asynchronous_metrics>
587 </graphite>
588 -->
589
590 <!-- Serve endpoint for Prometheus monitoring. -->
591 <!--
592 endpoint - mertics path (relative to root, statring with "/")
593 port - port to setup server. If not defined or 0 than http_port used
594 metrics - send data from table system.metrics
595 events - send data from table system.events
596 asynchronous_metrics - send data from table system.asynchronous_metrics
597 status_info - send data from different component from CH, ex: Dictionaries status
598 -->
599 <!--
600 <prometheus>
601 <endpoint>/metrics</endpoint>
602 <port>9363</port>
603
604 <metrics>true</metrics>
605 <events>true</events>
606 <asynchronous_metrics>true</asynchronous_metrics>
607 <status_info>true</status_info>
608 </prometheus>
609 -->
610
611 <!-- Query log. Used only for queries with setting log_queries = 1. -->
612 <query_log>
613 <!-- What table to insert data. If table is not exist, it will be created.
614 When query log structure is changed after system update,
615 then old table will be renamed and new table will be created automatically.
616 -->
617 <database>system</database>
618 <table>query_log</table>
619 <!--
620 PARTITION BY expr https://clickhouse.yandex/docs/en/table_engines/custom_partitioning_key/
621 Example:
622 event_date
623 toMonday(event_date)
624 toYYYYMM(event_date)
625 toStartOfHour(event_time)
626 -->
627 <partition_by>toMonday(event_date)</partition_by>
628
629 <!-- Instead of partition_by, you can provide full engine expression (starting with ENGINE = ) with parameters,
630 Example: <engine>ENGINE = MergeTree PARTITION BY toYYYYMM(event_date) ORDER BY (event_date, event_time) SETTINGS index_granularity = 1024</engine>
631 -->
632
633 <!-- Interval of flushing data. -->
634 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
635
636
637
638
639
640</query_log>
641
642 <!-- Trace log. Stores stack traces collected by query profilers.
643 See query_profiler_real_time_period_ns and query_profiler_cpu_time_period_ns settings. -->
644 <trace_log>
645 <database>system</database>
646 <table>trace_log</table>
647
648 <partition_by>toYYYYMM(event_date)</partition_by>
649 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
650 </trace_log>
651
652 <!-- Query thread log. Has information about all threads participated in query execution.
653 Used only for queries with setting log_query_threads = 1. -->
654 <query_thread_log>
655 <database>system</database>
656 <table>query_thread_log</table>
657 <partition_by>toYYYYMM(event_date)</partition_by>
658 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
659 </query_thread_log>
660
661 <!-- Uncomment if use part log.
662 Part log contains information about all actions with parts in MergeTree tables (creation, deletion, merges, downloads).
663 <part_log>
664 <database>system</database>
665 <table>part_log</table>
666 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
667 </part_log>
668 -->
669
670 <!-- Uncomment to write text log into table.
671 Text log contains all information from usual server log but stores it in structured and efficient way.
672 The level of the messages that goes to the table can be limited (<level>), if not specified all messages will go to the table.
673 <text_log>
674 <database>system</database>
675 <table>text_log</table>
676 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
677 <level></level>
678 </text_log>
679 -->
680
681 <!-- Metric log contains rows with current values of ProfileEvents, CurrentMetrics collected with "collect_interval_milliseconds" interval. -->
682 <metric_log>
683 <database>system</database>
684 <table>metric_log</table>
685 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
686 <collect_interval_milliseconds>1000</collect_interval_milliseconds>
687 </metric_log>
688
689 <!--
690 Asynchronous metric log contains values of metrics from
691 system.asynchronous_metrics.
692 -->
693 <asynchronous_metric_log>
694 <database>system</database>
695 <table>asynchronous_metric_log</table>
696 <!--
697 Asynchronous metrics are updated once a minute, so there is
698 no need to flush more often.
699 -->
700 <flush_interval_milliseconds>60000</flush_interval_milliseconds>
701 </asynchronous_metric_log>
702
703 <!-- Crash log. Stores stack traces for fatal errors.
704 This table is normally empty. -->
705 <crash_log>
706 <database>system</database>
707 <table>crash_log</table>
708
709 <partition_by/>
710 <flush_interval_milliseconds>1000</flush_interval_milliseconds>
711 </crash_log>
712
713 <!-- Parameters for embedded dictionaries, used in Yandex.Metrica.
714 See https://clickhouse.yandex/docs/en/dicts/internal_dicts/
715 -->
716
717 <!-- Path to file with region hierarchy. -->
718 <!-- <path_to_regions_hierarchy_file>/opt/geo/regions_hierarchy.txt</path_to_regions_hierarchy_file> -->
719
720 <!-- Path to directory with files containing names of regions -->
721 <!-- <path_to_regions_names_files>/opt/geo/</path_to_regions_names_files> -->
722
723
724 <!-- Configuration of external dictionaries. See:
725 https://clickhouse.yandex/docs/en/dicts/external_dicts/
726 -->
727 <dictionaries_config>*_dictionary.xml</dictionaries_config>
728
729 <!-- Uncomment if you want data to be compressed 30-100% better.
730 Don't do that if you just started using ClickHouse.
731 -->
732 <compression incl="clickhouse_compression">
733 <!--
734 <!- - Set of variants. Checked in order. Last matching case wins. If nothing matches, lz4 will be used. - ->
735 <case>
736
737 <!- - Conditions. All must be satisfied. Some conditions may be omitted. - ->
738 <min_part_size>10000000000</min_part_size> <!- - Min part size in bytes. - ->
739 <min_part_size_ratio>0.01</min_part_size_ratio> <!- - Min size of part relative to whole table size. - ->
740
741 <!- - What compression method to use. - ->
742 <method>zstd</method>
743 </case>
744 -->
745 </compression>
746
747 <!-- Allow to execute distributed DDL queries (CREATE, DROP, ALTER, RENAME) on cluster.
748 Works only if ZooKeeper is enabled. Comment it if such functionality isn't required. -->
749 <distributed_ddl>
750 <!-- Path in ZooKeeper to queue with DDL queries -->
751 <path>/clickhouse/clickhouse/task_queue/ddl</path>
752
753 <!-- Settings from this profile will be used to execute DDL queries -->
754 <!-- <profile>default</profile> -->
755
756
757 </distributed_ddl>
758
759 <!-- Settings to fine tune MergeTree tables. See documentation in source code, in MergeTreeSettings.h -->
760 <!--
761 <merge_tree>
762 <max_suspicious_broken_parts>5</max_suspicious_broken_parts>
763 </merge_tree>
764 -->
765
766 <!-- Protection from accidental DROP.
767 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.
768 If you want do delete one table and don't want to change clickhouse-server config, you could create special file <clickhouse-path>/flags/force_drop_table and make DROP once.
769 By default max_table_size_to_drop is 50GB; max_table_size_to_drop=0 allows to DROP any tables.
770 The same for max_partition_size_to_drop.
771 Uncomment to disable protection.
772 -->
773 <!-- <max_table_size_to_drop>0</max_table_size_to_drop> -->
774 <!-- <max_partition_size_to_drop>0</max_partition_size_to_drop> -->
775
776 <!-- Example of parameters for GraphiteMergeTree table engine -->
777 <graphite_rollup_example>
778 <pattern>
779 <regexp>click_cost</regexp>
780 <function>any</function>
781 <retention>
782 <age>0</age>
783 <precision>3600</precision>
784 </retention>
785 <retention>
786 <age>86400</age>
787 <precision>60</precision>
788 </retention>
789 </pattern>
790 <default>
791 <function>max</function>
792 <retention>
793 <age>0</age>
794 <precision>60</precision>
795 </retention>
796 <retention>
797 <age>3600</age>
798 <precision>300</precision>
799 </retention>
800 <retention>
801 <age>86400</age>
802 <precision>3600</precision>
803 </retention>
804 </default>
805 </graphite_rollup_example>
806
807 <!-- Directory in <clickhouse-path> containing schema files for various input formats.
808 The directory will be created if it doesn't exist.
809 -->
810 <format_schema_path>/var/lib/clickhouse/format_schemas/</format_schema_path>
811
812 <!-- Uncomment to use query masking rules.
813 name - name for the rule (optional)
814 regexp - RE2 compatible regular expression (mandatory)
815 replace - substitution string for sensitive data (optional, by default - six asterisks)
816 <query_masking_rules>
817 <rule>
818 <name>hide SSN</name>
819 <regexp>\b\d{3}-\d{2}-\d{4}\b</regexp>
820 <replace>000-00-0000</replace>
821 </rule>
822 </query_masking_rules>
823 -->
824
825 <!-- Uncomment to use custom http handlers.
826 rules are checked from top to bottom, first match runs the handler
827 url - to match request URL, you can use 'regex:' prefix to use regex match(optional)
828 methods - to match request method, you can use commas to separate multiple method matches(optional)
829 headers - to match request headers, match each child element(child element name is header name), you can use 'regex:' prefix to use regex match(optional)
830 handler is request handler
831 type - supported types: static, dynamic_query_handler, predefined_query_handler
832 query - use with predefined_query_handler type, executes query when the handler is called
833 query_param_name - use with dynamic_query_handler type, extracts and executes the value corresponding to the <query_param_name> value in HTTP request params
834 status - use with static type, response status code
835 content_type - use with static type, response content-type
836 response_content - use with static type, Response content sent to client, when using the prefix 'file://' or 'config://', find the content from the file or configuration send to client.
837
838 <http_handlers>
839 <rule>
840 <url>/</url>
841 <methods>POST,GET</methods>
842 <headers><pragma>no-cache</pragma></headers>
843 <handler>
844 <type>dynamic_query_handler</type>
845 <query_param_name>query</query_param_name>
846 </handler>
847 </rule>
848
849 <rule>
850 <url>/predefined_query</url>
851 <methods>POST,GET</methods>
852 <handler>
853 <type>predefined_query_handler</type>
854 <query>SELECT * FROM system.settings</query>
855 </handler>
856 </rule>
857
858 <rule>
859 <handler>
860 <type>static</type>
861 <status>200</status>
862 <content_type>text/plain; charset=UTF-8</content_type>
863 <response_content>config://http_server_default_response</response_content>
864 </handler>
865 </rule>
866 </http_handlers>
867 -->
868
869 <!-- Uncomment to disable ClickHouse internal DNS caching. -->
870 <!-- <disable_internal_dns_cache>1</disable_internal_dns_cache> -->
871
872 <macros>
873 <installation>clickhouse</installation>
874 <all-sharded-shard>0</all-sharded-shard>
875 <cluster>analytics</cluster>
876 <shard>0</shard>
877 <replica>chi-clickhouse-analytics-0-0</replica>
878 </macros>
879
880 <zookeeper>
881 <node>
882 <host>zookeeper.clickhouse</host>
883 <port>2181</port>
884 </node>
885 <session_timeout_ms>30000</session_timeout_ms>
886 <operation_timeout_ms>10000</operation_timeout_ms>
887 </zookeeper>
888
889
890 <!-- Listen wildcard address to allow accepting connections from other containers and host network. -->
891 <!-- <listen_host>::</listen_host> -->
892 <listen_host>0.0.0.0</listen_host>
893 <listen_try>1</listen_try>
894
895
896
897
898
899
900
901 <kafka>
902 <fetch_min_bytes>100000</fetch_min_bytes>
903 </kafka>
904
905 <part_log>
906 <database>system</database>
907 <engine>Engine = MergeTree PARTITION BY event_date ORDER BY event_time TTL event_date + interval 10 day</engine>
908 <flush_interval_milliseconds>7500</flush_interval_milliseconds>
909 <table>part_log</table>
910 </part_log>
911</yandex>