|
2 | 2 | ==== Disk-based shard allocation settings
|
3 | 3 | [[disk-based-shard-allocation-description]]
|
4 | 4 | // tag::disk-based-shard-allocation-description-tag[]
|
5 |
| -{es} considers the available disk space on a node before deciding |
6 |
| -whether to allocate new shards to that node or to actively relocate shards away |
7 |
| -from that node. |
| 5 | + |
| 6 | +The disk-based shard allocator ensures that all nodes have enough disk space |
| 7 | +without performing more shard movements than necessary. It allocates shards |
| 8 | +based on a pair of thresholds known as the _low watermark_ and the _high |
| 9 | +watermark_. Its primary goal is to ensure that no node exceeds the high |
| 10 | +watermark, or at least that any such overage is only temporary. If a node |
| 11 | +exceeds the high watermark then {es} will solve this by moving some of its |
| 12 | +shards onto other nodes in the cluster. |
| 13 | + |
| 14 | +NOTE: It is normal for nodes to temporarily exceed the high watermark from time |
| 15 | +to time. |
| 16 | + |
| 17 | +The allocator also tries to keep nodes clear of the high watermark by |
| 18 | +forbidding the allocation of more shards to a node that exceeds the low |
| 19 | +watermark. Importantly, if all of your nodes have exceeded the low watermark |
| 20 | +then no new shards can be allocated and {es} will not be able to move any |
| 21 | +shards between nodes in order to keep the disk usage below the high watermark. |
| 22 | +You must ensure that your cluster has enough disk space in total and that there |
| 23 | +are always some nodes below the low watermark. |
| 24 | + |
| 25 | +Shard movements triggered by the disk-based shard allocator must also satisfy |
| 26 | +all other shard allocation rules such as |
| 27 | +<<cluster-shard-allocation-filtering,allocation filtering>> and |
| 28 | +<<forced-awareness,forced awareness>>. If these rules are too strict then they |
| 29 | +can also prevent the shard movements needed to keep the nodes' disk usage under |
| 30 | +control. If you are using <<data-tiers,data tiers>> then {es} automatically |
| 31 | +configures allocation filtering rules to place shards within the appropriate |
| 32 | +tier, which means that the disk-based shard allocator works independently |
| 33 | +within each tier. |
| 34 | + |
| 35 | +If a node is filling up its disk faster than {es} can move shards elsewhere |
| 36 | +then there is a risk that the disk will completely fill up. To prevent this, as |
| 37 | +a last resort, once the disk usage reaches the _flood-stage_ watermark {es} |
| 38 | +will block writes to indices with a shard on the affected node. It will also |
| 39 | +continue to move shards onto the other nodes in the cluster. When disk usage |
| 40 | +on the affected node drops below the high watermark, {es} automatically removes |
| 41 | +the write block. |
| 42 | + |
| 43 | +[[disk-based-shard-allocation-does-not-balance]] |
| 44 | +[TIP] |
| 45 | +==== |
| 46 | +It is normal for the nodes in your cluster to be using very different amounts |
| 47 | +of disk space. The <<shards-rebalancing-settings,balance>> of the cluster |
| 48 | +depends only on the number of shards on each node and the indices to which |
| 49 | +those shards belong. It considers neither the sizes of these shards nor the |
| 50 | +available disk space on each node, for the following reasons: |
| 51 | +
|
| 52 | +* Disk usage changes over time. Balancing the disk usage of individual nodes |
| 53 | +would require a lot more shard movements, perhaps even wastefully undoing |
| 54 | +earlier movements. Moving a shard consumes resources such as I/O and network |
| 55 | +bandwidth and may evict data from the filesystem cache. These resources are |
| 56 | +better spent handling your searches and indexing where possible. |
| 57 | +
|
| 58 | +* A cluster with equal disk usage on every node typically performs no better |
| 59 | +than one that has unequal disk usage, as long as no disk is too full. |
| 60 | +==== |
8 | 61 |
|
9 | 62 | You can use the following settings to control disk-based allocation:
|
10 | 63 |
|
|
0 commit comments