Skip to content

Commit f57fdc5

Browse files
authored
Deprecate max_local_storage_nodes (#42426)
Allows this setting to be removed in 8.0, see #42428
1 parent 85ff954 commit f57fdc5

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

docs/reference/modules/node.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ your data! The RPM and Debian distributions do this for you already.
282282
=== `node.max_local_storage_nodes`
283283

284284
The <<data-path,data path>> can be shared by multiple nodes, even by nodes from different
285-
clusters. This is very useful for testing failover and different configurations on your development
286-
machine. In production, however, it is recommended to run only one node of Elasticsearch per server.
285+
clusters. It is recommended however to only run one node of Elasticsearch using the same data path.
286+
This setting is deprecated in 7.x and will be removed in version 8.0.
287287

288288
By default, Elasticsearch is configured to prevent more than one node from sharing the same data
289289
path. To allow for more than one node (e.g., on your development machine), use the setting

server/src/main/java/org/elasticsearch/env/NodeEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public String toString() {
164164
* Maximum number of data nodes that should run in an environment.
165165
*/
166166
public static final Setting<Integer> MAX_LOCAL_STORAGE_NODES_SETTING = Setting.intSetting("node.max_local_storage_nodes", 1, 1,
167-
Property.NodeScope);
167+
Property.NodeScope, Property.Deprecated);
168168

169169
/**
170170
* Seed for determining a persisted unique uuid of this node. If the node has already a persisted uuid on disk,

server/src/test/java/org/elasticsearch/env/NodeEnvironmentTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public void testNodeLockSillySettings() {
7373
int max = NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.get(
7474
Settings.builder().put(NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(), value).build());
7575
assertEquals(value, max);
76+
assertWarnings("[node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! " +
77+
"See the breaking changes documentation for the next major version.");
7678
}
7779

7880
public void testNodeLockSingleEnvironment() throws IOException {
@@ -95,6 +97,8 @@ public void testNodeLockSingleEnvironment() throws IOException {
9597
}
9698
env.close();
9799
assertThat(env.lockedShards(), empty());
100+
assertWarnings("[node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! " +
101+
"See the breaking changes documentation for the next major version.");
98102
}
99103

100104
@SuppressForbidden(reason = "System.out.*")
@@ -129,6 +133,8 @@ public void testNodeLockMultipleEnvironment() throws IOException {
129133
assertEquals(first.nodeDataPaths()[i].getParent(), second.nodeDataPaths()[i].getParent());
130134
}
131135
IOUtils.close(first, second);
136+
assertWarnings("[node.max_local_storage_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! " +
137+
"See the breaking changes documentation for the next major version.");
132138
}
133139

134140
public void testShardLock() throws Exception {

0 commit comments

Comments
 (0)