|
1 | 1 | [[discovery-file]]
|
2 | 2 | === File-Based Discovery Plugin
|
3 | 3 |
|
4 |
| -The file-based discovery plugin uses a list of hosts/ports in a `unicast_hosts.txt` file |
5 |
| -in the `config/discovery-file` directory for unicast discovery. |
| 4 | +The functionality provided by the `discovery-file` plugin is now available in |
| 5 | +Elasticsearch without requiring a plugin. This plugin still exists for backwards |
| 6 | +compatibility, but it no longer does anything and will be removed in a future |
| 7 | +version. |
6 | 8 |
|
7 | 9 | :plugin_name: discovery-file
|
8 | 10 | include::install_remove.asciidoc[]
|
9 |
| - |
10 |
| -[[discovery-file-usage]] |
11 |
| -[float] |
12 |
| -==== Using the file-based discovery plugin |
13 |
| - |
14 |
| -The file-based discovery plugin provides the ability to specify the |
15 |
| -unicast hosts list through a simple `unicast_hosts.txt` file that can |
16 |
| -be dynamically updated at any time. To enable, add the following in `elasticsearch.yml`: |
17 |
| - |
18 |
| -[source,yaml] |
19 |
| ----- |
20 |
| -discovery.zen.hosts_provider: file |
21 |
| ----- |
22 |
| - |
23 |
| -This plugin simply provides a facility to supply the unicast hosts list for |
24 |
| -zen discovery through an external file that can be updated at any time by a side process. |
25 |
| - |
26 |
| -For example, this gives a convenient mechanism for an Elasticsearch instance |
27 |
| -that is run in docker containers to be dynamically supplied a list of IP |
28 |
| -addresses to connect to for zen discovery when those IP addresses may not be |
29 |
| -known at node startup. |
30 |
| - |
31 |
| -Note that the file-based discovery plugin is meant to augment the unicast |
32 |
| -hosts list in `elasticsearch.yml` (if specified), not replace it. Therefore, |
33 |
| -if there are valid unicast host entries in `discovery.zen.ping.unicast.hosts`, |
34 |
| -they will be used in addition to those supplied in `unicast_hosts.txt`. |
35 |
| - |
36 |
| -Anytime a change is made to the `unicast_hosts.txt` file, even as Elasticsearch |
37 |
| -continues to run, the new changes will be picked up by the plugin and the |
38 |
| -new hosts list will be used for the next pinging round for master election. |
39 |
| - |
40 |
| -Upon installation of the plugin, a default `unicast_hosts.txt` file will |
41 |
| -be found in the `$CONFIG_DIR/discovery-file` directory. This default file |
42 |
| -will contain some comments about what the file should contain. All comments |
43 |
| -for this file must appear on their lines starting with `#` (i.e. comments |
44 |
| -cannot start in the middle of a line). |
45 |
| - |
46 |
| -[[discovery-file-format]] |
47 |
| -[float] |
48 |
| -==== unicast_hosts.txt file format |
49 |
| - |
50 |
| -The format of the file is to specify one unicast host entry per line. |
51 |
| -Each unicast host entry consists of the host (host name or IP address) and |
52 |
| -an optional transport port number. If the port number is specified, is must |
53 |
| -come immediately after the host (on the same line) separated by a `:`. |
54 |
| -If the port number is not specified, a default value of 9300 is used. |
55 |
| - |
56 |
| -For example, this is an example of `unicast_hosts.txt` for a cluster with |
57 |
| -four nodes that participate in unicast discovery, some of which are not |
58 |
| -running on the default port: |
59 |
| - |
60 |
| -[source,txt] |
61 |
| ----------------------------------------------------------------- |
62 |
| -10.10.10.5 |
63 |
| -10.10.10.6:9305 |
64 |
| -10.10.10.5:10005 |
65 |
| -# an IPv6 address |
66 |
| -[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:9301 |
67 |
| ----------------------------------------------------------------- |
68 |
| - |
69 |
| -Host names are allowed instead of IP addresses (similar to |
70 |
| -`discovery.zen.ping.unicast.hosts`), and IPv6 addresses must be |
71 |
| -specified in brackets with the port coming after the brackets. |
0 commit comments