@@ -9,16 +9,21 @@ up: nodes that have already joined a cluster store this information in their
9
9
data folder and freshly-started nodes that are joining an existing cluster
10
10
obtain this information from the cluster's elected master.
11
11
12
- The initial set of master-eligible nodes is defined in the
13
- <<initial_master_nodes,`cluster.initial_master_nodes` setting>>. When you
14
- start a master-eligible node, you can provide this setting on the command line
15
- or in the `elasticsearch.yml` file. After the cluster has formed, this setting
16
- is no longer required and is ignored. It need not be set
17
- on master-ineligible nodes, nor on master-eligible nodes that are started to
18
- join an existing cluster. Note that master-eligible nodes should use storage
19
- that persists across restarts. If they do not, and
20
- `cluster.initial_master_nodes` is set, and a full cluster restart occurs, then
21
- another brand-new cluster will form and this may result in data loss.
12
+ The initial set of master-eligible nodes is defined in the
13
+ <<initial_master_nodes,`cluster.initial_master_nodes` setting>>. This is a list
14
+ of the <<node.name,node names>> or IP addresses of the master-eligible nodes in
15
+ the new cluster. If you do not configure `node.name` then it is set to the
16
+ node's hostname, so in this case you can use hostnames in
17
+ `cluster.initial_master_nodes` too.
18
+
19
+ When you start a master-eligible node, you can provide this setting on the
20
+ command line or in the `elasticsearch.yml` file. After the cluster has formed,
21
+ this setting is no longer required and is ignored. It need not be set on
22
+ master-ineligible nodes, nor on master-eligible nodes that are started to join
23
+ an existing cluster. Note that master-eligible nodes should use storage that
24
+ persists across restarts. If they do not, and `cluster.initial_master_nodes` is
25
+ set, and a full cluster restart occurs, then another brand-new cluster will
26
+ form and this may result in data loss.
22
27
23
28
It is technically sufficient to set `cluster.initial_master_nodes` on a single
24
29
master-eligible node in the cluster, and only to mention that single node in the
@@ -42,10 +47,9 @@ cluster.initial_master_nodes:
42
47
- master-c
43
48
--------------------------------------------------
44
49
45
- Alternatively the IP addresses or hostnames (<<node.name,if node name defaults
46
- to the host name>>) can be used. If there is more than one Elasticsearch node
47
- with the same IP address or hostname then the transport ports must also be given
48
- to specify exactly which node is meant:
50
+ You can use a mix of IP addresses and node names too. If there is more than one
51
+ Elasticsearch node with the same IP address then the transport port must also
52
+ be given to specify exactly which node is meant:
49
53
50
54
[source,yaml]
51
55
--------------------------------------------------
@@ -56,14 +60,23 @@ cluster.initial_master_nodes:
56
60
- master-node-hostname
57
61
--------------------------------------------------
58
62
63
+ Like all node settings, it is also possible to specify the initial set of master
64
+ nodes on the command-line that is used to start Elasticsearch:
65
+
66
+ [source,bash]
67
+ --------------------------------------------------
68
+ $ bin/elasticsearch -Ecluster.initial_master_nodes=master-a,master-b,master-c
69
+ --------------------------------------------------
70
+
59
71
[NOTE]
60
72
==================================================
61
73
62
- The node names used in this list must exactly match the `node.name` properties
63
- of the nodes. By default the node name is set to the machine's hostname which
64
- may or may not be fully-qualified depending on your system configuration. If
65
- each node name is a fully-qualified domain name such as `master-a.example.com`
66
- then you must use fully-qualified domain names in the
74
+ [[modules-discovery-bootstrap-cluster-fqdns]] The node names used in the
75
+ `cluster.initial_master_nodes` list must exactly match the `node.name`
76
+ properties of the nodes. By default the node name is set to the machine's
77
+ hostname which may or may not be fully-qualified depending on your system
78
+ configuration. If each node name is a fully-qualified domain name such as
79
+ `master-a.example.com` then you must use fully-qualified domain names in the
67
80
`cluster.initial_master_nodes` list too; conversely if your node names are bare
68
81
hostnames (without the `.example.com` suffix) then you must use bare hostnames
69
82
in the `cluster.initial_master_nodes` list. If you use a mix of fully-qualifed
@@ -81,18 +94,11 @@ bootstrap a cluster: have discovered [{master-b.example.com}{...
81
94
82
95
This message shows the node names `master-a.example.com` and
83
96
`master-b.example.com` as well as the `cluster.initial_master_nodes` entries
84
- `master-a` and `master-b`, and it is apparent that they do not match exactly.
97
+ `master-a` and `master-b`, and it is clear from this message that they do not
98
+ match exactly.
85
99
86
100
==================================================
87
101
88
- Like all node settings, it is also possible to specify the initial set of master
89
- nodes on the command-line that is used to start Elasticsearch:
90
-
91
- [source,bash]
92
- --------------------------------------------------
93
- $ bin/elasticsearch -Ecluster.initial_master_nodes=master-a,master-b,master-c
94
- --------------------------------------------------
95
-
96
102
[float]
97
103
==== Choosing a cluster name
98
104
0 commit comments