plausible-hosting/clickhouse/clickhouse-config.xml

41 lines
1.2 KiB
XML
Raw Normal View History

<clickhouse>
<logger>
<level>warning</level>
</logger>
2024-07-17 11:34:25 -05:00
<!--
Avoid the warning: "Listen [::]:9009 failed: Address family for hostname not supported".
If Docker has IPv6 disabled, bind ClickHouse to IPv4 to prevent this issue.
Add this to the configuration to ensure it listens on all IPv4 interfaces:
<listen_host>0.0.0.0</listen_host>
-->
2024-07-17 11:34:25 -05:00
<query_log replace="1">
<database>system</database>
<table>query_log</table>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<engine>
ENGINE = MergeTree
PARTITION BY event_date
ORDER BY (event_time)
TTL event_date + interval 90 day
SETTINGS ttl_only_drop_parts=1
</engine>
</query_log>
<metric_log>
<partition_by>event_date</partition_by>
<ttl>event_date + INTERVAL 30 DAY DELETE</ttl>
</metric_log>
<asynchronous_metric_log>
<partition_by>event_date</partition_by>
<ttl>event_date + INTERVAL 30 DAY DELETE</ttl>
</asynchronous_metric_log>
<!-- Stop unnecessary logging -->
<query_thread_log remove="remove"/>
<text_log remove="remove"/>
<trace_log remove="remove"/>
</clickhouse>