node.asciidoc 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. [[modules-node]]
  2. === Node settings
  3. Any time that you start an instance of {es}, you are starting a _node_. A
  4. collection of connected nodes is called a <<modules-cluster,cluster>>. If you
  5. are running a single node of {es}, then you have a cluster of one node.
  6. Every node in the cluster can handle <<modules-network,HTTP and transport>>
  7. traffic by default. The transport layer is used exclusively for communication
  8. between nodes; the HTTP layer is used by REST clients.
  9. [[modules-node-description]]
  10. // tag::modules-node-description-tag[]
  11. All nodes know about all the other nodes in the cluster and can forward client
  12. requests to the appropriate node.
  13. // end::modules-node-description-tag[]
  14. TIP: The performance of an {es} node is often limited by the performance of the underlying storage.
  15. Review our recommendations for optimizing your storage for <<indexing-use-faster-hardware,indexing>> and
  16. <<search-use-faster-hardware,search>>.
  17. [[node-name-settings]]
  18. ==== Node name setting
  19. include::{es-ref-dir}/setup/important-settings/node-name.asciidoc[]
  20. [[node-roles]]
  21. ==== Node role settings
  22. You define a node's roles by setting `node.roles` in `elasticsearch.yml`. If you
  23. set `node.roles`, the node is only assigned the roles you specify. If you don't
  24. set `node.roles`, the node is assigned the following roles:
  25. * [[master-node]]`master`
  26. * [[data-node]]`data`
  27. * `data_content`
  28. * `data_hot`
  29. * `data_warm`
  30. * `data_cold`
  31. * `data_frozen`
  32. * `ingest`
  33. * [[ml-node]]`ml`
  34. * `remote_cluster_client`
  35. * [[transform-node]]`transform`
  36. The following additional roles are available:
  37. * `voting_only`
  38. [NOTE]
  39. [[coordinating-only-node]]
  40. .Coordinating node
  41. ===============================================
  42. Requests like search requests or bulk-indexing requests may involve data held
  43. on different data nodes. A search request, for example, is executed in two
  44. phases which are coordinated by the node which receives the client request --
  45. the _coordinating node_.
  46. In the _scatter_ phase, the coordinating node forwards the request to the data
  47. nodes which hold the data. Each data node executes the request locally and
  48. returns its results to the coordinating node. In the _gather_ phase, the
  49. coordinating node reduces each data node's results into a single global
  50. result set.
  51. Every node is implicitly a coordinating node. This means that a node that has
  52. an explicit empty list of roles in the `node.roles` setting will only act as a coordinating
  53. node, which cannot be disabled. As a result, such a node needs to have enough
  54. memory and CPU in order to deal with the gather phase.
  55. ===============================================
  56. [IMPORTANT]
  57. ====
  58. If you set `node.roles`, ensure you specify every node role your cluster needs.
  59. Every cluster requires the following node roles:
  60. * `master`
  61. * {blank}
  62. +
  63. --
  64. `data_content` and `data_hot` +
  65. OR +
  66. `data`
  67. --
  68. Some {stack} features also require specific node roles:
  69. - {ccs-cap} and {ccr} require the `remote_cluster_client` role.
  70. - {stack-monitor-app} and ingest pipelines require the `ingest` role.
  71. - {fleet}, the {security-app}, and {transforms} require the `transform` role.
  72. The `remote_cluster_client` role is also required to use {ccs} with these
  73. features.
  74. - {ml-cap} features, such as {anomaly-detect}, require the `ml` role.
  75. ====
  76. As the cluster grows and in particular if you have large {ml} jobs or
  77. {ctransforms}, consider separating dedicated master-eligible nodes from
  78. dedicated data nodes, {ml} nodes, and {transform} nodes.
  79. To learn more about the available node roles, see <<node-roles-overview>>.
  80. [discrete]
  81. === Node data path settings
  82. [[data-path]]
  83. ==== `path.data`
  84. Every data and master-eligible node requires access to a data directory where
  85. shards and index and cluster metadata will be stored. The `path.data` defaults
  86. to `$ES_HOME/data` but can be configured in the `elasticsearch.yml` config
  87. file an absolute path or a path relative to `$ES_HOME` as follows:
  88. [source,yaml]
  89. ----
  90. path.data: /var/elasticsearch/data
  91. ----
  92. Like all node settings, it can also be specified on the command line as:
  93. [source,sh]
  94. ----
  95. ./bin/elasticsearch -Epath.data=/var/elasticsearch/data
  96. ----
  97. The contents of the `path.data` directory must persist across restarts, because
  98. this is where your data is stored. {es} requires the filesystem to act as if it
  99. were backed by a local disk, but this means that it will work correctly on
  100. properly-configured remote block devices (e.g. a SAN) and remote filesystems
  101. (e.g. NFS) as long as the remote storage behaves no differently from local
  102. storage. You can run multiple {es} nodes on the same filesystem, but each {es}
  103. node must have its own data path.
  104. TIP: When using the `.zip` or `.tar.gz` distributions, the `path.data` setting
  105. should be configured to locate the data directory outside the {es} home
  106. directory, so that the home directory can be deleted without deleting your data!
  107. The RPM and Debian distributions do this for you already.
  108. // tag::modules-node-data-path-warning-tag[]
  109. WARNING: Don't modify anything within the data directory or run processes that
  110. might interfere with its contents. If something other than {es} modifies the
  111. contents of the data directory, then {es} may fail, reporting corruption or
  112. other data inconsistencies, or may appear to work correctly having silently
  113. lost some of your data. Don't attempt to take filesystem backups of the data
  114. directory; there is no supported way to restore such a backup. Instead, use
  115. <<snapshot-restore>> to take backups safely. Don't run virus scanners on the
  116. data directory. A virus scanner can prevent {es} from working correctly and may
  117. modify the contents of the data directory. The data directory contains no
  118. executables so a virus scan will only find false positives.
  119. // end::modules-node-data-path-warning-tag[]
  120. [[custom-node-attributes]]
  121. ==== Custom node attributes
  122. If needed, you can add custom attributes to a node. These attributes can be used to <<cluster-routing-settings,filter which nodes a shard can be allocated to>>, or to group nodes together for <<shard-allocation-awareness,shard allocation awareness>>.
  123. [TIP]
  124. ===============================================
  125. You can also set a node attribute using the `-E` command line argument when you start a node:
  126. [source,sh]
  127. --------------------------------------------------------
  128. ./bin/elasticsearch -Enode.attr.rack_id=rack_one
  129. --------------------------------------------------------
  130. ===============================================
  131. `node.attr.<attribute-name>`::
  132. (<<dynamic-cluster-setting,Dynamic>>)
  133. A custom attribute that you can assign to a node. For example, you might assign a `rack_id` attribute to each node to ensure that primary and replica shards are not allocated on the same rack. You can specify multiple attributes as a comma-separated list.
  134. [discrete]
  135. [[other-node-settings]]
  136. === Other node settings
  137. More node settings can be found in <<settings>> and <<important-settings>>,
  138. including:
  139. * <<cluster-name,`cluster.name`>>
  140. * <<node-name,`node.name`>>
  141. * <<modules-network,network settings>>