config.xml 62 KB

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