-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move file-based discovery to core #33241
Merged
DaveCTurner
merged 8 commits into
elastic:master
from
DaveCTurner:2018-08-29-file-based-hosts-provider
Aug 30, 2018
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
befdce1
Move file-based discovery to core
DaveCTurner 588c6c2
Pickiness
DaveCTurner e2e59df
This is a config file. We need to say this so it's removed by package…
DaveCTurner 13db1a7
Fix name of config directory environment variable
DaveCTurner b581cb7
Let's not bother shipping this extra config file
DaveCTurner e2ef488
Reinstate unicast_hosts.txt
DaveCTurner 8f9fcef
Move unicast_hosts.txt to the top-level config dir
DaveCTurner 432a88c
Fix path to file in docs
DaveCTurner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,14 @@ | ||
[[discovery-file]] | ||
=== File-Based Discovery Plugin | ||
|
||
The file-based discovery plugin uses a list of hosts/ports in a `unicast_hosts.txt` file | ||
in the `config/discovery-file` directory for unicast discovery. | ||
The functionality provided by the `discovery-file` plugin is now available in | ||
Elasticsearch without requiring a plugin. This plugin still exists to ensure | ||
backwards compatibility, but it will be removed in a future version. | ||
|
||
On installation, this plugin creates a file at | ||
`$ES_PATH_CONF/discovery-file/unicast_hosts.txt` that comprises comments that | ||
describe how to use it. It is preferable not to install this plugin and instead | ||
to create this file, and its containing directory, using standard tools. | ||
|
||
:plugin_name: discovery-file | ||
include::install_remove.asciidoc[] | ||
|
||
[[discovery-file-usage]] | ||
[float] | ||
==== Using the file-based discovery plugin | ||
|
||
The file-based discovery plugin provides the ability to specify the | ||
unicast hosts list through a simple `unicast_hosts.txt` file that can | ||
be dynamically updated at any time. To enable, add the following in `elasticsearch.yml`: | ||
|
||
[source,yaml] | ||
---- | ||
discovery.zen.hosts_provider: file | ||
---- | ||
|
||
This plugin simply provides a facility to supply the unicast hosts list for | ||
zen discovery through an external file that can be updated at any time by a side process. | ||
|
||
For example, this gives a convenient mechanism for an Elasticsearch instance | ||
that is run in docker containers to be dynamically supplied a list of IP | ||
addresses to connect to for zen discovery when those IP addresses may not be | ||
known at node startup. | ||
|
||
Note that the file-based discovery plugin is meant to augment the unicast | ||
hosts list in `elasticsearch.yml` (if specified), not replace it. Therefore, | ||
if there are valid unicast host entries in `discovery.zen.ping.unicast.hosts`, | ||
they will be used in addition to those supplied in `unicast_hosts.txt`. | ||
|
||
Anytime a change is made to the `unicast_hosts.txt` file, even as Elasticsearch | ||
continues to run, the new changes will be picked up by the plugin and the | ||
new hosts list will be used for the next pinging round for master election. | ||
|
||
Upon installation of the plugin, a default `unicast_hosts.txt` file will | ||
be found in the `$CONFIG_DIR/discovery-file` directory. This default file | ||
will contain some comments about what the file should contain. All comments | ||
for this file must appear on their lines starting with `#` (i.e. comments | ||
cannot start in the middle of a line). | ||
|
||
[[discovery-file-format]] | ||
[float] | ||
==== unicast_hosts.txt file format | ||
|
||
The format of the file is to specify one unicast host entry per line. | ||
Each unicast host entry consists of the host (host name or IP address) and | ||
an optional transport port number. If the port number is specified, is must | ||
come immediately after the host (on the same line) separated by a `:`. | ||
If the port number is not specified, a default value of 9300 is used. | ||
|
||
For example, this is an example of `unicast_hosts.txt` for a cluster with | ||
four nodes that participate in unicast discovery, some of which are not | ||
running on the default port: | ||
|
||
[source,txt] | ||
---------------------------------------------------------------- | ||
10.10.10.5 | ||
10.10.10.6:9305 | ||
10.10.10.5:10005 | ||
# an IPv6 address | ||
[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:9301 | ||
---------------------------------------------------------------- | ||
|
||
Host names are allowed instead of IP addresses (similar to | ||
`discovery.zen.ping.unicast.hosts`), and IPv6 addresses must be | ||
specified in brackets with the port coming after the brackets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of the changes in this file are just reformatting.