How to Set the Retention Time of Cold Data for a Project
This guide explains how to configure a project-level cold data retention policy when ClickHouse cold storage is enabled through the Cold and Hot Separate switch.
TOC
Before You BeginAbout Project-Level Retention SettingsEdit the Project ResourceLabel BehaviorVersion NotesRelated TopicsBefore You Begin
Make sure the following conditions are met:
- The cluster uses Alauda Container Platform Log Storage for ClickHouse.
- Cold and Hot Separate is enabled for the ClickHouse storage plugin.
- A cold data S3 Secret has already been configured for the ClickHouse storage plugin.
- You have permission to edit the target project in the
globalcluster.
About Project-Level Retention Settings
Project-level settings override the default retention behavior for logs that belong to the specified project.
Use the following labels on the Project resource:
Legacy labels still exist in some environments, but new configurations should use the labels above.
Edit the Project Resource
-
Log in to the
globalcluster. -
Open the target project resource:
-
Add or update the following labels:
Label Behavior
cpaas.io/project.hotDataRetentionDaysControls how long the project's hot data remains in active ClickHouse storage before it is moved or deleted according to the storage policy.cpaas.io/project.coldDataRetentionDaysControls how long the project's cold data is retained after it has been transferred to S3.cpaas.io/project.logPolicyEnabledMust be set totruefor the project-level retention policy to take effect.
Version Notes
- In ACP 4.2 environments, some old and new labels may coexist because of compatibility handling.
- In ACP 4.3 and later environments, use the new labels as the source of truth.
- If your environment still contains legacy labels such as
cpaas.io/project.esIndicesKeepDaysorcpaas.io/project.esPolicyEnabled, prefer the new labels for new configurations.
Related Topics
- For plugin-side cold storage configuration, see How to Use S3 Storage with ClickHouse.
- For ClickHouse installation parameters, see Installation.