This architecture helps manage data efficiently by storing recent data on fast machines and older data on slower, cheaper machines.
Hot-warm-cold architecture in Elasticsearch
Start learning this pattern below
Jump into concepts and practice - no test required
PUT /_ilm/policy/hot-warm-cold-policy
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_size": "50gb",
"max_age": "30d"
},
"set_priority": { "priority": 100 }
}
},
"warm": {
"min_age": "30d",
"actions": {
"allocate": {
"require": { "data": "warm" }
},
"set_priority": { "priority": 50 }
}
},
"cold": {
"min_age": "90d",
"actions": {
"allocate": {
"require": { "data": "cold" }
},
"set_priority": { "priority": 0 },
"freeze": {}
}
}
}
}
}The policy defines phases: hot, warm, and cold with actions for each.
Use allocate to move data to nodes with matching attributes.
PUT /_ilm/policy/simple-hot-warm
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": { "max_age": "7d" },
"set_priority": { "priority": 100 }
}
},
"warm": {
"min_age": "7d",
"actions": {
"allocate": { "require": { "data": "warm" } },
"set_priority": { "priority": 50 }
}
}
}
}
}PUT /_template/logs_template
{
"index_patterns": ["logs-*"],
"settings": {
"index.lifecycle.name": "hot-warm-cold-policy",
"index.lifecycle.rollover_alias": "logs-alias"
}
}This program creates a hot-warm-cold lifecycle policy, sets an index template to use it, and creates the first index with a rollover alias.
PUT /_ilm/policy/hot-warm-cold-policy
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_size": "50gb",
"max_age": "30d"
},
"set_priority": { "priority": 100 }
}
},
"warm": {
"min_age": "30d",
"actions": {
"allocate": {
"require": { "data": "warm" }
},
"set_priority": { "priority": 50 }
}
},
"cold": {
"min_age": "90d",
"actions": {
"allocate": {
"require": { "data": "cold" }
},
"set_priority": { "priority": 0 },
"freeze": {}
}
}
}
}
}
PUT /_template/logs_template
{
"index_patterns": ["logs-*"],
"settings": {
"index.lifecycle.name": "hot-warm-cold-policy",
"index.lifecycle.rollover_alias": "logs-alias"
}
}
PUT /logs-000001
{
"aliases": {
"logs-alias": {
"is_write_index": true
}
}
}Make sure your Elasticsearch nodes have attributes like node.attr.data: warm or cold to allocate data properly.
Rollover helps create new indices automatically when size or age limits are reached.
Freezing cold indices reduces resource use but makes searches slower.
Hot-warm-cold architecture stores recent data on fast nodes and older data on slower, cheaper nodes.
Use index lifecycle management (ILM) policies to automate data movement between phases.
Rollover and allocation actions help manage data size and location efficiently.
Practice
Solution
Step 1: Understand the architecture purpose
The hot-warm-cold architecture is designed to optimize storage costs and performance by placing recent data on fast nodes and older data on slower, cheaper nodes.Step 2: Match the purpose to options
To store recent data on fast nodes and older data on slower, cheaper nodes correctly describes this purpose, while other options describe different Elasticsearch features.Final Answer:
To store recent data on fast nodes and older data on slower, cheaper nodes -> Option BQuick Check:
Hot-warm-cold architecture = store data by age and speed [OK]
- Confusing hot-warm-cold with backup or replication
- Thinking it encrypts data automatically
- Assuming it manages cluster replication
Solution
Step 1: Identify automation for data phase movement
Index Lifecycle Management (ILM) automates moving indices through hot, warm, and cold phases based on policies.Step 2: Compare other features
Snapshot and Restore handles backups, Cross-cluster Search queries multiple clusters, and Document Level Security controls access, so they don't automate data movement.Final Answer:
Index Lifecycle Management (ILM) -> Option CQuick Check:
ILM automates data phase transitions [OK]
- Choosing Snapshot instead of ILM
- Confusing security features with lifecycle management
- Thinking cross-cluster search manages data phases
{
"phases": {
"hot": {"min_age": "0d"},
"warm": {"min_age": "7d"},
"cold": {"min_age": "30d"}
}
}Solution
Step 1: Analyze min_age values for phases
The policy defines hot from 0 days, warm from 7 days, and cold from 30 days.Step 2: Determine phase after 30 days
After 30 days, the index reaches the cold phase because its min_age is 30 days, which is the threshold for cold.Final Answer:
Cold phase -> Option AQuick Check:
30 days = cold phase start [OK]
- Choosing warm phase after 30 days
- Confusing delete phase with cold phase
- Ignoring min_age thresholds
{
"phases": {
"hot": {"min_age": "0d"},
"warm": {"min_age": "10d"}
}
}
What is the likely problem?Solution
Step 1: Understand ILM phase transition requirements
For an index to move from hot to warm, rollover conditions like size or age must be met.Step 2: Identify missing trigger
If the index size is too small, rollover won't happen, so the index stays in hot phase and never moves to warm.Final Answer:
The index size is too small to trigger rollover -> Option AQuick Check:
Small index size blocks rollover and phase move [OK]
- Assuming missing allocation causes no move
- Thinking warm phase min_age is too low
- Believing cold phase is required to move to warm
Solution
Step 1: Identify required phase ages
Indices older than 60 days should move to cold, and older than 90 days should be deleted.Step 2: Match policy phases to requirements
{ "phases": { "hot": {"min_age": "0d"}, "cold": {"min_age": "60d"}, "delete": {"min_age": "90d"} } } has hot at 0d, cold at 60d, and delete at 90d, matching the requirements exactly.Final Answer:
{ "phases": { "hot": {"min_age": "0d"}, "cold": {"min_age": "60d"}, "delete": {"min_age": "90d"} } } -> Option DQuick Check:
60d cold and 90d delete phases match [OK]
- Adding unnecessary warm phase with wrong min_age
- Setting delete phase too early
- Skipping cold phase before delete
