node.asciidoc 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. [[modules-node]]
  2. == Node
  3. Any time that you start an instance of Elasticsearch, you are starting a
  4. _node_. A collection of connected nodes is called a
  5. <<modules-cluster,cluster>>. If you are running a single node of Elasticsearch,
  6. then you have a cluster of one node.
  7. Every node in the cluster can handle <<modules-http,HTTP>> and
  8. <<modules-transport,Transport>> traffic by default. The transport layer
  9. is used exclusively for communication between nodes and the
  10. {javaclient}/transport-client.html[Java `TransportClient`]; the HTTP layer is
  11. used only by external REST clients.
  12. All nodes know about all the other nodes in the cluster and can forward client
  13. requests to the appropriate node. Besides that, each node serves one or more
  14. purpose:
  15. <<master-node,Master-eligible node>>::
  16. A node that has `node.master` set to `true` (default), which makes it eligible
  17. to be <<modules-discovery,elected as the _master_ node>>, which controls
  18. the cluster.
  19. <<data-node,Data node>>::
  20. A node that has `node.data` set to `true` (default). Data nodes hold data and
  21. perform data related operations such as CRUD, search, and aggregations.
  22. <<ingest,Ingest node>>::
  23. A node that has `node.ingest` set to `true` (default). Ingest nodes are able
  24. to apply an <<pipeline,ingest pipeline>> to a document in order to transform
  25. and enrich the document before indexing. With a heavy ingest load, it makes
  26. sense to use dedicated ingest nodes and to mark the master and data nodes as
  27. `node.ingest: false`.
  28. [NOTE]
  29. [[coordinating-node]]
  30. .Coordinating node
  31. ===============================================
  32. Requests like search requests or bulk-indexing requests may involve data held
  33. on different data nodes. A search request, for example, is executed in two
  34. phases which are coordinated by the node which receives the client request --
  35. the _coordinating node_.
  36. In the _scatter_ phase, the coordinating node forwards the request to the data
  37. nodes which hold the data. Each data node executes the request locally and
  38. returns its results to the coordinating node. In the _gather_ phase, the
  39. coordinating node reduces each data node's results into a single global
  40. resultset.
  41. Every node is implicitly a coordinating node. This means that a node that has
  42. all three `node.master`, `node.data` and `node.ingest` set to `false` will
  43. only act as a coordinating node, which cannot be disabled. As a result, such
  44. a node needs to have enough memory and CPU in order to deal with the gather
  45. phase.
  46. ===============================================
  47. [float]
  48. [[master-node]]
  49. === Master Eligible Node
  50. The master node is responsible for lightweight cluster-wide actions such as
  51. creating or deleting an index, tracking which nodes are part of the cluster,
  52. and deciding which shards to allocate to which nodes. It is important for
  53. cluster health to have a stable master node.
  54. Any master-eligible node (all nodes by default) may be elected to become the
  55. master node by the <<modules-discovery,master election process>>.
  56. IMPORTANT: Master nodes must have access to the `data/` directory (just like
  57. `data` nodes) as this is where the cluster state is persisted between node restarts.
  58. Indexing and searching your data is CPU-, memory-, and I/O-intensive work
  59. which can put pressure on a node's resources. To ensure that your master
  60. node is stable and not under pressure, it is a good idea in a bigger
  61. cluster to split the roles between dedicated master-eligible nodes and
  62. dedicated data nodes.
  63. While master nodes can also behave as <<coordinating-node,coordinating nodes>>
  64. and route search and indexing requests from clients to data nodes, it is
  65. better _not_ to use dedicated master nodes for this purpose. It is important
  66. for the stability of the cluster that master-eligible nodes do as little work
  67. as possible.
  68. To create a dedicated master-eligible node, set:
  69. [source,yaml]
  70. -------------------
  71. node.master: true <1>
  72. node.data: false <2>
  73. node.ingest: false <3>
  74. cluster.remote.connect: false <4>
  75. -------------------
  76. <1> The `node.master` role is enabled by default.
  77. <2> Disable the `node.data` role (enabled by default).
  78. <3> Disable the `node.ingest` role (enabled by default).
  79. <4> Disable cross-cluster search (enabled by default).
  80. ifdef::include-xpack[]
  81. NOTE: These settings apply only when {xpack} is not installed. To create a
  82. dedicated master-eligible node when {xpack} is installed, see <<modules-node-xpack,{xpack} node settings>>.
  83. endif::include-xpack[]
  84. [float]
  85. [[data-node]]
  86. === Data Node
  87. Data nodes hold the shards that contain the documents you have indexed. Data
  88. nodes handle data related operations like CRUD, search, and aggregations.
  89. These operations are I/O-, memory-, and CPU-intensive. It is important to
  90. monitor these resources and to add more data nodes if they are overloaded.
  91. The main benefit of having dedicated data nodes is the separation of the
  92. master and data roles.
  93. To create a dedicated data node, set:
  94. [source,yaml]
  95. -------------------
  96. node.master: false <1>
  97. node.data: true <2>
  98. node.ingest: false <3>
  99. cluster.remote.connect: false <4>
  100. -------------------
  101. <1> Disable the `node.master` role (enabled by default).
  102. <2> The `node.data` role is enabled by default.
  103. <3> Disable the `node.ingest` role (enabled by default).
  104. <4> Disable cross-cluster search (enabled by default).
  105. ifdef::include-xpack[]
  106. NOTE: These settings apply only when {xpack} is not installed. To create a
  107. dedicated data node when {xpack} is installed, see <<modules-node-xpack,{xpack} node settings>>.
  108. endif::include-xpack[]
  109. [float]
  110. [[node-ingest-node]]
  111. === Ingest Node
  112. Ingest nodes can execute pre-processing pipelines, composed of one or more
  113. ingest processors. Depending on the type of operations performed by the ingest
  114. processors and the required resources, it may make sense to have dedicated
  115. ingest nodes, that will only perform this specific task.
  116. To create a dedicated ingest node, set:
  117. [source,yaml]
  118. -------------------
  119. node.master: false <1>
  120. node.data: false <2>
  121. node.ingest: true <3>
  122. cluster.remote.connect: false <4>
  123. -------------------
  124. <1> Disable the `node.master` role (enabled by default).
  125. <2> Disable the `node.data` role (enabled by default).
  126. <3> The `node.ingest` role is enabled by default.
  127. <4> Disable cross-cluster search (enabled by default).
  128. ifdef::include-xpack[]
  129. NOTE: These settings apply only when {xpack} is not installed. To create a
  130. dedicated ingest node when {xpack} is installed, see <<modules-node-xpack,{xpack} node settings>>.
  131. endif::include-xpack[]
  132. [float]
  133. [[coordinating-only-node]]
  134. === Coordinating only node
  135. If you take away the ability to be able to handle master duties, to hold data,
  136. and pre-process documents, then you are left with a _coordinating_ node that
  137. can only route requests, handle the search reduce phase, and distribute bulk
  138. indexing. Essentially, coordinating only nodes behave as smart load balancers.
  139. Coordinating only nodes can benefit large clusters by offloading the
  140. coordinating node role from data and master-eligible nodes. They join the
  141. cluster and receive the full <<cluster-state,cluster state>>, like every other
  142. node, and they use the cluster state to route requests directly to the
  143. appropriate place(s).
  144. WARNING: Adding too many coordinating only nodes to a cluster can increase the
  145. burden on the entire cluster because the elected master node must await
  146. acknowledgement of cluster state updates from every node! The benefit of
  147. coordinating only nodes should not be overstated -- data nodes can happily
  148. serve the same purpose.
  149. To create a dedicated coordinating node, set:
  150. [source,yaml]
  151. -------------------
  152. node.master: false <1>
  153. node.data: false <2>
  154. node.ingest: false <3>
  155. cluster.remote.connect: false <4>
  156. -------------------
  157. <1> Disable the `node.master` role (enabled by default).
  158. <2> Disable the `node.data` role (enabled by default).
  159. <3> Disable the `node.ingest` role (enabled by default).
  160. <4> Disable cross-cluster search (enabled by default).
  161. ifdef::include-xpack[]
  162. NOTE: These settings apply only when {xpack} is not installed. To create a
  163. dedicated coordinating node when {xpack} is installed, see <<modules-node-xpack,{xpack} node settings>>.
  164. endif::include-xpack[]
  165. [float]
  166. == Node data path settings
  167. [float]
  168. [[data-path]]
  169. === `path.data`
  170. Every data and master-eligible node requires access to a data directory where
  171. shards and index and cluster metadata will be stored. The `path.data` defaults
  172. to `$ES_HOME/data` but can be configured in the `elasticsearch.yml` config
  173. file an absolute path or a path relative to `$ES_HOME` as follows:
  174. [source,yaml]
  175. -----------------------
  176. path.data: /var/elasticsearch/data
  177. -----------------------
  178. Like all node settings, it can also be specified on the command line as:
  179. [source,sh]
  180. -----------------------
  181. ./bin/elasticsearch -Epath.data=/var/elasticsearch/data
  182. -----------------------
  183. TIP: When using the `.zip` or `.tar.gz` distributions, the `path.data` setting
  184. should be configured to locate the data directory outside the Elasticsearch
  185. home directory, so that the home directory can be deleted without deleting
  186. your data! The RPM and Debian distributions do this for you already.
  187. [float]
  188. [[max-local-storage-nodes]]
  189. === `node.max_local_storage_nodes`
  190. The <<data-path,data path>> can be shared by multiple nodes, even by nodes from different
  191. clusters. This is very useful for testing failover and different configurations on your development
  192. machine. In production, however, it is recommended to run only one node of Elasticsearch per server.
  193. By default, Elasticsearch is configured to prevent more than one node from sharing the same data
  194. path. To allow for more than one node (e.g., on your development machine), use the setting
  195. `node.max_local_storage_nodes` and set this to a positive integer larger than one.
  196. WARNING: Never run different node types (i.e. master, data) from the same data directory. This can
  197. lead to unexpected data loss.
  198. [float]
  199. == Other node settings
  200. More node settings can be found in <<modules,Modules>>. Of particular note are
  201. the <<cluster.name,`cluster.name`>>, the <<node.name,`node.name`>> and the
  202. <<modules-network,network settings>>.
  203. ifdef::include-xpack[]
  204. include::ml-node.asciidoc[]
  205. endif::include-xpack[]