From 25b4927ba3f8b9d1e81fbd01b83bbd056665873a Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Tue, 19 Sep 2023 01:12:44 +0300 Subject: [PATCH 1/2] PMM-12223 Update clickhouse. --- .../tasks/roles/clickhouse/defaults/main.yml | 2 +- .../tasks/roles/clickhouse/files/config.xml | 586 ++++++++++++++---- .../tasks/roles/clickhouse/tasks/main.yml | 11 +- 3 files changed, 473 insertions(+), 126 deletions(-) diff --git a/update/ansible/playbook/tasks/roles/clickhouse/defaults/main.yml b/update/ansible/playbook/tasks/roles/clickhouse/defaults/main.yml index cbed66f833..d3fdd3aa69 100644 --- a/update/ansible/playbook/tasks/roles/clickhouse/defaults/main.yml +++ b/update/ansible/playbook/tasks/roles/clickhouse/defaults/main.yml @@ -1 +1 @@ -clickhouse_version: 21.3.20.1-2 +clickhouse_version: 23.8.2.7 diff --git a/update/ansible/playbook/tasks/roles/clickhouse/files/config.xml b/update/ansible/playbook/tasks/roles/clickhouse/files/config.xml index 4998380847..a54280ccf4 100644 --- a/update/ansible/playbook/tasks/roles/clickhouse/files/config.xml +++ b/update/ansible/playbook/tasks/roles/clickhouse/files/config.xml @@ -1,11 +1,10 @@ - - + information 1 - + /var/log/clickhouse-server/clickhouse-server.log + /var/log/clickhouse-server/clickhouse-server.err.log + 1000M + 10 + + + + + + @@ -124,12 +178,13 @@ + + - 0.0.0.0 + + + + + @@ -169,7 +229,7 @@ --> - + 4096 @@ -191,13 +251,12 @@ /path/to/ssl_ca_cert_file - - deflate + deflate - - medium + + 2 -1 @@ -224,6 +283,13 @@ true sslv2,sslv3 true + + + + RejectCertificateHandler + @@ -244,8 +310,15 @@
]]>
--> + + 0 + 0 + - 100 + 1000 + + 0.9 @@ -318,7 +405,7 @@ The amount of data in mapped files can be monitored in system.metrics, system.metric_log by the MMappedFiles, MMappedFileBytes metrics and in system.asynchronous_metrics, system.asynchronous_metrics_log by the MMapCacheCells metric, - and also in system.events, system.processes, system.query_log, system.query_thread_log by the + and also in system.events, system.processes, system.query_log, system.query_thread_log, system.query_views_log by the CreatedReadBufferMMap, CreatedReadBufferMMapFailed, MMappedFileCacheHits, MMappedFileCacheMisses events. Note that the amount of data in mapped files does not consume memory directly and is not accounted in query or server memory usage - because this memory can be discarded similar to OS page cache. @@ -327,15 +414,110 @@ --> 1000 - - 1073741824 + + 134217728 + + + 10000 + + false /srv/clickhouse/ + + + + /srv/clickhouse/tmp/ + + 1 + 1 + 1 + + + sha256_password + + + 12 + + + + + + + false + + + false + + + false + + + false + + + false + + + 600 + + default - + @@ -537,9 +758,9 @@ If not specified, system time zone at server startup is used. Please note, that server could display time zone alias instead of specified name. - Example: W-SU is an alias for Europe/Moscow and Zulu is an alias for UTC. + Example: Zulu is an alias for UTC. --> - + - + + + - - - - - localhost - 9000 - - - - - localhost - 9000 - - - - - - - 127.0.0.1 - 9000 - - - - - 127.0.0.2 - 9000 - - - - - - true - - 127.0.0.1 - 9000 - - - - true - - 127.0.0.2 - 9000 - - - - - - - localhost - 9440 - 1 - - - - - - - localhost - 9000 - - - - - localhost - 1 - - - + - + - + + + + toYYYYMM(event_date) + + 7500 + + 1048576 + + 8192 + + 524288 + + false + + + + false + + system + query_views_log
+ toYYYYMM(event_date) + 7500 +
+ system part_log
+ toYYYYMM(event_date) 7500 + 1048576 + 8192 + 524288 + false
- --> @@ -899,7 +1112,11 @@ system metric_log
7500 + 1048576 + 8192 + 524288 1000 + false - 60000 + 7000 + 1048576 + 8192 + 524288 + false + - + toYYYYMM(event_date) + 7500 + 1048576 + 8192 + 524288 + false + --> + + + + system + processors_profile_log
- - + toYYYYMM(event_date) + 7500 + 1048576 + 8192 + 524288 + false +
+ + + + system + asynchronous_insert_log
+ 7500 + 1048576 + 8192 + 524288 + false + event_date + event_date + INTERVAL 3 DAY +
- *_dictionary.xml + *_dictionary.*ml + + + *_function.*ml + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1152,4 +1446,48 @@ -
\ No newline at end of file + + + + + + + 1073741824 + 1024 + 1048576 + 30000000 + + + + + + \ No newline at end of file diff --git a/update/ansible/playbook/tasks/roles/clickhouse/tasks/main.yml b/update/ansible/playbook/tasks/roles/clickhouse/tasks/main.yml index 2fb89b954b..b1ae5c18cb 100644 --- a/update/ansible/playbook/tasks/roles/clickhouse/tasks/main.yml +++ b/update/ansible/playbook/tasks/roles/clickhouse/tasks/main.yml @@ -37,12 +37,21 @@ enabled: no ignore_errors: true +# This will implicitly create /srv/clickhouse - name: Create clickhouse data directory file: - path: "/srv/clickhouse" + path: "/srv/clickhouse/flags" state: directory owner: root group: pmm + recurse: true + +- name: Create empty file to convert clickhouse databases from ordinary to atomic + file: + path: "/srv/clickhouse/flags/convert_ordinary_to_atomic" + state: touch + owner: root + group: pmm # RHEL9 dropped support for SHA1 gpg keys - name: Import clickhouse repo GPG key From 2ad78313d77b4a49dbf04e341f404d0d1d004656 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Thu, 28 Sep 2023 16:54:57 +0300 Subject: [PATCH 2/2] PMM-12223 update logs path --- .../ansible/playbook/tasks/roles/clickhouse/files/config.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/update/ansible/playbook/tasks/roles/clickhouse/files/config.xml b/update/ansible/playbook/tasks/roles/clickhouse/files/config.xml index a54280ccf4..6a1148b12f 100644 --- a/update/ansible/playbook/tasks/roles/clickhouse/files/config.xml +++ b/update/ansible/playbook/tasks/roles/clickhouse/files/config.xml @@ -23,8 +23,8 @@ --> information 1 - /var/log/clickhouse-server/clickhouse-server.log - /var/log/clickhouse-server/clickhouse-server.err.log + /srv/logs/clickhouse-server.log + /srv/logs/clickhouse-server.err.log