Hot/cold data separation
The Lindorm search engine allows you to configure hot and cold properties for an index. This feature enables you to store different index data on different storage media and implement hot/cold data separation over time by using time-partitioning. As newly written data ages, it is often queried less frequently. Moving less-queried data from high-performance hot storage to cost-effective cold storage significantly improves storage utilization and reduces costs. When you use a time-partitioned index, you can set a hot/cold data boundary based on your business needs. The system automatically moves data older than this boundary from hot to cold storage.
Prerequisites
-
Version requirements
-
The search engine version must be 3.9.30.2 or later. To upgrade your version, see Upgrade Minor Version.
-
The underlying storage version must be 4.5.17.2 or later.
-
For a Lindorm instance where the Service Type is Lindorm, you can view or upgrade the Underlying Storage version in the Configurations section of the console. To upgrade, see Upgrade Minor Version.
-
For a Lindorm instance where the Service Type is Lindorm V1: Contact Lindorm technical support (DingTalk ID: s0s3eg3) to obtain your current version number or to request an upgrade.
-
To check the service type, see Product Series.
-
-
-
Storage configuration
-
The instance must have two or more different types of storage.
-
If you choose capacity cloud storage for cold storage, you must first Enable Capacity Cloud Storage.
-
Usage notes
-
Automated hot/cold data separation works only with a time-partitioned index. The system uses a time field to determine when to move a partition to cold storage, then automatically marks the partition as a cold index and migrates its data.
-
For limitations related to different storage types, see the storage combinations described below.
Storage combinations
The search engine's hot/cold data separation feature supports two storage combinations, each suited for different use cases. Before using this feature, evaluate your business requirements and choose the appropriate storage combination.
|
Combination |
Hot storage medium |
Cold storage medium |
Read/write support |
Scaling method |
|
Capacity cloud storage + hot storage |
standard cloud storage, performance cloud storage, or local SSD |
|
Cloud storage can be scaled on demand. |
|
|
local SSD + cloud storage |
local SSD |
cloud storage |
Data in both hot and cold storage supports read and write operations. |
|
Automated hot/cold separation
Create a time-partitioned index
The following example creates a new partition index every 7 days, starting 30 days before the current date. The system assigns data to the corresponding partition index based on the createTime field.
PUT _index_template/cold-hot-test
{
"index_patterns": "cold-hot-test",
"data_stream": {
"timestamp_field": {
"name": "createTime"
}
},
"template": {
"settings": {
"number_of_shards": 4,
"index.mode": "time_partition",
"index.partition.start": "30d",
"index.partition.interval": "7d"
}
}
}
PUT _data_stream/cold-hot-test
Set the hot/cold data boundary
You can set a hot/cold data boundary based on data volume and query time ranges to archive data to cold storage. If a time partition meets the condition current time - end time of the time partition >= hot/cold data boundary, the system treats all data in that partition as cold data.
The hot/cold data boundary is set in seconds (s).
PUT /_data_stream/cold-hot-test/_settings
{
"index.partition.chs": "604800"
}
In the example above, the hot/cold data boundary for the cold-hot-test time partition is set to 7 days (604,800 seconds). When the newest data in a partition index is older than 7 days, the system automatically moves the partition index to cold storage.
Run the following command and check the index_partition_range field in the response to confirm the time range covered by the partition index.
GET /<backIndexName>
The <backIndexName> starts with .ds. For example, .ds-cold-hot-test-2025.09.13-000111 is a partition index for the cold-hot-test time partition.
If you use capacity cloud storage as your cold storage, a partition index becomes read-only after it begins moving to cold storage. Write requests for a time range that falls within the cold data period will fail with an error indicating that the target index is write-protected. If your business logic allows data writes for cold partitions to be ignored (for example, writing year-old log data when the boundary is one year), you can configure the following setting:
PUT /_data_stream/cold-hot-test/_settings
{
"index.partition.skip_write_cold": "true"
}
Define hot and cold storage media
You must configure the following setting if your instance does not use the capacity cloud storage + hot storage combination, or if you need to adjust the hot/cold data boundary and allow cold data to automatically move back to hot storage.
If you cannot find the STORAGE_POLICY corresponding to your instance's storage type in the table below, contact Lindorm technical support (DingTalk ID: s0s3eg3) for assistance.
PUT /_data_stream/cold-hot-test/_settings
{
"index.partition.storage_policy": "{COLD_STORAGE}|{HOT_STORAGE}"
}
Manage index storage media
The Lindorm search engine lets you specify storage for an index by modifying its settings with an Elasticsearch API. The relevant configuration item is index.storage_policy. The values for different storage media are as follows:
|
Storage medium ( |
Value ( |
|
standard cloud storage |
STANDARD_CLOUD_STORAGE |
|
performance cloud storage |
PERFORMANCE_CLOUD_STORAGE |
|
capacity cloud storage |
CAPACITY_CLOUD_STORAGE |
|
local SSD |
LOCAL_SSD_STORAGE |
If your purchased storage type is not listed in the table, contact Lindorm technical support (DingTalk ID: s0s3eg3) for assistance.
You can specify the storage type when creating an index or update it later. When you change the storage type of an existing index, the service asynchronously migrates the index's data to the new medium. All new data is written directly to the specified storage type.
# Specify the storage medium when creating an index
PUT <indexName>
{
"settings": {
"index": {
"number_of_shards": ...,
"storage_policy": "{STORAGE_POLICY}"
}
}
}
# You must run a forcemerge operation before setting the index storage type to capacity cloud storage
POST <indexName>/_forcemerge?max_num_segments=1
# Update the storage medium after creating an index
PUT <indexName>/_settings
{
"index.storage_policy": "{STORAGE_POLICY}"
}
If you need to set the index storage type to capacity cloud storage, you must first run a forcemerge operation to ensure each shard has only one segment.
Verify data migration
In the console, check the storage usage for each medium to confirm that the data has been migrated.