Elasticsearch cluster.routing.allocation.disk.threshold_enabled Setting

The cluster.routing.allocation.disk.threshold_enabled setting in Elasticsearch controls whether shard allocation should consider disk usage when making decisions. When enabled, this setting helps prevent nodes from running out of disk space by restricting shard allocation to nodes with sufficient disk space.

  • Default value: true
  • Possible values: true or false
  • Recommendation: Keep enabled unless you have a specific reason to disable it

When enabled, Elasticsearch uses two thresholds to determine shard allocation based on disk usage:

  1. Low watermark: Elasticsearch won't allocate new shards to nodes that have used more than 85% of their disk space.
  2. High watermark: Elasticsearch will attempt to relocate shards away from nodes that have used more than 90% of their disk space.

These watermark values can be customized using separate settings.

Example

To disable disk threshold-based shard allocation:

cluster.routing.allocation.disk.threshold_enabled: false

You might want to disable this setting if you're managing disk space externally or if you're experiencing issues with shard allocation due to temporary disk space constraints. However, disabling this setting can lead to nodes running out of disk space if not carefully managed.

Common Issues and Misuses

  • Disabling this setting without proper disk space management can lead to nodes running out of space and potential data loss.
  • Misunderstanding the interaction between this setting and custom watermark settings can lead to unexpected allocation behavior.

Do's and Don'ts

Do's:

  • Keep this setting enabled in most scenarios.
  • Monitor disk usage across your cluster regularly.
  • Adjust watermark levels if needed, rather than disabling the setting entirely.

Don'ts:

  • Don't disable this setting without a clear understanding of the potential consequences.
  • Don't ignore disk space alerts generated by Elasticsearch when this setting is enabled.

Frequently Asked Questions

Q: How does disabling cluster.routing.allocation.disk.threshold_enabled affect my cluster?
A: Disabling this setting means Elasticsearch will no longer consider disk usage when allocating shards. This can lead to nodes running out of disk space if not carefully managed externally.

Q: Can I adjust the disk usage thresholds without disabling this setting?
A: Yes, you can adjust the low and high watermark thresholds using separate settings while keeping this setting enabled.

Q: Will enabling this setting automatically move my shards if a node is low on disk space?
A: Yes, if a node exceeds the high watermark threshold, Elasticsearch will attempt to relocate shards from that node to others with more available disk space.

Q: How often does Elasticsearch check disk usage when this setting is enabled?
A: Elasticsearch regularly monitors disk usage and applies these thresholds during its normal shard allocation processes.

Q: Can this setting help prevent my cluster from running out of disk space?
A: While this setting helps manage shard allocation based on disk usage, it's not a complete solution for disk space management. Regular monitoring and capacity planning are still necessary.

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.