File tree Expand file tree Collapse file tree 6 files changed +126
-0
lines changed
x-pack/plugin/autoscaling
main/java/org/elasticsearch/xpack/autoscaling
test/java/org/elasticsearch/xpack/autoscaling Expand file tree Collapse file tree 6 files changed +126
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ subprojects {
107
107
// switched to an exclude list, and eventualy removed completely.
108
108
def projectPathsToFormat = [
109
109
' :build-tools' ,
110
+ ' :x-pack:plugin:autoscaling' ,
110
111
' :x-pack:plugin:enrich'
111
112
]
112
113
Original file line number Diff line number Diff line change
1
+ [role="xpack"]
2
+ [testenv="platinum"]
3
+ [[xpack-autoscaling]]
4
+ [chapter]
5
+ = Autoscaling
6
+
7
+ experimental[]
8
+
9
+ The autoscaling feature enables an operator to configure tiers of nodes that
10
+ self-monitor whether or not they need to scale based on an operator-defined
11
+ policy. Then, via the autoscaling API, an Elasticsearch cluster can report
12
+ whether or not it needs additional resources to meet the policy. For example, an
13
+ operator could define a policy that a warm tier should scale on available disk
14
+ space. Elasticsearch would monitor and forecast the available disk space in the
15
+ warm tier, and if the forecast is such that the cluster will soon not be able to
16
+ allocate existing and future shard copies due to disk space, then the
17
+ autoscaling API would report that the cluster needs to scale due to disk space.
18
+ It remains the responsibility of the operator to add the additional resources
19
+ that the cluster signals it requires.
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ include::ingest.asciidoc[]
40
40
41
41
include::ilm/index.asciidoc[]
42
42
43
+ include::autoscaling/index.asciidoc[]
44
+
43
45
include::sql/index.asciidoc[]
44
46
45
47
include::monitoring/index.asciidoc[]
Original file line number Diff line number Diff line change
1
+ evaluationDependsOn(xpackModule(' core' ))
2
+
3
+ apply plugin : ' elasticsearch.esplugin'
4
+
5
+ esplugin {
6
+ name ' x-pack-autoscaling'
7
+ description ' Elasticsearch Expanded Pack Plugin - Autoscaling'
8
+ classname ' org.elasticsearch.xpack.autoscaling.Autoscaling'
9
+ extendedPlugins = [' x-pack-core' ]
10
+ hasNativeController false
11
+ requiresKeystore true
12
+ }
13
+ archivesBaseName = ' x-pack-autoscaling'
14
+
15
+ integTest. enabled = false
16
+
17
+ dependencies {
18
+ compileOnly project(path : xpackModule(' core' ), configuration : ' default' )
19
+ testCompile project(path : xpackModule(' core' ), configuration : ' testArtifacts' )
20
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License;
4
+ * you may not use this file except in compliance with the Elastic License.
5
+ */
6
+
7
+ package org .elasticsearch .xpack .autoscaling ;
8
+
9
+ import org .elasticsearch .Build ;
10
+ import org .elasticsearch .common .settings .Setting ;
11
+ import org .elasticsearch .plugins .Plugin ;
12
+
13
+ import java .util .List ;
14
+
15
+ /**
16
+ * Container class for autoscaling functionality.
17
+ */
18
+ public class Autoscaling extends Plugin {
19
+
20
+ public static final Setting <Boolean > AUTOSCALING_ENABLED_SETTING = Setting .boolSetting (
21
+ "xpack.autoscaling.enabled" ,
22
+ false ,
23
+ Setting .Property .NodeScope
24
+ );
25
+
26
+ /**
27
+ * The settings defined by autoscaling.
28
+ *
29
+ * @return the settings
30
+ */
31
+ @ Override
32
+ public List <Setting <?>> getSettings () {
33
+ if (isSnapshot ()) {
34
+ return List .of (AUTOSCALING_ENABLED_SETTING );
35
+ } else {
36
+ return List .of ();
37
+ }
38
+ }
39
+
40
+ boolean isSnapshot () {
41
+ return Build .CURRENT .isSnapshot ();
42
+ }
43
+
44
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License;
4
+ * you may not use this file except in compliance with the Elastic License.
5
+ */
6
+
7
+ package org .elasticsearch .xpack .autoscaling ;
8
+
9
+ import org .elasticsearch .test .ESTestCase ;
10
+
11
+ import static org .hamcrest .Matchers .hasItem ;
12
+ import static org .hamcrest .Matchers .not ;
13
+
14
+ public class AutoscalingTests extends ESTestCase {
15
+
16
+ public void testEnabledSettingRegisteredInSnapshotBuilds () {
17
+ final Autoscaling plugin = new Autoscaling () {
18
+
19
+ @ Override
20
+ protected boolean isSnapshot () {
21
+ return true ;
22
+ }
23
+
24
+ };
25
+ assertThat (plugin .getSettings (), hasItem (Autoscaling .AUTOSCALING_ENABLED_SETTING ));
26
+ }
27
+
28
+ public void testEnabledSettingNotRegisteredInNonSnapshotBuilds () {
29
+ final Autoscaling plugin = new Autoscaling () {
30
+
31
+ @ Override
32
+ protected boolean isSnapshot () {
33
+ return false ;
34
+ }
35
+
36
+ };
37
+ assertThat (plugin .getSettings (), not (hasItem (Autoscaling .AUTOSCALING_ENABLED_SETTING )));
38
+ }
39
+
40
+ }
You can’t perform that action at this time.
0 commit comments