Elasticsearch index.routing.allocation.include._tier_preference Setting

The index.routing.allocation.include._tier_preference setting in Elasticsearch controls the data tier allocation preference for indices. It determines which data tiers an index should be allocated to, allowing for more granular control over index placement within a cluster.

  • Default value: data_content
  • Possible values: A comma-separated list of tier preferences, e.g., data_hot,data_warm,data_cold
  • Recommendations: Set this according to your data lifecycle management strategy and the performance requirements of your indices.

This setting is available from Elasticsearch version 7.10.0 onwards, coinciding with the introduction of data tiers.

Example

To change the tier preference for an existing index:

PUT /my-index/_settings
{
  "index.routing.allocation.include._tier_preference": "data_hot,data_warm"
}

This change would instruct Elasticsearch to prefer allocating the index shards to nodes in the hot tier first, then the warm tier if necessary. This might be desirable for an index that requires high performance but doesn't necessarily need to be on the fastest storage all the time.

Common Issues and Misuses

  • Setting an incompatible tier preference that doesn't match any available nodes in the cluster.
  • Overusing the hot tier by setting too many indices to prefer it, potentially leading to resource constraints.

Do's and Don'ts

  • Do align your tier preferences with your data lifecycle and performance needs.
  • Do consider using Index Lifecycle Management (ILM) to automatically adjust tier preferences over time.
  • Don't set tier preferences without considering the overall cluster architecture and available resources.
  • Don't ignore this setting when planning for cluster scaling or data growth.

Frequently Asked Questions

Q: How does the tier preference setting interact with other allocation settings?
A: The tier preference is considered alongside other allocation settings like shard allocation filtering. If there's a conflict, more specific allocation rules typically take precedence.

Q: Can I change the tier preference for multiple indices at once?
A: Yes, you can use the Index Templates or the Update Indices Settings API to apply changes to multiple indices matching a pattern.

Q: What happens if I set a tier preference for a tier that doesn't exist in my cluster?
A: The index will not be allocated if there are no nodes matching the specified tier preference. It's crucial to ensure that the specified tiers exist in your cluster.

Q: How does this setting affect index creation in a multi-tier environment?
A: When creating a new index, it will be allocated to nodes in the specified tier(s) if available. If not specified, it defaults to the data_content tier.

Q: Can changing this setting cause shard relocation?
A: Yes, changing the tier preference can trigger shard relocation if the current allocation doesn't match the new preference. This can impact cluster performance during the reallocation process.

Subscribe to the Pulse Newsletter

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

We use cookies to provide an optimized user experience and understand our traffic. To learn more, read our use of cookies; otherwise, please choose 'Accept Cookies' to continue using our website.