elasticsearch/docs/reference
Boaz Leskes 6861d3571e Persistent Node Ids (#19140)
Node IDs are currently randomly generated during node startup. That means they change every time the node is restarted. While this doesn't matter for ES proper, it makes it hard for external services to track nodes. Another, more minor, side effect is that indexing the output of, say, the node stats API results in creating new fields due to node ID being used as keys.

The first approach I considered was to use the node's published address as the base for the id. We already [treat nodes with the same address as the same](https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/discovery/zen/NodeJoinController.java#L387) so this is a simple change (see [here](https://github.com/elastic/elasticsearch/compare/master...bleskes:node_persistent_id_based_on_address)). While this is simple and it works for probably most cases, it is not perfect. For example, if after a node restart, the node is not able to bind to the same port (because it's not yet freed by the OS), it will cause the node to still change identity. Also in environments where the host IP can change due to a host restart, identity will not be the same. 

Due to those limitation, I opted to go with a different approach where the node id will be persisted in the node's data folder. This has the upside of connecting the id to the nodes data. It also means that the host can be adapted in any way (replace network cards, attach storage to a new VM). I

It does however also have downsides - we now run the risk of two nodes having the same id, if someone copies clones a data folder from one node to another. To mitigate this I changed the semantics of the protection against multiple nodes with the same address to be stricter - it will now reject the incoming join if a node exists with the same id but a different address. Note that if the existing node doesn't respond to pings (i.e., it's not alive) it will be removed and the new node will be accepted when it tries another join.

Last, and most importantly, this change requires that *all* nodes persist data to disk. This is a change from current behavior where only data & master nodes store local files. This is the main reason for marking this PR as breaking.

Other less important notes:
- DummyTransportAddress is removed as we need a unique network address per node. Use `LocalTransportAddress.buildUnique()` instead.
- I renamed `node.add_lid_to_custom_path` to `node.add_lock_id_to_custom_path` to avoid confusion with the node ID which is now part of the `NodeEnvironment` logic.
- I removed the `version` paramater from `MetaDataStateFormat#write` , it wasn't really used and was just in the way :)
- TribeNodes are special in the sense that they do start multiple sub-nodes (previously known as client nodes). Those sub-nodes do not store local files but derive their ID from the parent node id, so they are generated consistently.
2016-07-04 21:09:25 +02:00
..
aggregations Restore reverted change now that alpha4 is out: 2016-07-04 10:39:49 +02:00
analysis Fixed tests that failed now that BM25 is the default similarity. 2016-06-21 15:42:42 +02:00
cat Update documentation for cat/plugins API 2016-06-30 13:57:43 +02:00
cluster add indices nodes info flag to docs 2016-06-20 14:23:32 -04:00
docs Document Update/Delete-By-Query with version number zero 2016-06-30 15:45:14 +02:00
how-to Fix documentation typo in How-To docs 2016-06-27 14:49:37 +02:00
images Updated decay-function image in function_score query 2016-04-20 13:37:52 +02:00
index-modules file is -> file name (#18994) 2016-06-21 13:20:56 +02:00
indices Persistent Node Ids (#19140) 2016-07-04 21:09:25 +02:00
ingest [TEST] replace ResponseBodyAssertion with existing MatchAssertion 2016-07-01 11:13:10 +02:00
mapping Restore reverted change now that alpha4 is out: 2016-07-04 10:39:49 +02:00
migration Persistent Node Ids (#19140) 2016-07-04 21:09:25 +02:00
modules Restore reverted change now that alpha4 is out: 2016-07-04 10:39:49 +02:00
query-dsl [doc] explain avg in function_score better (#19154) 2016-06-30 11:52:53 +02:00
release-notes Added release notes for 5.0.0-alpha4 2016-06-28 12:26:03 +02:00
search Bad asciidoc link 2016-07-04 11:02:06 +02:00
setup Fixing typo for path.conf location (#19098) 2016-06-30 16:42:01 +02:00
testing Introduce dedicated master nodes in testing infrastructure (#18514) 2016-05-27 08:44:20 +02:00
aggregations.asciidoc refactor matrix agg documentation from modules to main agg section 2016-06-06 07:39:00 -05:00
analysis.asciidoc First pass at improving analyzer docs (#18269) 2016-05-11 14:17:56 +02:00
api-conventions.asciidoc Clarify time units usage in docs 2016-06-29 17:02:15 -04:00
cat.asciidoc Add support for documented byte/size units and for micros as a time unit in _cat API 2016-04-15 20:55:41 +02:00
cluster.asciidoc Update task management docs to reflect the latest changes in the interface 2016-03-29 12:26:37 -04:00
docs.asciidoc Add support for waiting until a refresh occurs 2016-06-06 11:37:53 -04:00
getting-started.asciidoc Remove settings and system properties entanglement 2016-05-19 14:08:08 -04:00
glossary.asciidoc Improve glossary to not refer to types as "like a table" (#17704) 2016-04-13 14:29:47 +02:00
how-to.asciidoc Add a how-to section to the docs. #18998 2016-06-24 10:58:33 +02:00
index-modules.asciidoc Remove _timestamp and _ttl on 5.x indices. #18980 2016-06-22 08:35:54 +02:00
index.asciidoc Bumped version to 5.0.0-alpha4 2016-06-30 15:20:59 +02:00
indices.asciidoc [DOCS] fix missing rollover-index link 2016-06-17 12:14:45 -04:00
ingest.asciidoc Renamed all AUTOSENSE snippets to CONSOLE (#18210) 2016-05-09 15:42:23 +02:00
mapping.asciidoc Renamed all AUTOSENSE snippets to CONSOLE (#18210) 2016-05-09 15:42:23 +02:00
modules.asciidoc refactor matrix agg documentation from modules to main agg section 2016-06-06 07:39:00 -05:00
query-dsl.asciidoc Fixed broken xrefs to query-dsl-not-query, which has been removed. 2015-10-20 13:01:37 -07:00
redirects.asciidoc Docs: Complete rewrite of setup, installation, and configuration docs 2016-04-03 16:09:48 +02:00
release-notes.asciidoc Add link to alpha4 release notes 2016-06-30 18:32:15 +02:00
search.asciidoc Add documentation for global search timeout 2016-01-07 10:42:18 -05:00
setup.asciidoc Add bootstrap check docs 2016-05-27 06:03:35 -04:00
testing.asciidoc [DOCS] Test framework documentation 2013-12-02 18:01:45 +01:00