diff --git a/.gitignore b/.gitignore index 4e33a3c..329cc50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ * !compose.yml -!clickhouse/logs.xml +!clickhouse/clickhouse-config.xml +!clickhouse/clickhouse-user-config.xml !clickhouse/ipv4-only.xml !README.md !LICENSE diff --git a/clickhouse/clickhouse-config.xml b/clickhouse/clickhouse-config.xml new file mode 100644 index 0000000..886c9e6 --- /dev/null +++ b/clickhouse/clickhouse-config.xml @@ -0,0 +1,17 @@ + + + warning + true + + + + + + + + + + + + + diff --git a/clickhouse/clickhouse-user-config.xml b/clickhouse/clickhouse-user-config.xml new file mode 100644 index 0000000..d128cc7 --- /dev/null +++ b/clickhouse/clickhouse-user-config.xml @@ -0,0 +1,17 @@ + + + + 0 + 0 + 1024 + 1 + 0 + 0 + + + + 60 + 90 + 524288000 + + diff --git a/clickhouse/logs.xml b/clickhouse/logs.xml deleted file mode 100644 index 0eac674..0000000 --- a/clickhouse/logs.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - warning - true - - - - system - query_log
- 7500 - - ENGINE = MergeTree - PARTITION BY event_date - ORDER BY (event_time) - TTL event_date + interval 30 day - SETTINGS ttl_only_drop_parts=1 - -
- - - event_date - event_date + INTERVAL 30 DAY DELETE - - - - event_date - event_date + INTERVAL 30 DAY DELETE - - - - - - - - -
diff --git a/compose.yml b/compose.yml index ec0af50..527dad4 100644 --- a/compose.yml +++ b/compose.yml @@ -14,9 +14,8 @@ services: image: clickhouse/clickhouse-server:24.11.1.2557-alpine restart: always volumes: - - event-data:/var/lib/clickhouse - - event-logs:/var/log/clickhouse-server - - ./clickhouse/logs.xml:/etc/clickhouse-server/config.d/logs.xml:ro + - ./clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro + - ./clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/config.d/user.xml:ro # This makes ClickHouse bind to IPv4 only, since Docker doesn't enable IPv6 in bridge networks by default. # Fixes "Listen [::]:9000 failed: Address family for hostname not supported" warnings. - ./clickhouse/ipv4-only.xml:/etc/clickhouse-server/config.d/ipv4-only.xml:ro