Clarify use of special values for publish addresses (#114551)

Special values like `0.0.0.0` may resolve to multiple IP addresses just
like hostnames, so the same considerations apply when using such values
as a publish address. This commit spells this case out in the docs and
cleans up the nearby wording a little.
This commit is contained in:
David Turner 2024-10-14 16:39:00 +01:00 committed by GitHub
parent b0aa39fa67
commit 9eab11c45b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,23 +153,34 @@ The only requirements are that each node must be:
* Accessible at its transport publish address by all other nodes in its * Accessible at its transport publish address by all other nodes in its
cluster, and by any remote clusters that will discover it using cluster, and by any remote clusters that will discover it using
<<sniff-mode>>. <<sniff-mode,sniff mode>>.
Each node must have its own distinct publish address. Each node must have its own distinct publish address.
If you specify the transport publish address using a hostname then {es} will If you specify the transport publish address using a hostname then {es} will
resolve this hostname to an IP address once during startup, and other nodes resolve this hostname to an IP address once during startup, and other nodes
will use the resulting IP address instead of resolving the name again will use the resulting IP address instead of resolving the name again
themselves. To avoid confusion, use a hostname which resolves to the node's themselves. You must use a hostname such that all of the addresses to which it
address in all network locations. resolves are addresses at which the node is accessible from all other nodes. To
avoid confusion, it is simplest to use a hostname which resolves to a single
address.
If you specify the transport publish address using a
<<network-interface-values,special value>> then {es} will resolve this value to
a single IP address during startup, and other nodes will use the resulting IP
address instead of resolving the value again themselves. You must use a value
such that all of the addresses to which it resolves are addresses at which the
node is accessible from all other nodes. To avoid confusion, it is simplest to
use a value which resolves to a single address. It is usually a mistake to use
`0.0.0.0` as a publish address on hosts with more than one network interface.
===== Using a single address ===== Using a single address
The most common configuration is for {es} to bind to a single address at which The most common configuration is for {es} to bind to a single address at which
it is accessible to clients and other nodes. In this configuration you should it is accessible to clients and other nodes. To use this configuration, set
just set `network.host` to that address. You should not separately set any bind only `network.host` to the desired address. Do not separately set any bind or
or publish addresses, nor should you separately configure the addresses for the publish addresses. Do not separately specify the addresses for the HTTP or
HTTP or transport interfaces. transport interfaces.
===== Using multiple addresses ===== Using multiple addresses