Retention and rollover
Manage how long your analytics subsystem stores data.
Each API event is recorded as a document in an OpenSearch index. When this index reaches a maximum size or age it is archived, and a new index is created for recording new API events. This is known as index rollover. When an archived index reaches a maximum age, which is known as the data retention maximum, it is deleted. You can specify the index rollover size and the data retention period in the Cloud Manager UI.
Error triggering forced rollover
To learn more about OpenSearch indices, see OpenSearch nodes, indices, shards, and replicas.
The index rollover settings determine how long an index accumulates data before it "rolls over" and a new index is created. You can control the duration of an index two ways: by setting a maximum age for the index (default is 1 day), or by setting a maximum number of documents that can be recorded in the index (default is 25 million documents). When the rollover occurs, a new index is created for new API events to be stored in, while the previous index is archived and kept until its age exceeds the data retention setting. If you change the rollover settings, consider both the amount of data to be stored within each index and the total number of indices. Allowing indices to grow too large, or storing too many indices, can cause performance problems.
Profile | Retention (days) |
---|---|
n1xc2.m16 | 3 |
n1xc4.m32 | 30 |
n1xc6.m48 | 45 |
n3xc4.m16 - DEPRECATED | 2 |
n3xc4.m32 | 30 |
n3xc6.m48 | 45 |
n3xc8.m64 | 45 |
The most recently created index (the index that is currently being written to) is not deleted, even if you set the retention period as small as 1 hour. If you regularly need to delete data quickly, adjust the index rollover so that a new index is rolled over to sooner, and the old index can be deleted.
Before an index is deleted, the API event data in the index is summarized and stored in a separate summary index to provide long-term data. The summary index has a separate retention setting, which is set to one year by default.
- From the Cloud
Manager UI, click
Topology.
- Select the Analytics Service you want to view or edit.
- Click Advanced settings.
- View the current retention and rollover settings by using the
clustermgmt:getStorageSettings
analytics CLI command:apic -m analytics clustermgmt:getStorageSettings --server <platform api endpoint> --analytics-service <analytics service name> --format json
<platform api endpoint>
is the platform API endpoint.<analytics service name>
is the name of analytics service as configured in the Cloud Manager UI.
- To update the retention and rollover settings create a JSON file that is called
retention_and_rollover_settings.json
, paste in the output from step 1 and set the retention and rollover setting as required. Apply these new settings with:clustermgmt:putStorageSettings
apic -m analytics clustermgmt:putStorageSettings --server <platform api endpoint> --analytics-service <analytics service name> retention_and_rollover_settings.json
<platform api endpoint>
is the platform API endpoint.<analytics service name>
is the name of analytics service as configured in the Cloud Manager UI.
If the retention or rollover process fails, the Cloud Manager and API Manager UIs show the following error message:
Error: Analytics internal storage rollover might be experiencing problems. Contact your system administrator to investigate further. Rollover failure means that data retention is not correctly enforced and storage usage continues to grow which can eventually lead to service shutdown.
If you see this error, then open a support case.