Skip to content

Commit 9b8826c

Browse files
authored
[DOCS] Document discovery.seed_hosts only supports YAML sequences and arrays (#63746)
1 parent 879dd5a commit 9b8826c

File tree

2 files changed

+41
-15
lines changed

2 files changed

+41
-15
lines changed

docs/reference/setup/configuration.asciidoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,23 @@ path.data: /var/lib/elasticsearch
6666
path.logs: /var/log/elasticsearch
6767
--------------------------------------------------
6868

69+
In YAML, you can format non-scalar values as sequences:
70+
71+
[source,yaml]
72+
----
73+
discovery.seed_hosts:
74+
- 192.168.1.10:9300
75+
- 192.168.1.11
76+
- seeds.mydomain.com
77+
----
78+
79+
Though less common, you can also format non-scalar values as arrays:
80+
81+
[source,yaml]
82+
----
83+
discovery.seed_hosts: ["192.168.1.10:9300", "192.168.1.11", "seeds.mydomain.com"]
84+
----
85+
6986
[discrete]
7087
=== Environment variable substitution
7188

docs/reference/setup/important-settings/discovery-settings.asciidoc

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,26 @@ to connect to other nodes running on the same server. This provides an
1818
auto-clustering experience without having to do any configuration.
1919

2020
When you want to form a cluster with nodes on other hosts, you should use the
21-
`discovery.seed_hosts` setting to provide a list of other nodes in the cluster
21+
<<static-cluster-setting, static>> `discovery.seed_hosts` setting to provide a list of other nodes in the cluster
2222
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
24-
should be a list of the addresses of all the master-eligible nodes in the
25-
cluster. Each address can be either an IP address or a hostname which resolves
26-
to one or more IP addresses via DNS.
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
25+
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.
27+
28+
[source,yaml]
29+
----
30+
discovery.seed_hosts:
31+
- 192.168.1.10:9300
32+
- 192.168.1.11 <1>
33+
- seeds.mydomain.com <2>
34+
- [0:0:0:0:0:ffff:c0a8:10c]:9301 <3>
35+
----
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
39+
discover other nodes at all resolved addresses.
40+
<3> IPv6 addresses must be enclosed in square brackets.
2741

2842
If your master-eligible nodes do not have fixed names or addresses, use an
2943
<<built-in-hosts-providers,alternative hosts provider>> to find their addresses
@@ -52,20 +66,15 @@ restarting a cluster or adding a new node to an existing cluster.
5266
--------------------------------------------------
5367
discovery.seed_hosts:
5468
- 192.168.1.10:9300
55-
- 192.168.1.11 <1>
56-
- seeds.mydomain.com <2>
57-
- [0:0:0:0:0:ffff:c0a8:10c]:9301 <3>
58-
cluster.initial_master_nodes: <4>
69+
- 192.168.1.11
70+
- seeds.mydomain.com
71+
- [0:0:0:0:0:ffff:c0a8:10c]:9301
72+
cluster.initial_master_nodes: <1>
5973
- master-node-a
6074
- master-node-b
6175
- master-node-c
6276
--------------------------------------------------
63-
<1> The port is optional and usually defaults to `9300`, but this default can
64-
be <<built-in-hosts-providers,overridden>> by certain settings.
65-
<2> If a hostname resolves to multiple IP addresses then the node will attempt to
66-
discover other nodes at all resolved addresses.
67-
<3> IPv6 addresses must be enclosed in square brackets.
68-
<4> The initial master nodes should be identified by their
77+
<1> The initial master nodes should be identified by their
6978
<<node.name,`node.name`>>, which defaults to their hostname. Make sure that
7079
the value in `cluster.initial_master_nodes` matches the `node.name`
7180
exactly. If you use a fully-qualified domain name such as

0 commit comments

Comments
 (0)