The index.routing.allocation.include._tier
setting in Elasticsearch controls which data tiers an index can be allocated to. It is part of the data tiers feature, which allows for more efficient data management and hardware utilization.
- Default value: Not set (allows allocation to any tier)
- Possible values:
data_content
,data_hot
,data_warm
,data_cold
,data_frozen
- Recommendations: Set this based on your index's performance requirements and access patterns
This setting is used to specify which data tiers an index should be allocated to. It works in conjunction with the node roles to ensure that indices are placed on the appropriate hardware for their performance needs.
This setting is available from Elasticsearch 7.10.0 onwards, when the data tiers feature was introduced.
Example
To set an index to be allocated only to the hot tier:
PUT /my-index/_settings
{
"index.routing.allocation.include._tier": "data_hot"
}
You might want to change this setting when implementing a data lifecycle policy, moving less frequently accessed data to warmer or colder tiers to optimize resource usage and costs.
Common Issues
- Misconfiguration can lead to indices not being allocated if no nodes with the specified tier are available.
- Overuse of the hot tier can lead to performance issues and increased costs.
Do's and Don'ts
- Do use this setting in conjunction with Index Lifecycle Management (ILM) for automated data tiering.
- Do consider your data access patterns when setting tier preferences.
- Don't set conflicting tier preferences with other allocation settings.
- Don't ignore this setting when planning your cluster's hardware resources.
Frequently Asked Questions
Q: Can an index be allocated to multiple tiers?
A: Yes, you can specify multiple tiers by using a comma-separated list, e.g., "data_hot,data_warm".
Q: What happens if I don't set this preference?
A: Without this setting, an index can be allocated to any tier, which may not be optimal for performance or cost.
Q: How does this setting interact with ILM?
A: ILM can automatically update this setting as part of phase transitions, moving data through tiers based on age or other criteria.
Q: Can I change this setting on a closed index?
A: Yes, you can change this setting on a closed index, but it won't take effect until the index is opened.
Q: Does this setting affect existing shards or only new allocations?
A: This setting affects both existing shards and new allocations. Existing shards may be moved to comply with the new setting.