From 6b362f1cff757920435f60e8643c59cf095c15d9 Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Wed, 22 May 2019 22:31:31 +0200 Subject: [PATCH 1/2] Deprecate max-local-storage-nodes --- docs/reference/modules/node.asciidoc | 4 ++-- .../src/main/java/org/elasticsearch/env/NodeEnvironment.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/modules/node.asciidoc b/docs/reference/modules/node.asciidoc index f988e97ef553c..82ee66fbefd51 100644 --- a/docs/reference/modules/node.asciidoc +++ b/docs/reference/modules/node.asciidoc @@ -282,8 +282,8 @@ your data! The RPM and Debian distributions do this for you already. === `node.max_local_storage_nodes` The <> can be shared by multiple nodes, even by nodes from different -clusters. This is very useful for testing failover and different configurations on your development -machine. In production, however, it is recommended to run only one node of Elasticsearch per server. +clusters. It is recommended however to only run one node of Elasticsearch using the same data path. +This setting is deprecated in 7.x and will be removed in version 8.0. By default, Elasticsearch is configured to prevent more than one node from sharing the same data path. To allow for more than one node (e.g., on your development machine), use the setting diff --git a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java index cc36d734213ef..2593687d55a3b 100644 --- a/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/elasticsearch/env/NodeEnvironment.java @@ -164,7 +164,7 @@ public String toString() { * Maximum number of data nodes that should run in an environment. */ public static final Setting MAX_LOCAL_STORAGE_NODES_SETTING = Setting.intSetting("node.max_local_storage_nodes", 1, 1, - Property.NodeScope); + Property.NodeScope, Property.Deprecated); /** * Seed for determining a persisted unique uuid of this node. If the node has already a persisted uuid on disk, From 6a1c12dececb5a8ac367eb28ba33235eaef62b54 Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Thu, 23 May 2019 10:48:37 +0200 Subject: [PATCH 2/2] add expected warnings to test --- .../java/org/elasticsearch/env/NodeEnvironmentTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java index 89a10af1a6fc2..069c52a96e32c 100644 --- a/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java +++ b/server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java @@ -73,6 +73,8 @@ public void testNodeLockSillySettings() { int max = NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.get( Settings.builder().put(NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(), value).build()); assertEquals(value, max); + assertWarnings("[node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! " + + "See the breaking changes documentation for the next major version."); } public void testNodeLockSingleEnvironment() throws IOException { @@ -95,6 +97,8 @@ public void testNodeLockSingleEnvironment() throws IOException { } env.close(); assertThat(env.lockedShards(), empty()); + assertWarnings("[node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! " + + "See the breaking changes documentation for the next major version."); } @SuppressForbidden(reason = "System.out.*") @@ -129,6 +133,8 @@ public void testNodeLockMultipleEnvironment() throws IOException { assertEquals(first.nodeDataPaths()[i].getParent(), second.nodeDataPaths()[i].getParent()); } IOUtils.close(first, second); + assertWarnings("[node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! " + + "See the breaking changes documentation for the next major version."); } public void testShardLock() throws Exception {