mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-13 08:25:26 +00:00
Enable DiskThresholdDecider by default, change default limits to 85/90%
Fixes #6200 Fixes #6201
This commit is contained in:
parent
35cba50fce
commit
3a3f81d59b
@ -100,16 +100,18 @@ settings API.
|
|||||||
[[disk]]
|
[[disk]]
|
||||||
=== Disk-based Shard Allocation
|
=== Disk-based Shard Allocation
|
||||||
|
|
||||||
|
coming[1.3.0] disk based shard allocation is enabled from version 1.3.0 onward
|
||||||
|
|
||||||
Elasticsearch can be configured to prevent shard
|
Elasticsearch can be configured to prevent shard
|
||||||
allocation on nodes depending on disk usage for the node. This
|
allocation on nodes depending on disk usage for the node. This
|
||||||
functionality is disabled by default, and can be changed either in the
|
functionality is enabled by default, and can be changed either in the
|
||||||
configuration file, or dynamically using:
|
configuration file, or dynamically using:
|
||||||
|
|
||||||
[source,js]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
curl -XPUT localhost:9200/_cluster/settings -d '{
|
curl -XPUT localhost:9200/_cluster/settings -d '{
|
||||||
"transient" : {
|
"transient" : {
|
||||||
"cluster.routing.allocation.disk.threshold_enabled" : true
|
"cluster.routing.allocation.disk.threshold_enabled" : false
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
@ -118,15 +120,15 @@ Once enabled, Elasticsearch uses two watermarks to decide whether
|
|||||||
shards should be allocated or can remain on the node.
|
shards should be allocated or can remain on the node.
|
||||||
|
|
||||||
`cluster.routing.allocation.disk.watermark.low` controls the low
|
`cluster.routing.allocation.disk.watermark.low` controls the low
|
||||||
watermark for disk usage. It defaults to 70%, meaning ES will not
|
watermark for disk usage. It defaults to 85%, meaning ES will not
|
||||||
allocate new shards to nodes once they have more than 70% disk
|
allocate new shards to nodes once they have more than 85% disk
|
||||||
used. It can also be set to an absolute byte value (like 500mb) to
|
used. It can also be set to an absolute byte value (like 500mb) to
|
||||||
prevent ES from allocating shards if less than the configured amount
|
prevent ES from allocating shards if less than the configured amount
|
||||||
of space is available.
|
of space is available.
|
||||||
|
|
||||||
`cluster.routing.allocation.disk.watermark.high` controls the high
|
`cluster.routing.allocation.disk.watermark.high` controls the high
|
||||||
watermark. It defaults to 85%, meaning ES will attempt to relocate
|
watermark. It defaults to 90%, meaning ES will attempt to relocate
|
||||||
shards to another node if the node disk usage rises above 85%. It can
|
shards to another node if the node disk usage rises above 90%. It can
|
||||||
also be set to an absolute byte value (similar to the low watermark)
|
also be set to an absolute byte value (similar to the low watermark)
|
||||||
to relocate shards once less than the configured amount of space is
|
to relocate shards once less than the configured amount of space is
|
||||||
available on the node.
|
available on the node.
|
||||||
|
@ -110,8 +110,8 @@ public class DiskThresholdDecider extends AllocationDecider {
|
|||||||
@Inject
|
@Inject
|
||||||
public DiskThresholdDecider(Settings settings, NodeSettingsService nodeSettingsService) {
|
public DiskThresholdDecider(Settings settings, NodeSettingsService nodeSettingsService) {
|
||||||
super(settings);
|
super(settings);
|
||||||
String lowWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK, "70%");
|
String lowWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK, "85%");
|
||||||
String highWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK, "85%");
|
String highWatermark = settings.get(CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK, "90%");
|
||||||
|
|
||||||
if (!validWatermarkSetting(lowWatermark)) {
|
if (!validWatermarkSetting(lowWatermark)) {
|
||||||
throw new ElasticsearchParseException("Unable to parse low watermark: [" + lowWatermark + "]");
|
throw new ElasticsearchParseException("Unable to parse low watermark: [" + lowWatermark + "]");
|
||||||
@ -126,7 +126,7 @@ public class DiskThresholdDecider extends AllocationDecider {
|
|||||||
this.freeBytesThresholdLow = thresholdBytesFromWatermark(lowWatermark);
|
this.freeBytesThresholdLow = thresholdBytesFromWatermark(lowWatermark);
|
||||||
this.freeBytesThresholdHigh = thresholdBytesFromWatermark(highWatermark);
|
this.freeBytesThresholdHigh = thresholdBytesFromWatermark(highWatermark);
|
||||||
|
|
||||||
this.enabled = settings.getAsBoolean(CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED, false);
|
this.enabled = settings.getAsBoolean(CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED, true);
|
||||||
nodeSettingsService.addListener(new ApplySettings());
|
nodeSettingsService.addListener(new ApplySettings());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user