Skip to content

Commit 3a3f81d

Browse files
committed
Enable DiskThresholdDecider by default, change default limits to 85/90%
Fixes #6200 Fixes #6201
1 parent 35cba50 commit 3a3f81d

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

docs/reference/index-modules/allocation.asciidoc

+10-8
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ to be allocated to a node. This is in contrast to `include` which will
4343
include a node if ANY rule matches.
4444

4545
The `include`, `exclude` and `require` values can have generic simple
46-
matching wildcards, for example, `value1*`. Additonally, special attribute
47-
names called `_ip`, `_name`, `_id` and `_host` can be used to match by node
46+
matching wildcards, for example, `value1*`. Additonally, special attribute
47+
names called `_ip`, `_name`, `_id` and `_host` can be used to match by node
4848
ip address, name, id or host name, respectively.
4949

5050
Obviously a node can have several attributes associated with it, and
@@ -100,16 +100,18 @@ settings API.
100100
[[disk]]
101101
=== Disk-based Shard Allocation
102102

103+
coming[1.3.0] disk based shard allocation is enabled from version 1.3.0 onward
104+
103105
Elasticsearch can be configured to prevent shard
104106
allocation on nodes depending on disk usage for the node. This
105-
functionality is disabled by default, and can be changed either in the
107+
functionality is enabled by default, and can be changed either in the
106108
configuration file, or dynamically using:
107109

108110
[source,js]
109111
--------------------------------------------------
110112
curl -XPUT localhost:9200/_cluster/settings -d '{
111113
"transient" : {
112-
"cluster.routing.allocation.disk.threshold_enabled" : true
114+
"cluster.routing.allocation.disk.threshold_enabled" : false
113115
}
114116
}'
115117
--------------------------------------------------
@@ -118,15 +120,15 @@ Once enabled, Elasticsearch uses two watermarks to decide whether
118120
shards should be allocated or can remain on the node.
119121

120122
`cluster.routing.allocation.disk.watermark.low` controls the low
121-
watermark for disk usage. It defaults to 70%, meaning ES will not
122-
allocate new shards to nodes once they have more than 70% disk
123+
watermark for disk usage. It defaults to 85%, meaning ES will not
124+
allocate new shards to nodes once they have more than 85% disk
123125
used. It can also be set to an absolute byte value (like 500mb) to
124126
prevent ES from allocating shards if less than the configured amount
125127
of space is available.
126128

127129
`cluster.routing.allocation.disk.watermark.high` controls the high
128-
watermark. It defaults to 85%, meaning ES will attempt to relocate
129-
shards to another node if the node disk usage rises above 85%. It can
130+
watermark. It defaults to 90%, meaning ES will attempt to relocate
131+
shards to another node if the node disk usage rises above 90%. It can
130132
also be set to an absolute byte value (similar to the low watermark)
131133
to relocate shards once less than the configured amount of space is
132134
available on the node.

src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public DiskThresholdDecider(Settings settings) {
110110
@Inject
111111
public DiskThresholdDecider(Settings settings, NodeSettingsService nodeSettingsService) {
112112
super(settings);
113-
String lowWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK, "70%");
114-
String highWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK, "85%");
113+
String lowWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK, "85%");
114+
String highWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK, "90%");
115115

116116
if (!validWatermarkSetting(lowWatermark)) {
117117
throw new ElasticsearchParseException("Unable to parse low watermark: [" + lowWatermark + "]");
@@ -126,7 +126,7 @@ public DiskThresholdDecider(Settings settings, NodeSettingsService nodeSettingsS
126126
this.freeBytesThresholdLow = thresholdBytesFromWatermark(lowWatermark);
127127
this.freeBytesThresholdHigh = thresholdBytesFromWatermark(highWatermark);
128128

129-
this.enabled = settings.getAsBoolean(CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED, false);
129+
this.enabled = settings.getAsBoolean(CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED, true);
130130
nodeSettingsService.addListener(new ApplySettings());
131131
}
132132

0 commit comments

Comments
 (0)