1
1
[[discovery-settings]]
2
- === Important discovery and cluster formation settings
3
- ++++
4
- <titleabbrev>Discovery and cluster formation settings</titleabbrev>
5
- ++++
2
+ [discrete]
3
+ === Discovery and cluster formation settings
6
4
7
- There are two important discovery and cluster formation settings that should be
8
- configured before going to production so that nodes in the cluster can discover
9
- each other and elect a master node.
5
+ Configure two important discovery and cluster formation settings before going
6
+ to production so that nodes in the cluster can discover each other and elect a
7
+ master node.
10
8
11
9
[discrete]
12
10
[[unicast.hosts]]
13
11
==== `discovery.seed_hosts`
14
12
15
- Out of the box, without any network configuration, Elasticsearch will bind to
16
- the available loopback addresses and will scan local ports 9300 to 9305 to try
17
- to connect to other nodes running on the same server. This provides an
13
+ Out of the box, without any network configuration, {es} will bind to
14
+ the available loopback addresses and scan local ports ` 9300` to ` 9305` to
15
+ connect with other nodes running on the same server. This behavior provides an
18
16
auto-clustering experience without having to do any configuration.
19
17
20
- When you want to form a cluster with nodes on other hosts, you should use the
21
- <<static-cluster-setting, static>> `discovery.seed_hosts` setting to provide a list of other nodes in the cluster
22
- that are master-eligible and likely to be live and contactable in order to seed
23
- the <<modules-discovery-hosts-providers,discovery process>>. This setting value
24
- should be a YAML sequence or array of the addresses of all the master-eligible
18
+ When you want to form a cluster with nodes on other hosts, use the
19
+ <<static-cluster-setting, static>> `discovery.seed_hosts` setting. This setting
20
+ provides a list of other nodes in the cluster
21
+ that are master-eligible and likely to be live and contactable to seed
22
+ the <<modules-discovery-hosts-providers,discovery process>>. This setting
23
+ accepts a YAML sequence or array of the addresses of all the master-eligible
25
24
nodes in the cluster. Each address can be either an IP address or a hostname
26
- which resolves to one or more IP addresses via DNS.
25
+ that resolves to one or more IP addresses via DNS.
27
26
28
27
[source,yaml]
29
28
----
@@ -33,9 +32,9 @@ discovery.seed_hosts:
33
32
- seeds.mydomain.com <2>
34
33
- [0:0:0:0:0:ffff:c0a8:10c]:9301 <3>
35
34
----
36
- <1> The port is optional and usually defaults to `9300`, but this default can
37
- be <<built-in-hosts-providers,overridden>> by certain settings .
38
- <2> If a hostname resolves to multiple IP addresses then the node will attempt to
35
+ <1> The port is optional and defaults to `9300`, but can
36
+ be <<built-in-hosts-providers,overridden>>.
37
+ <2> If a hostname resolves to multiple IP addresses, the node will attempt to
39
38
discover other nodes at all resolved addresses.
40
39
<3> IPv6 addresses must be enclosed in square brackets.
41
40
@@ -47,20 +46,22 @@ dynamically.
47
46
[[initial_master_nodes]]
48
47
==== `cluster.initial_master_nodes`
49
48
50
- When you start a brand new Elasticsearch cluster for the very first time, there
51
- is a <<modules-discovery-bootstrap-cluster,cluster bootstrapping>> step, which
52
- determines the set of master-eligible nodes whose votes are counted in the very
49
+ When you start an {es} cluster for the first time, a
50
+ <<modules-discovery-bootstrap-cluster,cluster bootstrapping>> step
51
+ determines the set of master-eligible nodes whose votes are counted in the
53
52
first election. In <<dev-vs-prod-mode,development mode>>, with no discovery
54
- settings configured, this step is automatically performed by the nodes
55
- themselves. As this auto-bootstrapping is <<modules-discovery-quorums,inherently
56
- unsafe>>, when you start a brand new cluster in <<dev-vs-prod-mode,production
57
- mode>>, you must explicitly list the master-eligible nodes whose votes should be
58
- counted in the very first election. This list is set using the
59
- `cluster.initial_master_nodes` setting.
53
+ settings configured, this step is performed automatically by the nodes
54
+ themselves.
55
+
56
+ Because auto-bootstrapping is <<modules-discovery-quorums,inherently
57
+ unsafe>>, when starting a new cluster in production
58
+ mode, you must explicitly list the master-eligible nodes whose votes should be
59
+ counted in the very first election. You set this list using the
60
+ `cluster.initial_master_nodes` setting.
60
61
61
- NOTE: You should remove `cluster.initial_master_nodes` setting from the nodes' configuration
62
- *once the cluster has successfully formed for the first time* . Do not use this setting when
63
- restarting a cluster or adding a new node to an existing cluster.
62
+ IMPORTANT: After the cluster forms successfully for the first time, remove the `cluster.initial_master_nodes` setting from each nodes'
63
+ configuration . Do not use this setting when
64
+ restarting a cluster or adding a new node to an existing cluster.
64
65
65
66
[source,yaml]
66
67
--------------------------------------------------
@@ -74,14 +75,13 @@ cluster.initial_master_nodes: <1>
74
75
- master-node-b
75
76
- master-node-c
76
77
--------------------------------------------------
77
- <1> The initial master nodes should be identified by their
78
- <<node.name,`node.name`>>, which defaults to their hostname. Make sure that
79
- the value in `cluster.initial_master_nodes` matches the `node.name`
80
- exactly. If you use a fully-qualified domain name such as
81
- `master-node-a.example.com` for your node names then you must use the
82
- fully-qualified name in this list; conversely if `node.name` is a bare
83
- hostname without any trailing qualifiers then you must also omit the
84
- trailing qualifiers in `cluster.initial_master_nodes`.
78
+ <1> Identify the initial master nodes by their <<node-name,`node.name`>>, which
79
+ defaults to their hostname. Ensure that the value in
80
+ `cluster.initial_master_nodes` matches the `node.name` exactly. If you use a
81
+ fully-qualified domain name (FQDN) such as `master-node-a.example.com` for your
82
+ node names, then you must use the FQDN in this list. Conversely, if `node.name`
83
+ is a bare hostname without any trailing qualifiers, you must also omit the
84
+ trailing qualifiers in `cluster.initial_master_nodes`.
85
85
86
- For more information, see <<modules-discovery-bootstrap-cluster>> and
87
- <<modules-discovery-settings>>.
86
+ See <<modules-discovery-bootstrap-cluster,bootstrapping a cluster>> and
87
+ <<modules-discovery-settings,discovery and cluster formation settings >>.
0 commit comments