Elasticsearch index.routing.allocation.require._tier Setting

The index.routing.allocation.require._tier setting in Elasticsearch controls which data tier an index should be allocated to. It's part of Elasticsearch's data tiers feature, which allows for more efficient data management across hot, warm, cold, and frozen tiers.

  • Default value: Not set (index can be allocated to any tier)
  • Possible values: data_hot, data_warm, data_cold, data_frozen
  • Recommendations: Set this based on your data lifecycle and performance requirements. Typically, newer or frequently accessed indices should be on hotter tiers.

Example

To set an index to be allocated only to the hot tier:

PUT /my-index/_settings
{
  "index.routing.allocation.require._tier": "data_hot"
}

You might want to change this setting when moving data through its lifecycle. For example, as data ages, you might move it from hot to warm, then to cold tiers.

Common Issues

  • Misconfiguration can lead to indices not being allocated if the specified tier doesn't exist.
  • Overuse of hot tier can lead to performance issues and increased costs.

Do's and Don'ts

  • Do use this setting as part of a broader data lifecycle management strategy.
  • Do monitor your cluster to ensure proper balance across tiers.
  • Don't set this without considering your hardware capabilities and data access patterns.
  • Don't forget to adjust related settings like index.routing.allocation.include._tier_preference for a comprehensive tier strategy.

Frequently Asked Questions

Q: Can an index be allocated to multiple tiers simultaneously?
A: No, an index can only be allocated to one tier at a time. However, you can use the index.routing.allocation.include._tier_preference setting to specify a list of preferred tiers in order.

Q: How does this setting interact with node attributes?
A: This setting takes precedence over node attributes. If set, the index will only be allocated to nodes in the specified tier, regardless of other node attributes.

Q: What happens if I set this to a tier that doesn't exist in my cluster?
A: The index will remain unallocated until a node with the specified tier becomes available or the setting is changed.

Q: Can I use this setting with index templates?
A: Yes, you can include this setting in index templates to automatically apply tier preferences to new indices.

Q: How does changing this setting affect existing data?
A: Changing this setting will trigger a reallocation of the index shards to nodes in the new tier. This can involve data migration, which may impact cluster performance during the process.

Pulse - Elasticsearch Operations Done Right

Stop googling errors and staring at dashboards.

Free Trial

Subscribe to the Pulse Newsletter

Get early access to new Pulse features, insightful blogs & exclusive events , webinars, and workshops.