How to Archive Logs to Third-Party Storage
Currently, the logs generated by the platform will be stored in the log storage component; however, the retention period for these logs is relatively short. For enterprises with high compliance requirements, logs typically require longer retention times to meet audit demands. Additionally, the economic aspect of storage is also one of the key concerns for enterprises.
Based on the above scenarios, the platform offers a log archiving solution, allowing users to transfer logs to external NFS or object storage.
This document describes the log export or archive solution that transfers logs out of the platform to external storage.
If you want ClickHouse to use S3 as its native log data storage or cold data storage, see How to Use S3 Storage with ClickHouse and Installation.
The archive workflow below launches a standalone razor consumer --database-type=file Deployment that reads the platform's Kafka topics and writes to NFS or S3. The example manifests were captured against ACP 4.3 and still describe the intended pattern, but several details drift on ACP 4.4:
- The example Razor image tag (
v3.16.0-beta.3.g3df8e987) is stale. Read the current image tag from the runningdeployment/razoron the storage cluster before you copy the example. - The example uses
serviceAccount: lanaya. On ACP 4.4 ClickHouse or OpenSearch clusters there is nolanayaServiceAccount; use the current archive ServiceAccount that ships with the storage operator, or create your own SA withpods/exec,secrets/get, and access to the archivehostPath. - The example mounts
kafka-basic-authfrom the ACP 4.3 chart layout. In ACP 4.4 the Kafka credentials live inplatform-default-mq-conn(see the Kafka connection Secret section of Installation). Either mountplatform-default-mq-connand adjust the razor consumer flags to read SASL from those keys, or copy the credentials into a Secret with the layout the example expects.
For a v4.4-verified archive workflow, please contact support. The pattern below still works on the Elasticsearch (legacy) backend as documented.
On Alauda OS nodes, the host directory that the log export Deployment mounts must be under /var/cpaas, for example /var/cpaas/data/logarchive. These nodes are immutable and /cpaas, the layout of the traditional operating system, is not writable there. Change only spec.template.spec.volumes[].hostPath.path in the examples below; the mountPath values and the output.path value in the log-exporter-config ConfigMap are paths inside the container and stay unchanged.
TOC
Transfer to External NFSPrerequisitesCreate Log Synchronization ResourcesTransfer to External S3 StoragePrerequisitesCreate Log Synchronization ResourcesTransfer to External NFS
Prerequisites
Create Log Synchronization Resources
-
Click on Cluster Management > Clusters in the left navigation bar.
-
Click the action button on the right side of the cluster where the logs will be transferred > CLI Tool.
-
Modify the YAML based on the following parameter descriptions; after modifying, paste the code into the open CLI Tool command line and hit enter to execute.
-
Once the container status changes to Running, you can view the continuously archived logs in the NFS path; the log file directory structure is as follows:
Transfer to External S3 Storage
Prerequisites
Create Log Synchronization Resources
-
Click on Cluster Management > Clusters in the left navigation bar.
-
Click the action button on the right side of the cluster where the logs will be transferred > CLI Tool.
-
Modify the YAML based on the following parameter descriptions; after modifying, paste the code into the open CLI Tool command line and hit enter to execute.
-
Once the container status changes to Running, you can view the continuously archived logs in the bucket.