2016-04-08 06:18:02 -04:00
|
|
|
[[breaking_50_fs]]
|
|
|
|
=== Filesystem related changes
|
|
|
|
|
|
|
|
Only a subset of index files were open with `mmap` on Elasticsearch 2.x. As of
|
|
|
|
Elasticsearch 5.0, all index files will be open with `mmap` on 64-bit systems.
|
|
|
|
While this may increase the amount of virtual memory used by Elasticsearch,
|
|
|
|
there is nothing to worry about since this is only address space consumption
|
|
|
|
and the actual memory usage of Elasticsearch will stay similar to what it was
|
|
|
|
in 2.x. See http://blog.thetaphi.de/2012/07/use-lucenes-mmapdirectory-on-64bit.html
|
|
|
|
for more information.
|
2016-05-23 18:19:56 -04:00
|
|
|
|
|
|
|
=== Path to data on disk
|
|
|
|
|
|
|
|
In prior versions of Elasticsearch, the `path.data` directory included a folder
|
|
|
|
for the cluster name, so that data was in a folder such as
|
|
|
|
`$DATA_DIR/$CLUSTER_NAME/nodes/$nodeOrdinal`. In 5.0 the cluster name as a
|
|
|
|
directory is deprecated. Data will now be stored in
|
|
|
|
`$DATA_DIR/nodes/$nodeOrdinal` if there is no existing data. Upon startup,
|
|
|
|
Elasticsearch will check to see if the cluster folder exists and has data, and
|
|
|
|
will read from it if necessary. In Elasticsearch 6.0 this backwards-compatible
|
|
|
|
behavior will be removed.
|
|
|
|
|
|
|
|
If you are using a multi-cluster setup with both instances of Elasticsearch
|
|
|
|
pointing to the same data path, you will need to add the cluster name to the
|
|
|
|
data path so that different clusters do not overwrite data.
|
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 15:09:25 -04:00
|
|
|
|
|
|
|
==== Local files
|
|
|
|
|
|
|
|
Prior to 5.0, nodes that were marked with both `node.data: false` and `node.master: false` (or the now removed `node.client: true`)
|
|
|
|
didn't write any files or folder to disk. 5.x added persistent node ids, requiring nodes to store that information. As such, all
|
|
|
|
node types will write a small state file to their data folders.
|