Debian Codegraph @

ansible_collections/community/clickhouse/tests/integration/targets/clickhouse_cfg_info/files/config.yaml

raw
1 # This is an example of a configuration file "config.xml" rewritten in YAML
2 # You can read this documentation for detailed information about YAML configuration:
3 # https://clickhouse.com/docs/en/operations/configuration-files/
4
5 # NOTE: User and query level settings are set up in "users.yaml" file.
6 # If you have accidentally specified user-level settings here, server won't start.
7 # You can either move the settings to the right place inside "users.xml" file
8 # or add skip_check_for_incorrect_settings: 1 here.
9 logger:
10 # Possible levels [1]:
11 # - none (turns off logging)
12 # - fatal
13 # - critical
14 # - error
15 # - warning
16 # - notice
17 # - information
18 # - debug
19 # - trace
20 # [1]: https://github.com/pocoproject/poco/blob/poco-1.9.4-release/Foundation/include/Poco/Logger.h#L105-L114
21 level: trace
22 log: /var/log/clickhouse-server/clickhouse-server.log
23 errorlog: /var/log/clickhouse-server/clickhouse-server.err.log
24 # Rotation policy
25 # See https://github.com/pocoproject/poco/blob/poco-1.9.4-release/Foundation/include/Poco/FileChannel.h#L54-L85
26 size: 1000M
27 count: 10
28 # console: 1
29 # Default behavior is autodetection (log to console if not daemon mode and is tty)
30
31 # Per level overrides (legacy):
32 # For example to suppress logging of the ConfigReloader you can use:
33 # NOTE: levels.logger is reserved, see below.
34 # levels:
35 # ConfigReloader: none
36
37 # Per level overrides:
38 # For example to suppress logging of the RBAC for default user you can use:
39 # (But please note that the logger name maybe changed from version to version, even after minor upgrade)
40 # levels:
41 # - logger:
42 # name: 'ContextAccess (default)'
43 # level: none
44 # - logger:
45 # name: 'DatabaseOrdinary (test)'
46 # level: none
47
48 # It is the name that will be shown in the clickhouse-client.
49 # By default, anything with "production" will be highlighted in red in query prompt.
50 # display_name: production
51
52 # Port for HTTP API. See also 'https_port' for secure connections.
53 # This interface is also used by ODBC and JDBC drivers (DataGrip, Dbeaver, ...)
54 # and by most of web interfaces (embedded UI, Grafana, Redash, ...).
55 http_port: 8123
56
57 # Port for interaction by native protocol with:
58 # - clickhouse-client and other native ClickHouse tools (clickhouse-benchmark);
59 # - clickhouse-server with other clickhouse-servers for distributed query processing;
60 # - ClickHouse drivers and applications supporting native protocol
61 # (this protocol is also informally called as "the TCP protocol");
62 # See also 'tcp_port_secure' for secure connections.
63 tcp_port: 9000
64
65 # Compatibility with MySQL protocol.
66 # ClickHouse will pretend to be MySQL for applications connecting to this port.
67 mysql_port: 9004
68
69 # Compatibility with PostgreSQL protocol.
70 # ClickHouse will pretend to be PostgreSQL for applications connecting to this port.
71 postgresql_port: 9005
72
73 # HTTP API with TLS (HTTPS).
74 # You have to configure certificate to enable this interface.
75 # See the openSSL section below.
76 # https_port: 8443
77
78 # Native interface with TLS.
79 # You have to configure certificate to enable this interface.
80 # See the openSSL section below.
81 # tcp_port_secure: 9440
82
83 # Native interface wrapped with PROXYv1 protocol
84 # PROXYv1 header sent for every connection.
85 # ClickHouse will extract information about proxy-forwarded client address from the header.
86 # tcp_with_proxy_port: 9011
87
88 # Port for communication between replicas. Used for data exchange.
89 # It provides low-level data access between servers.
90 # This port should not be accessible from untrusted networks.
91 # See also 'interserver_http_credentials'.
92 # Data transferred over connections to this port should not go through untrusted networks.
93 # See also 'interserver_https_port'.
94 interserver_http_port: 9009
95
96 # Port for communication between replicas with TLS.
97 # You have to configure certificate to enable this interface.
98 # See the openSSL section below.
99 # See also 'interserver_http_credentials'.
100 # interserver_https_port: 9010
101
102 # Hostname that is used by other replicas to request this server.
103 # If not specified, than it is determined analogous to 'hostname -f' command.
104 # This setting could be used to switch replication to another network interface
105 # (the server may be connected to multiple networks via multiple addresses)
106 # interserver_http_host: example.clickhouse.com
107
108 # You can specify credentials for authenthication between replicas.
109 # This is required when interserver_https_port is accessible from untrusted networks,
110 # and also recommended to avoid SSRF attacks from possibly compromised services in your network.
111 # interserver_http_credentials:
112 # user: interserver
113 # password: ''
114
115 # Listen specified address.
116 # Use :: (wildcard IPv6 address), if you want to accept connections both with IPv4 and IPv6 from everywhere.
117 # Notes:
118 # If you open connections from wildcard address, make sure that at least one of the following measures applied:
119 # - server is protected by firewall and not accessible from untrusted networks;
120 # - all users are restricted to subset of network addresses (see users.xml);
121 # - all users have strong passwords, only secure (TLS) interfaces are accessible, or connections are only made via TLS interfaces.
122 # - users without password have readonly access.
123 # See also: https://www.shodan.io/search?query=clickhouse
124 # listen_host: '::'
125
126 # Same for hosts without support for IPv6:
127 # listen_host: 0.0.0.0
128
129 # Default values - try listen localhost on IPv4 and IPv6.
130 # listen_host: '::1'
131 listen_host: 127.0.0.1
132
133 # Don't exit if IPv6 or IPv4 networks are unavailable while trying to listen.
134 # listen_try: 0
135
136 # Allow multiple servers to listen on the same address:port. This is not recommended.
137 # listen_reuse_port: 0
138
139 # listen_backlog: 64
140 max_connections: 4096
141
142 # For 'Connection: keep-alive' in HTTP 1.1
143 keep_alive_timeout: 3
144
145 # gRPC protocol (see src/Server/grpc_protos/clickhouse_grpc.proto for the API)
146 # grpc_port: 9100
147 grpc:
148 enable_ssl: false
149
150 # The following two files are used only if enable_ssl=1
151 ssl_cert_file: /path/to/ssl_cert_file
152 ssl_key_file: /path/to/ssl_key_file
153
154 # Whether server will request client for a certificate
155 ssl_require_client_auth: false
156
157 # The following file is used only if ssl_require_client_auth=1
158 ssl_ca_cert_file: /path/to/ssl_ca_cert_file
159
160 # Default compression algorithm (applied if client doesn't specify another algorithm).
161 # Supported algorithms: none, deflate, gzip, stream_gzip
162 compression: deflate
163
164 # Default compression level (applied if client doesn't specify another level).
165 # Supported levels: none, low, medium, high
166 compression_level: medium
167
168 # Send/receive message size limits in bytes. -1 means unlimited
169 max_send_message_size: -1
170 max_receive_message_size: -1
171
172 # Enable if you want very detailed logs
173 verbose_logs: false
174
175 # 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
176 openSSL:
177 server:
178 # Used for https server AND secure tcp port
179 # 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
180 # certificateFile: /etc/clickhouse-server/server.crt
181 # privateKeyFile: /etc/clickhouse-server/server.key
182
183 # dhparams are optional. You can delete the dhParamsFile: element.
184 # To generate dhparams, use the following command:
185 # openssl dhparam -out /etc/clickhouse-server/dhparam.pem 4096
186 # Only file format with BEGIN DH PARAMETERS is supported.
187 dhParamsFile: /etc/clickhouse-server/dhparam.pem
188 verificationMode: none
189 loadDefaultCAFile: true
190 cacheSessions: true
191 disableProtocols: 'sslv2,sslv3'
192 preferServerCiphers: true
193 client:
194 # Used for connecting to https dictionary source and secured Zookeeper communication
195 loadDefaultCAFile: true
196 cacheSessions: true
197 disableProtocols: 'sslv2,sslv3'
198 preferServerCiphers: true
199
200 # Use for self-signed: verificationMode: none
201 invalidCertificateHandler:
202 # Use for self-signed: name: AcceptCertificateHandler
203 name: RejectCertificateHandler
204
205 # Default root page on http[s] server. For example load UI from https://tabix.io/ when opening http://localhost:8123
206 # http_server_default_response: |-
207 # <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>
208
209 # Maximum number of concurrent queries.
210 max_concurrent_queries: 100
211
212 # Maximum memory usage (resident set size) for server process.
213 # Zero value or unset means default. Default is "max_server_memory_usage_to_ram_ratio" of available physical RAM.
214 # If the value is larger than "max_server_memory_usage_to_ram_ratio" of available physical RAM, it will be cut down.
215
216 # The constraint is checked on query execution time.
217 # If a query tries to allocate memory and the current memory usage plus allocation is greater
218 # than specified threshold, exception will be thrown.
219
220 # It is not practical to set this constraint to small values like just a few gigabytes,
221 # because memory allocator will keep this amount of memory in caches and the server will deny service of queries.
222 max_server_memory_usage: 0
223
224 # Maximum number of threads in the Global thread pool.
225 # This will default to a maximum of 10000 threads if not specified.
226 # This setting will be useful in scenarios where there are a large number
227 # of distributed queries that are running concurrently but are idling most
228 # of the time, in which case a higher number of threads might be required.
229 max_thread_pool_size: 10000
230
231 # On memory constrained environments you may have to set this to value larger than 1.
232 max_server_memory_usage_to_ram_ratio: 0.9
233
234 # Simple server-wide memory profiler. Collect a stack trace at every peak allocation step (in bytes).
235 # Data will be stored in system.trace_log table with query_id = empty string.
236 # Zero means disabled.
237 total_memory_profiler_step: 4194304
238
239 # Collect random allocations and deallocations and write them into system.trace_log with 'MemorySample' trace_type.
240 # The probability is for every alloc/free regardless to the size of the allocation.
241 # Note that sampling happens only when the amount of untracked memory exceeds the untracked memory limit,
242 # which is 4 MiB by default but can be lowered if 'total_memory_profiler_step' is lowered.
243 # You may want to set 'total_memory_profiler_step' to 1 for extra fine grained sampling.
244 total_memory_tracker_sample_probability: 0
245
246 # Set limit on number of open files (default: maximum). This setting makes sense on Mac OS X because getrlimit() fails to retrieve
247 # correct maximum value.
248 # max_open_files: 262144
249
250 # Size of cache of uncompressed blocks of data, used in tables of MergeTree family.
251 # In bytes. Cache is single for server. Memory is allocated only on demand.
252 # Cache is used when 'use_uncompressed_cache' user setting turned on (off by default).
253 # Uncompressed cache is advantageous only for very short queries and in rare cases.
254
255 # Note: uncompressed cache can be pointless for lz4, because memory bandwidth
256 # is slower than multi-core decompression on some server configurations.
257 # Enabling it can sometimes paradoxically make queries slower.
258 uncompressed_cache_size: 8589934592
259
260 # Approximate size of mark cache, used in tables of MergeTree family.
261 # In bytes. Cache is single for server. Memory is allocated only on demand.
262 # You should not lower this value.
263 # mark_cache_size: 5368709120
264
265 # For marks of secondary indices.
266 # index_mark_cache_size: 5368709120
267
268 # If you enable the `min_bytes_to_use_mmap_io` setting,
269 # the data in MergeTree tables can be read with mmap to avoid copying from kernel to userspace.
270 # It makes sense only for large files and helps only if data reside in page cache.
271 # To avoid frequent open/mmap/munmap/close calls (which are very expensive due to consequent page faults)
272 # and to reuse mappings from several threads and queries,
273 # the cache of mapped files is maintained. Its size is the number of mapped regions (usually equal to the number of mapped files).
274 # The amount of data in mapped files can be monitored
275 # in system.metrics, system.metric_log by the MMappedFiles, MMappedFileBytes metrics
276 # and in system.asynchronous_metrics, system.asynchronous_metrics_log by the MMapCacheCells metric,
277 # and also in system.events, system.processes, system.query_log, system.query_thread_log, system.query_views_log by the
278 # CreatedReadBufferMMap, CreatedReadBufferMMapFailed, MMappedFileCacheHits, MMappedFileCacheMisses events.
279 # Note that the amount of data in mapped files does not consume memory directly and is not accounted
280 # in query or server memory usage - because this memory can be discarded similar to OS page cache.
281 # The cache is dropped (the files are closed) automatically on removal of old parts in MergeTree,
282 # also it can be dropped manually by the SYSTEM DROP MMAP CACHE query.
283 # mmap_cache_size: 1024
284
285 # Cache size in bytes for compiled expressions.
286 # compiled_expression_cache_size: 134217728
287
288 # Cache size in elements for compiled expressions.
289 # compiled_expression_cache_elements_size: 10000
290
291 # Configuration for the query cache
292 # query_cache:
293 # max_size_in_bytes: 1073741824
294 # max_entries: 1024
295 # max_entry_size_in_bytes: 1048576
296 # max_entry_size_in_rows: 30000000
297
298 # Path to data directory, with trailing slash.
299 path: /var/lib/clickhouse/
300
301 # Path to temporary data for processing hard queries.
302 tmp_path: /var/lib/clickhouse/tmp/
303
304 # Policy from the <storage_configuration> for the temporary files.
305 # If not set <tmp_path> is used, otherwise <tmp_path> is ignored.
306
307 # Notes:
308 # - move_factor is ignored
309 # - keep_free_space_bytes is ignored
310 # - max_data_part_size_bytes is ignored
311 # - you must have exactly one volume in that policy
312 # tmp_policy: tmp
313
314 # Directory with user provided files that are accessible by 'file' table function.
315 user_files_path: /var/lib/clickhouse/user_files/
316
317 # LDAP server definitions.
318 ldap_servers: ''
319
320 # List LDAP servers with their connection parameters here to later 1) use them as authenticators for dedicated local users,
321 # who have 'ldap' authentication mechanism specified instead of 'password', or to 2) use them as remote user directories.
322 # Parameters:
323 # host - LDAP server hostname or IP, this parameter is mandatory and cannot be empty.
324 # port - LDAP server port, default is 636 if enable_tls is set to true, 389 otherwise.
325 # bind_dn - template used to construct the DN to bind to.
326 # The resulting DN will be constructed by replacing all '{user_name}' substrings of the template with the actual
327 # user name during each authentication attempt.
328 # user_dn_detection - section with LDAP search parameters for detecting the actual user DN of the bound user.
329 # This is mainly used in search filters for further role mapping when the server is Active Directory. The
330 # resulting user DN will be used when replacing '{user_dn}' substrings wherever they are allowed. By default,
331 # user DN is set equal to bind DN, but once search is performed, it will be updated with to the actual detected
332 # user DN value.
333 # base_dn - template used to construct the base DN for the LDAP search.
334 # The resulting DN will be constructed by replacing all '{user_name}' and '{bind_dn}' substrings
335 # of the template with the actual user name and bind DN during the LDAP search.
336 # scope - scope of the LDAP search.
337 # Accepted values are: 'base', 'one_level', 'children', 'subtree' (the default).
338 # search_filter - template used to construct the search filter for the LDAP search.
339 # The resulting filter will be constructed by replacing all '{user_name}', '{bind_dn}', and '{base_dn}'
340 # substrings of the template with the actual user name, bind DN, and base DN during the LDAP search.
341 # Note, that the special characters must be escaped properly in XML.
342 # verification_cooldown - a period of time, in seconds, after a successful bind attempt, during which a user will be assumed
343 # to be successfully authenticated for all consecutive requests without contacting the LDAP server.
344 # Specify 0 (the default) to disable caching and force contacting the LDAP server for each authentication request.
345 # enable_tls - flag to trigger use of secure connection to the LDAP server.
346 # Specify 'no' for plain text (ldap://) protocol (not recommended).
347 # Specify 'yes' for LDAP over SSL/TLS (ldaps://) protocol (recommended, the default).
348 # Specify 'starttls' for legacy StartTLS protocol (plain text (ldap://) protocol, upgraded to TLS).
349 # tls_minimum_protocol_version - the minimum protocol version of SSL/TLS.
350 # Accepted values are: 'ssl2', 'ssl3', 'tls1.0', 'tls1.1', 'tls1.2' (the default).
351 # tls_require_cert - SSL/TLS peer certificate verification behavior.
352 # Accepted values are: 'never', 'allow', 'try', 'demand' (the default).
353 # tls_cert_file - path to certificate file.
354 # tls_key_file - path to certificate key file.
355 # tls_ca_cert_file - path to CA certificate file.
356 # tls_ca_cert_dir - path to the directory containing CA certificates.
357 # tls_cipher_suite - allowed cipher suite (in OpenSSL notation).
358 # Example:
359 # my_ldap_server:
360 # host: localhost
361 # port: 636
362 # bind_dn: 'uid={user_name},ou=users,dc=example,dc=com'
363 # verification_cooldown: 300
364 # enable_tls: yes
365 # tls_minimum_protocol_version: tls1.2
366 # tls_require_cert: demand
367 # tls_cert_file: /path/to/tls_cert_file
368 # tls_key_file: /path/to/tls_key_file
369 # tls_ca_cert_file: /path/to/tls_ca_cert_file
370 # tls_ca_cert_dir: /path/to/tls_ca_cert_dir
371 # tls_cipher_suite: ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:AES256-GCM-SHA384
372
373 # Example (typical Active Directory with configured user DN detection for further role mapping):
374 # my_ad_server:
375 # host: localhost
376 # port: 389
377 # bind_dn: 'EXAMPLE\{user_name}'
378 # user_dn_detection:
379 # base_dn: CN=Users,DC=example,DC=com
380 # search_filter: '(&amp;(objectClass=user)(sAMAccountName={user_name}))'
381 # enable_tls: no
382
383 # To enable Kerberos authentication support for HTTP requests (GSS-SPNEGO), for those users who are explicitly configured
384 # to authenticate via Kerberos, define a single 'kerberos' section here.
385 # Parameters:
386 # principal - canonical service principal name, that will be acquired and used when accepting security contexts.
387 # This parameter is optional, if omitted, the default principal will be used.
388 # This parameter cannot be specified together with 'realm' parameter.
389 # realm - a realm, that will be used to restrict authentication to only those requests whose initiator's realm matches it.
390 # This parameter is optional, if omitted, no additional filtering by realm will be applied.
391 # This parameter cannot be specified together with 'principal' parameter.
392 # Example:
393 # kerberos: ''
394
395 # Example:
396 # kerberos:
397 # principal: HTTP/[email protected]
398
399 # Example:
400 # kerberos:
401 # realm: EXAMPLE.COM
402
403 # Sources to read users, roles, access rights, profiles of settings, quotas.
404 user_directories:
405 users_xml:
406 # Path to configuration file with predefined users.
407 path: users.yaml
408 local_directory:
409 # Path to folder where users created by SQL commands are stored.
410 path: /var/lib/clickhouse/access/
411
412 # # To add an LDAP server as a remote user directory of users that are not defined locally, define a single 'ldap' section
413 # # with the following parameters:
414 # # server - one of LDAP server names defined in 'ldap_servers' config section above.
415 # # This parameter is mandatory and cannot be empty.
416 # # roles - section with a list of locally defined roles that will be assigned to each user retrieved from the LDAP server.
417 # # If no roles are specified here or assigned during role mapping (below), user will not be able to perform any
418 # # actions after authentication.
419 # # role_mapping - section with LDAP search parameters and mapping rules.
420 # # When a user authenticates, while still bound to LDAP, an LDAP search is performed using search_filter and the
421 # # name of the logged in user. For each entry found during that search, the value of the specified attribute is
422 # # extracted. For each attribute value that has the specified prefix, the prefix is removed, and the rest of the
423 # # value becomes the name of a local role defined in ClickHouse, which is expected to be created beforehand by
424 # # CREATE ROLE command.
425 # # There can be multiple 'role_mapping' sections defined inside the same 'ldap' section. All of them will be
426 # # applied.
427 # # base_dn - template used to construct the base DN for the LDAP search.
428 # # The resulting DN will be constructed by replacing all '{user_name}', '{bind_dn}', and '{user_dn}'
429 # # substrings of the template with the actual user name, bind DN, and user DN during each LDAP search.
430 # # scope - scope of the LDAP search.
431 # # Accepted values are: 'base', 'one_level', 'children', 'subtree' (the default).
432 # # search_filter - template used to construct the search filter for the LDAP search.
433 # # The resulting filter will be constructed by replacing all '{user_name}', '{bind_dn}', '{user_dn}', and
434 # # '{base_dn}' substrings of the template with the actual user name, bind DN, user DN, and base DN during
435 # # each LDAP search.
436 # # Note, that the special characters must be escaped properly in XML.
437 # # attribute - attribute name whose values will be returned by the LDAP search. 'cn', by default.
438 # # prefix - prefix, that will be expected to be in front of each string in the original list of strings returned by
439 # # the LDAP search. Prefix will be removed from the original strings and resulting strings will be treated
440 # # as local role names. Empty, by default.
441 # # Example:
442 # # ldap:
443 # # server: my_ldap_server
444 # # roles:
445 # # my_local_role1: ''
446 # # my_local_role2: ''
447 # # role_mapping:
448 # # base_dn: 'ou=groups,dc=example,dc=com'
449 # # scope: subtree
450 # # search_filter: '(&amp;(objectClass=groupOfNames)(member={bind_dn}))'
451 # # attribute: cn
452 # # prefix: clickhouse_
453 # # Example (typical Active Directory with role mapping that relies on the detected user DN):
454 # # ldap:
455 # # server: my_ad_server
456 # # role_mapping:
457 # # base_dn: 'CN=Users,DC=example,DC=com'
458 # # attribute: CN
459 # # scope: subtree
460 # # search_filter: '(&amp;(objectClass=group)(member={user_dn}))'
461 # # prefix: clickhouse_
462
463 # Default profile of settings.
464 default_profile: default
465
466 # Comma-separated list of prefixes for user-defined settings.
467 # custom_settings_prefixes: ''
468 # System profile of settings. This settings are used by internal processes (Distributed DDL worker and so on).
469 # system_profile: default
470
471 # Buffer profile of settings.
472 # This settings are used by Buffer storage to flush data to the underlying table.
473 # Default: used from system_profile directive.
474 # buffer_profile: default
475
476 # Default database.
477 default_database: default
478
479 # Server time zone could be set here.
480
481 # Time zone is used when converting between String and DateTime types,
482 # when printing DateTime in text formats and parsing DateTime from text,
483 # it is used in date and time related functions, if specific time zone was not passed as an argument.
484
485 # Time zone is specified as identifier from IANA time zone database, like UTC or Africa/Abidjan.
486 # If not specified, system time zone at server startup is used.
487
488 # Please note, that server could display time zone alias instead of specified name.
489 # Example: Zulu is an alias for UTC.
490 # timezone: UTC
491
492 # You can specify umask here (see "man umask"). Server will apply it on startup.
493 # Number is always parsed as octal. Default umask is 027 (other users cannot read logs, data files, etc; group can only read).
494 # umask: 022
495
496 # Perform mlockall after startup to lower first queries latency
497 # and to prevent clickhouse executable from being paged out under high IO load.
498 # Enabling this option is recommended but will lead to increased startup time for up to a few seconds.
499 mlock_executable: true
500
501 # Reallocate memory for machine code ("text") using huge pages. Highly experimental.
502 remap_executable: false
503
504 # Uncomment below in order to use JDBC table engine and function.
505 # To install and run JDBC bridge in background:
506 # * [Debian/Ubuntu]
507 # export MVN_URL=https://repo1.maven.org/maven2/ru/yandex/clickhouse/clickhouse-jdbc-bridge
508 # export PKG_VER=$(curl -sL $MVN_URL/maven-metadata.xml | grep '<release>' | sed -e 's|.*>\(.*\)<.*|\1|')
509 # wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge_$PKG_VER-1_all.deb
510 # apt install --no-install-recommends -f ./clickhouse-jdbc-bridge_$PKG_VER-1_all.deb
511 # clickhouse-jdbc-bridge &
512 # * [CentOS/RHEL]
513 # export MVN_URL=https://repo1.maven.org/maven2/ru/yandex/clickhouse/clickhouse-jdbc-bridge
514 # export PKG_VER=$(curl -sL $MVN_URL/maven-metadata.xml | grep '<release>' | sed -e 's|.*>\(.*\)<.*|\1|')
515 # wget https://github.com/ClickHouse/clickhouse-jdbc-bridge/releases/download/v$PKG_VER/clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm
516 # yum localinstall -y clickhouse-jdbc-bridge-$PKG_VER-1.noarch.rpm
517 # clickhouse-jdbc-bridge &
518 # Please refer to https://github.com/ClickHouse/clickhouse-jdbc-bridge#usage for more information.
519
520 # jdbc_bridge:
521 # host: 127.0.0.1
522 # port: 9019
523
524 # Configuration of clusters that could be used in Distributed tables.
525 # https://clickhouse.com/docs/en/operations/table_engines/distributed/
526 remote_servers:
527 # Test only shard config for testing distributed storage
528 default:
529 # Inter-server per-cluster secret for Distributed queries
530 # default: no secret (no authentication will be performed)
531
532 # If set, then Distributed queries will be validated on shards, so at least:
533 # - such cluster should exist on the shard,
534 # - such cluster should have the same secret.
535
536 # And also (and which is more important), the initial_user will
537 # be used as current user for the query.
538
539 # Right now the protocol is pretty simple and it only takes into account:
540 # - cluster name
541 # - query
542
543 # Also it will be nice if the following will be implemented:
544 # - source hostname (see interserver_http_host), but then it will depends from DNS,
545 # it can use IP address instead, but then the you need to get correct on the initiator node.
546 # - target hostname / ip address (same notes as for source hostname)
547 # - time-based security tokens
548 # secret: ''
549 shard:
550 # Optional. Whether to write data to just one of the replicas. Default: false (write data to all replicas).
551 # internal_replication: false
552 # Optional. Shard weight when writing data. Default: 1.
553 # weight: 1
554 replica:
555 host: 127.0.0.1
556 port: 9000
557 # Optional. Priority of the replica for load_balancing. Default: 1 (less value has more priority).
558 # priority: 1
559 # Use SSL? Default: no
560 # secure: 0
561
562 # The list of hosts allowed to use in URL-related storage engines and table functions.
563 # If this section is not present in configuration, all hosts are allowed.
564 # remote_url_allow_hosts:
565
566 # Host should be specified exactly as in URL. The name is checked before DNS resolution.
567 # Example: "clickhouse.com", "clickhouse.com." and "www.clickhouse.com" are different hosts.
568 # If port is explicitly specified in URL, the host:port is checked as a whole.
569 # If host specified here without port, any port with this host allowed.
570 # "clickhouse.com" -> "clickhouse.com:443", "clickhouse.com:80" etc. is allowed, but "clickhouse.com:80" -> only "clickhouse.com:80" is allowed.
571 # If the host is specified as IP address, it is checked as specified in URL. Example: "[2a02:6b8:a::a]".
572 # If there are redirects and support for redirects is enabled, every redirect (the Location field) is checked.
573
574 # Regular expression can be specified. RE2 engine is used for regexps.
575 # Regexps are not aligned: don't forget to add ^ and $. Also don't forget to escape dot (.) metacharacter
576 # (forgetting to do so is a common source of error).
577
578 # If element has 'incl' attribute, then for it's value will be used corresponding substitution from another file.
579 # By default, path to file with substitutions is /etc/metrika.xml. It could be changed in config in 'include_from' element.
580 # Values for substitutions are specified in /clickhouse/name_of_substitution elements in that file.
581
582 # ZooKeeper is used to store metadata about replicas, when using Replicated tables.
583 # Optional. If you don't use replicated tables, you could omit that.
584 # See https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/replication/
585
586 zookeeper:
587 - node:
588 host: 127.0.0.1
589 port: 9181
590
591 # Substitutions for parameters of replicated tables.
592 # Optional. If you don't use replicated tables, you could omit that.
593 # See https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/replication/#creating-replicated-tables
594 # macros:
595 # shard: 01
596 # replica: example01-01-1
597
598 # Reloading interval for embedded dictionaries, in seconds. Default: 3600.
599 builtin_dictionaries_reload_interval: 3600
600
601 # Maximum session timeout, in seconds. Default: 3600.
602 max_session_timeout: 3600
603
604 # Default session timeout, in seconds. Default: 60.
605 default_session_timeout: 60
606
607 # Sending data to Graphite for monitoring. Several sections can be defined.
608 # interval - send every X second
609 # root_path - prefix for keys
610 # hostname_in_path - append hostname to root_path (default = true)
611 # metrics - send data from table system.metrics
612 # events - send data from table system.events
613 # asynchronous_metrics - send data from table system.asynchronous_metrics
614
615 # graphite:
616 # host: localhost
617 # port: 42000
618 # timeout: 0.1
619 # interval: 60
620 # root_path: one_min
621 # hostname_in_path: true
622
623 # metrics: true
624 # events: true
625 # events_cumulative: false
626 # asynchronous_metrics: true
627
628 # graphite:
629 # host: localhost
630 # port: 42000
631 # timeout: 0.1
632 # interval: 1
633 # root_path: one_sec
634
635 # metrics: true
636 # events: true
637 # events_cumulative: false
638 # asynchronous_metrics: false
639
640 # Serve endpoint for Prometheus monitoring.
641 # endpoint - mertics path (relative to root, statring with "/")
642 # port - port to setup server. If not defined or 0 than http_port used
643 # metrics - send data from table system.metrics
644 # events - send data from table system.events
645 # asynchronous_metrics - send data from table system.asynchronous_metrics
646
647 # prometheus:
648 # endpoint: /metrics
649 # port: 9363
650
651 # metrics: true
652 # events: true
653 # asynchronous_metrics: true
654
655 # Query log. Used only for queries with setting log_queries = 1.
656 query_log:
657 # What table to insert data. If table is not exist, it will be created.
658 # When query log structure is changed after system update,
659 # then old table will be renamed and new table will be created automatically.
660 database: system
661 table: query_log
662
663 # PARTITION BY expr: https://clickhouse.com/docs/en/table_engines/mergetree-family/custom_partitioning_key/
664 # Example:
665 # event_date
666 # toMonday(event_date)
667 # toYYYYMM(event_date)
668 # toStartOfHour(event_time)
669 partition_by: toYYYYMM(event_date)
670
671 # Table TTL specification: https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree/#mergetree-table-ttl
672 # Example:
673 # event_date + INTERVAL 1 WEEK
674 # event_date + INTERVAL 7 DAY DELETE
675 # event_date + INTERVAL 2 WEEK TO DISK 'bbb'
676
677 # ttl: 'event_date + INTERVAL 30 DAY DELETE'
678
679 # Instead of partition_by, you can provide full engine expression (starting with ENGINE = ) with parameters,
680 # Example: engine: 'ENGINE = MergeTree PARTITION BY toYYYYMM(event_date) ORDER BY (event_date, event_time) SETTINGS index_granularity = 1024'
681
682 # Interval of flushing data.
683 flush_interval_milliseconds: 7500
684
685 # Trace log. Stores stack traces collected by query profilers.
686 # See query_profiler_real_time_period_ns and query_profiler_cpu_time_period_ns settings.
687 trace_log:
688 database: system
689 table: trace_log
690 partition_by: toYYYYMM(event_date)
691 flush_interval_milliseconds: 7500
692
693 # Query thread log. Has information about all threads participated in query execution.
694 # Used only for queries with setting log_query_threads = 1.
695 query_thread_log:
696 database: system
697 table: query_thread_log
698 partition_by: toYYYYMM(event_date)
699 flush_interval_milliseconds: 7500
700
701 # Query views log. Has information about all dependent views associated with a query.
702 # Used only for queries with setting log_query_views = 1.
703 query_views_log:
704 database: system
705 table: query_views_log
706 partition_by: toYYYYMM(event_date)
707 flush_interval_milliseconds: 7500
708
709 # Uncomment if use part log.
710 # Part log contains information about all actions with parts in MergeTree tables (creation, deletion, merges, downloads).
711 part_log:
712 database: system
713 table: part_log
714 partition_by: toYYYYMM(event_date)
715 flush_interval_milliseconds: 7500
716
717 # Uncomment to write text log into table.
718 # Text log contains all information from usual server log but stores it in structured and efficient way.
719 # The level of the messages that goes to the table can be limited (<level>), if not specified all messages will go to the table.
720 # text_log:
721 # database: system
722 # table: text_log
723 # flush_interval_milliseconds: 7500
724 # level: ''
725
726 # Metric log contains rows with current values of ProfileEvents, CurrentMetrics collected with "collect_interval_milliseconds" interval.
727 metric_log:
728 database: system
729 table: metric_log
730 flush_interval_milliseconds: 7500
731 collect_interval_milliseconds: 1000
732
733 # Error log contains rows with current values of errors collected with "collect_interval_milliseconds" interval.
734 error_log:
735 database: system
736 table: error_log
737 flush_interval_milliseconds: 7500
738 collect_interval_milliseconds: 1000
739
740 # Asynchronous metric log contains values of metrics from
741 # system.asynchronous_metrics.
742 asynchronous_metric_log:
743 database: system
744 table: asynchronous_metric_log
745
746 # Asynchronous metrics are updated once a minute, so there is
747 # no need to flush more often.
748 flush_interval_milliseconds: 60000
749
750 # OpenTelemetry log contains OpenTelemetry trace spans.
751 opentelemetry_span_log:
752
753 # The default table creation code is insufficient, this <engine> spec
754 # is a workaround. There is no 'event_time' for this log, but two times,
755 # start and finish. It is sorted by finish time, to avoid inserting
756 # data too far away in the past (probably we can sometimes insert a span
757 # that is seconds earlier than the last span in the table, due to a race
758 # between several spans inserted in parallel). This gives the spans a
759 # global order that we can use to e.g. retry insertion into some external
760 # system.
761 engine: |-
762 engine MergeTree
763 partition by toYYYYMM(finish_date)
764 order by (finish_date, finish_time_us, trace_id)
765 database: system
766 table: opentelemetry_span_log
767 flush_interval_milliseconds: 7500
768
769 # Crash log. Stores stack traces for fatal errors.
770 # This table is normally empty.
771 crash_log:
772 database: system
773 table: crash_log
774 partition_by: ''
775 flush_interval_milliseconds: 1000
776
777 # top_level_domains_path: /var/lib/clickhouse/top_level_domains/
778 # Custom TLD lists.
779 # Format: name: /path/to/file
780
781 # Changes will not be applied w/o server restart.
782 # Path to the list is under top_level_domains_path (see above).
783 top_level_domains_lists: ''
784
785 # public_suffix_list: /path/to/public_suffix_list.dat
786
787 # Configuration of external dictionaries. See:
788 # https://clickhouse.com/docs/en/sql-reference/dictionaries/external-dictionaries/external-dicts
789 dictionaries_config: '*_dictionary.xml'
790
791 # Uncomment if you want data to be compressed 30-100% better.
792 # Don't do that if you just started using ClickHouse.
793
794 # compression:
795 # # Set of variants. Checked in order. Last matching case wins. If nothing matches, lz4 will be used.
796 # case:
797 # Conditions. All must be satisfied. Some conditions may be omitted.
798 # # min_part_size: 10000000000 # Min part size in bytes.
799 # # min_part_size_ratio: 0.01 # Min size of part relative to whole table size.
800 # # What compression method to use.
801 # method: zstd
802
803 # Allow to execute distributed DDL queries (CREATE, DROP, ALTER, RENAME) on cluster.
804 # Works only if ZooKeeper is enabled. Comment it if such functionality isn't required.
805 distributed_ddl:
806 # Path in ZooKeeper to queue with DDL queries
807 path: /clickhouse/task_queue/ddl
808
809 # Settings from this profile will be used to execute DDL queries
810 # profile: default
811
812 # Controls how much ON CLUSTER queries can be run simultaneously.
813 # pool_size: 1
814
815 # Cleanup settings (active tasks will not be removed)
816
817 # Controls task TTL (default 1 week)
818 # task_max_lifetime: 604800
819
820 # Controls how often cleanup should be performed (in seconds)
821 # cleanup_delay_period: 60
822
823 # Controls how many tasks could be in the queue
824 # max_tasks_in_queue: 1000
825
826 # Settings to fine tune MergeTree tables. See documentation in source code, in MergeTreeSettings.h
827 # merge_tree:
828 # max_suspicious_broken_parts: 5
829
830 # Protection from accidental DROP.
831 # 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.
832 # 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.
833 # By default max_table_size_to_drop is 50GB; max_table_size_to_drop=0 allows to DROP any tables.
834 # The same for max_partition_size_to_drop.
835 # Uncomment to disable protection.
836
837 # max_table_size_to_drop: 0
838 # max_partition_size_to_drop: 0
839
840 # Example of parameters for GraphiteMergeTree table engine
841 graphite_rollup_example:
842 pattern:
843 regexp: click_cost
844 function: any
845 retention:
846 - age: 0
847 precision: 3600
848 - age: 86400
849 precision: 60
850 default:
851 function: max
852 retention:
853 - age: 0
854 precision: 60
855 - age: 3600
856 precision: 300
857 - age: 86400
858 precision: 3600
859
860 # Directory in <clickhouse-path> containing schema files for various input formats.
861 # The directory will be created if it doesn't exist.
862 format_schema_path: /var/lib/clickhouse/format_schemas/
863
864 # Default query masking rules, matching lines would be replaced with something else in the logs
865 # (both text logs and system.query_log).
866 # name - name for the rule (optional)
867 # regexp - RE2 compatible regular expression (mandatory)
868 # replace - substitution string for sensitive data (optional, by default - six asterisks)
869 query_masking_rules:
870 rule:
871 name: hide encrypt/decrypt arguments
872 regexp: '((?:aes_)?(?:encrypt|decrypt)(?:_mysql)?)\s*\(\s*(?:''(?:\\''|.)+''|.*?)\s*\)'
873 # or more secure, but also more invasive:
874 # (aes_\w+)\s*\(.*\)
875 replace: \1(???)
876
877 # Uncomment to use custom http handlers.
878 # rules are checked from top to bottom, first match runs the handler
879 # url - to match request URL, you can use 'regex:' prefix to use regex match(optional)
880 # methods - to match request method, you can use commas to separate multiple method matches(optional)
881 # 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)
882 # handler is request handler
883 # type - supported types: static, dynamic_query_handler, predefined_query_handler
884 # query - use with predefined_query_handler type, executes query when the handler is called
885 # 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
886 # status - use with static type, response status code
887 # content_type - use with static type, response content-type
888 # 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.
889
890 # http_handlers:
891 # - rule:
892 # url: /
893 # methods: POST,GET
894 # headers:
895 # pragma: no-cache
896 # handler:
897 # type: dynamic_query_handler
898 # query_param_name: query
899 # - rule:
900 # url: /predefined_query
901 # methods: POST,GET
902 # handler:
903 # type: predefined_query_handler
904 # query: 'SELECT * FROM system.settings'
905 # - rule:
906 # handler:
907 # type: static
908 # status: 200
909 # content_type: 'text/plain; charset=UTF-8'
910 # response_content: config://http_server_default_response
911
912 send_crash_reports:
913 # Changing <enabled> to true allows sending crash reports to
914 # the ClickHouse core developers team via Sentry https://sentry.io
915 # Doing so at least in pre-production environments is highly appreciated
916 enabled: false
917 # Change <anonymize> to true if you don't feel comfortable attaching the server hostname to the crash report
918 anonymize: false
919 # Default endpoint should be changed to different Sentry DSN only if you have
920 # some in-house engineers or hired consultants who're going to debug ClickHouse issues for you
921 endpoint: 'https://[email protected]/5226277'
922 # Uncomment to disable ClickHouse internal DNS caching.
923 # disable_internal_dns_cache: 1