<commit_before>[[modules-discovery-hosts-providers]]
=== Discovery

Discovery is the process by which the cluster formation module finds other
nodes with which to form a cluster. This process runs when you start an
Elasticsearch node or when a node believes the master node failed and continues
until the master node is found or a new master node is elected.

This process starts with a list of _seed_ addresses from one or more
<<built-in-hosts-providers,seed hosts providers>>, together with the addresses
of any master-eligible nodes that were in the last-known cluster. The process
operates in two phases: First, each node probes the seed addresses by
connecting to each address and attempting to identify the node to which it is
connected. Secondly it shares with the remote node a list of all of its known
master-eligible peers and the remote node responds with _its_ peers in turn.
The node then probes all the new nodes that it just discovered, requests their
peers, and so on.

If the node is not master-eligible then it continues this discovery process
until it has discovered an elected master node. If no elected master is
discovered then the node will retry after `discovery.find_peers_interval` which
defaults to `1s`.

If the node is master-eligible then it continues this discovery process until
it has either discovered an elected master node or else it has discovered
enough masterless master-eligible nodes to complete an election. If neither of
these occur quickly enough then the node will retry after
`discovery.find_peers_interval` which defaults to `1s`.

[[built-in-hosts-providers]]
==== Seed hosts providers

By default the cluster formation module offers two seed hosts providers to
configure the list of seed nodes: a _settings_-based and a _file_-based seed
hosts provider.  It can be extended to support cloud environments and other
forms of seed hosts providers via {plugins}/discovery.html[discovery plugins].
Seed hosts providers are configured using the `discovery.seed_providers`
setting, which defaults to the _settings_-based hosts provider. This setting
accepts a list of different providers, allowing you to make use of multiple
ways to find the seed hosts for your cluster.

Each seed hosts provider yields the IP addresses or hostnames of the seed
nodes. If it returns any hostnames then these are resolved to IP addresses<commit_msg>Clarify that discovery ignores master-ineligibles (#44835)<commit_after>[[modules-discovery-hosts-providers]]
=== Discovery

Discovery is the process by which the cluster formation module finds other
nodes with which to form a cluster. This process runs when you start an
Elasticsearch node or when a node believes the master node failed and continues
until the master node is found or a new master node is elected.

This process starts with a list of _seed_ addresses from one or more
<<built-in-hosts-providers,seed hosts providers>>, together with the addresses
of any master-eligible nodes that were in the last-known cluster. The process
operates in two phases: First, each node probes the seed addresses by
connecting to each address and attempting to identify the node to which it is
connected and to verify that it is master-eligible. Secondly, if successful, it
shares with the remote node a list of all of its known master-eligible peers
and the remote node responds with _its_ peers in turn. The node then probes all
the new nodes that it just discovered, requests their peers, and so on.

If the node is not master-eligible then it continues this discovery process
until it has discovered an elected master node. If no elected master is
discovered then the node will retry after `discovery.find_peers_interval` which
defaults to `1s`.

If the node is master-eligible then it continues this discovery process until
it has either discovered an elected master node or else it has discovered
enough masterless master-eligible nodes to complete an election. If neither of
these occur quickly enough then the node will retry after
`discovery.find_peers_interval` which defaults to `1s`.

[[built-in-hosts-providers]]
==== Seed hosts providers

By default the cluster formation module offers two seed hosts providers to
configure the list of seed nodes: a _settings_-based and a _file_-based seed
hosts provider.  It can be extended to support cloud environments and other
forms of seed hosts providers via {plugins}/discovery.html[discovery plugins].
Seed hosts providers are configured using the `discovery.seed_providers`
setting, which defaults to the _settings_-based hosts provider. This setting
accepts a list of different providers, allowing you to make use of multiple
ways to find the seed hosts for your cluster.

Each seed hosts provider yields the IP addresses or hostnames of the seed
nodes. If it returns any hostnames then these are resolved to IP addresses
{'fraction_non_alphanumeric': 0.03564070869386073, 'fraction_numerical': 0.001854140914709518, 'mean_word_length': 4.856453558504222, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6339992', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1100, 'n_words': 731}