Skip to content

Commit 52ad584

Browse files
authored
Introduce node.roles setting (#58512)
Today we have individual settings for configuring node roles such as node.data and node.master. Additionally, roles are pluggable and we have used this to introduce roles such as node.ml and node.voting_only. As the number of roles is growing, managing these becomes harder for the user. For example, to create a master-only node, today a user has to configure: - node.data: false - node.ingest: false - node.remote_cluster_client: false - node.ml: false at a minimum if they are relying on defaults, but also add: - node.master: true - node.transform: false - node.voting_only: false If they want to be explicit. This is also challenging in cases where a user wants to have configure a coordinating-only node which requires disabling all roles, a list which we are adding to, requiring the user to keep checking whether a node has acquired any of these roles. This commit addresses this by adding a list setting node.roles for which a user has explicit control over the list of roles that a node has. If the setting is configured, the node has exactly the roles in the list, and not any additional roles. This means to configure a master-only node, the setting is merely 'node.roles: [master]', and to configure a coordinating-only node, the setting is merely: 'node.roles: []'. With this change we deprecate the existing 'node.*' settings such as 'node.data'.
1 parent 20af856 commit 52ad584

File tree

88 files changed

+1068
-795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1068
-795
lines changed

docs/reference/commands/node-tool.asciidoc

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,16 @@ after repurposing it.
6262
The intended use is:
6363

6464
* Stop the node
65-
* Update `elasticsearch.yml` by setting `node.master` and `node.data` as
66-
desired.
65+
* Update `elasticsearch.yml` by setting `node.roles` as desired.
6766
* Run `elasticsearch-node repurpose` on the node
6867
* Start the node
6968

70-
If you run `elasticsearch-node repurpose` on a node with `node.data: false` and
71-
`node.master: true` then it will delete any remaining shard data on that node,
72-
but it will leave the index and cluster metadata alone. If you run
73-
`elasticsearch-node repurpose` on a node with `node.data: false` and
74-
`node.master: false` then it will delete any remaining shard data and index
75-
metadata, but it will leave the cluster metadata alone.
69+
If you run `elasticsearch-node repurpose` on a node without the `data` role and
70+
with the `master` role then it will delete any remaining shard data on that
71+
node, but it will leave the index and cluster metadata alone. If you run
72+
`elasticsearch-node repurpose` on a node without the `data` and `master` roles
73+
then it will delete any remaining shard data and index metadata, but it will
74+
leave the cluster metadata alone.
7675

7776
[WARNING]
7877
Running this command can lead to data loss for the indices mentioned if the
@@ -355,12 +354,12 @@ to `0`, meaning to use the first node in the data path.
355354
=== Examples
356355

357356
[float]
358-
==== Repurposing a node as a dedicated master node (master: true, data: false)
357+
==== Repurposing a node as a dedicated master node
359358

360359
In this example, a former data node is repurposed as a dedicated master node.
361-
First update the node's settings to `node.master: true` and `node.data: false`
362-
in its `elasticsearch.yml` config file. Then run the `elasticsearch-node
363-
repurpose` command to find and remove excess shard data:
360+
First update the node's settings to `node.roles: [ "master" ]` in its
361+
`elasticsearch.yml` config file. Then run the `elasticsearch-node repurpose`
362+
command to find and remove excess shard data:
364363

365364
[source,txt]
366365
----
@@ -377,13 +376,13 @@ Node successfully repurposed to master and no-data.
377376
----
378377

379378
[float]
380-
==== Repurposing a node as a coordinating-only node (master: false, data: false)
379+
==== Repurposing a node as a coordinating-only node
381380

382381
In this example, a node that previously held data is repurposed as a
383-
coordinating-only node. First update the node's settings to `node.master:
384-
false` and `node.data: false` in its `elasticsearch.yml` config file. Then run
385-
the `elasticsearch-node repurpose` command to find and remove excess shard data
386-
and index metadata:
382+
coordinating-only node. First update the node's settings to `node.roles: []` in
383+
its `elasticsearch.yml` config file. Then run the `elasticsearch-node repurpose`
384+
command to find and remove excess shard data and index metadata:
385+
387386

388387
[source,txt]
389388
----

0 commit comments

Comments
 (0)