node.asciidoc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. [[modules-node]]
  2. == Node
  3. Any time that you start an instance of Elasticsearch, you are starting a _node_.
  4. A 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-http,HTTP>> and
  7. <<modules-transport,Transport>> traffic by default. The transport layer is used
  8. exclusively for communication between nodes; the HTTP layer is used by REST
  9. clients.
  10. All nodes know about all the other nodes in the cluster and can forward client
  11. requests to the appropriate node.
  12. By default, a node is all of the following types: master-eligible, data, ingest,
  13. and machine learning (if available).
  14. TIP: As the cluster grows and in particular if you have large {ml} jobs,
  15. consider separating dedicated master-eligible nodes from dedicated data nodes
  16. and dedicated {ml} nodes.
  17. <<master-node,Master-eligible node>>::
  18. A node that has `node.master` set to `true` (default), which makes it eligible
  19. to be <<modules-discovery,elected as the _master_ node>>, which controls the
  20. cluster.
  21. <<data-node,Data node>>::
  22. A node that has `node.data` set to `true` (default). Data nodes hold data and
  23. perform data related operations such as CRUD, search, and aggregations.
  24. <<ingest,Ingest node>>::
  25. A node that has `node.ingest` set to `true` (default). Ingest nodes are able
  26. to apply an <<pipeline,ingest pipeline>> to a document in order to transform
  27. and enrich the document before indexing. With a heavy ingest load, it makes
  28. sense to use dedicated ingest nodes and to mark the master and data nodes as
  29. `node.ingest: false`.
  30. <<ml-node,Machine learning node>>::
  31. A node that has `xpack.ml.enabled` and `node.ml` set to `true`, which is the
  32. default behavior in the {es} {default-dist}. If you want to use {ml-features},
  33. there must be at least one {ml} node in your cluster. For more information about
  34. {ml-features}, see
  35. {ml-docs}/index.html[Machine learning in the {stack}].
  36. +
  37. IMPORTANT: If you use the {oss-dist}, do not set `node.ml`. Otherwise, the node
  38. fails to start.
  39. <<transform-node,{transform-cap} node>>::
  40. A node that has `xpack.transform.enabled` and `node.transform` set to `true`. If
  41. you want to use {transforms}, there must be at least one {transform} node in
  42. your cluster. For more information, see <<transform-settings>> and
  43. <<transforms>>.
  44. [NOTE]
  45. [[coordinating-node]]
  46. .Coordinating node
  47. ===============================================
  48. Requests like search requests or bulk-indexing requests may involve data held
  49. on different data nodes. A search request, for example, is executed in two
  50. phases which are coordinated by the node which receives the client request --
  51. the _coordinating node_.
  52. In the _scatter_ phase, the coordinating node forwards the request to the data
  53. nodes which hold the data. Each data node executes the request locally and
  54. returns its results to the coordinating node. In the _gather_ phase, the
  55. coordinating node reduces each data node's results into a single global
  56. resultset.
  57. Every node is implicitly a coordinating node. This means that a node that has
  58. all three `node.master`, `node.data` and `node.ingest` set to `false` will
  59. only act as a coordinating node, which cannot be disabled. As a result, such
  60. a node needs to have enough memory and CPU in order to deal with the gather
  61. phase.
  62. ===============================================
  63. [float]
  64. [[master-node]]
  65. === Master-eligible node
  66. The master node is responsible for lightweight cluster-wide actions such as
  67. creating or deleting an index, tracking which nodes are part of the cluster,
  68. and deciding which shards to allocate to which nodes. It is important for
  69. cluster health to have a stable master node.
  70. Any master-eligible node that is not a <<voting-only-node,voting-only node>> may
  71. be elected to become the master node by the <<modules-discovery,master election
  72. process>>.
  73. IMPORTANT: Master nodes must have access to the `data/` directory (just like
  74. `data` nodes) as this is where the cluster state is persisted between node
  75. restarts.
  76. [float]
  77. [[dedicated-master-node]]
  78. ==== Dedicated master-eligible node
  79. It is important for the health of the cluster that the elected master node has
  80. the resources it needs to fulfill its responsibilities. If the elected master
  81. node is overloaded with other tasks then the cluster may not operate well. In
  82. particular, indexing and searching your data can be very resource-intensive, so
  83. in large or high-throughput clusters it is a good idea to avoid using the
  84. master-eligible nodes for tasks such as indexing and searching. You can do this
  85. by configuring three of your nodes to be dedicated master-eligible nodes.
  86. Dedicated master-eligible nodes only have the `master` role, allowing them to
  87. focus on managing the cluster. While master nodes can also behave as
  88. <<coordinating-node,coordinating nodes>> and route search and indexing requests
  89. from clients to data nodes, it is better _not_ to use dedicated master nodes for
  90. this purpose.
  91. To create a dedicated master-eligible node in the {default-dist}, set:
  92. [source,yaml]
  93. -------------------
  94. node.master: true <1>
  95. node.voting_only: false <2>
  96. node.data: false <3>
  97. node.ingest: false <4>
  98. node.ml: false <5>
  99. xpack.ml.enabled: true <6>
  100. node.transform: false <7>
  101. xpack.transform.enabled: true <8>
  102. node.remote_client_client: false <9>
  103. -------------------
  104. <1> The `node.master` role is enabled by default.
  105. <2> The `node.voting_only` role is disabled by default.
  106. <3> Disable the `node.data` role (enabled by default).
  107. <4> Disable the `node.ingest` role (enabled by default).
  108. <5> Disable the `node.ml` role (enabled by default).
  109. <6> The `xpack.ml.enabled` setting is enabled by default.
  110. <7> Disable the `node.transform` role.
  111. <8> The `xpack.transform.enabled` setting is enabled by default.
  112. <9> Disable remote cluster connections (enabled by default).
  113. To create a dedicated master-eligible node in the {oss-dist}, set:
  114. [source,yaml]
  115. -------------------
  116. node.master: true <1>
  117. node.data: false <2>
  118. node.ingest: false <3>
  119. node.remote_cluster_client: false <4>
  120. -------------------
  121. <1> The `node.master` role is enabled by default.
  122. <2> Disable the `node.data` role (enabled by default).
  123. <3> Disable the `node.ingest` role (enabled by default).
  124. <4> Disable remote cluster connections (enabled by default).
  125. [float]
  126. [[voting-only-node]]
  127. ==== Voting-only master-eligible node
  128. A voting-only master-eligible node is a node that participates in
  129. <<modules-discovery,master elections>> but which will not act as the cluster's
  130. elected master node. In particular, a voting-only node can serve as a tiebreaker
  131. in elections.
  132. It may seem confusing to use the term "master-eligible" to describe a
  133. voting-only node since such a node is not actually eligible to become the master
  134. at all. This terminology is an unfortunate consequence of history:
  135. master-eligible nodes are those nodes that participate in elections and perform
  136. certain tasks during cluster state publications, and voting-only nodes have the
  137. same responsibilities even if they can never become the elected master.
  138. To configure a master-eligible node as a voting-only node, set the following
  139. setting:
  140. [source,yaml]
  141. -------------------
  142. node.voting_only: true <1>
  143. -------------------
  144. <1> The default for `node.voting_only` is `false`.
  145. IMPORTANT: The `voting_only` role requires the {default-dist} of {es} and is not
  146. supported in the {oss-dist}. If you use the {oss-dist} and set
  147. `node.voting_only` then the node will fail to start. Also note that only
  148. master-eligible nodes can be marked as voting-only.
  149. High availability (HA) clusters require at least three master-eligible nodes, at
  150. least two of which are not voting-only nodes. Such a cluster will be able to
  151. elect a master node even if one of the nodes fails.
  152. Since voting-only nodes never act as the cluster's elected master, they may
  153. require require less heap and a less powerful CPU than the true master nodes.
  154. However all master-eligible nodes, including voting-only nodes, require
  155. reasonably fast persistent storage and a reliable and low-latency network
  156. connection to the rest of the cluster, since they are on the critical path for
  157. <<cluster-state-publishing,publishing cluster state updates>>.
  158. Voting-only master-eligible nodes may also fill other roles in your cluster.
  159. For instance, a node may be both a data node and a voting-only master-eligible
  160. node. A _dedicated_ voting-only master-eligible nodes is a voting-only
  161. master-eligible node that fills no other roles in the cluster. To create a
  162. dedicated voting-only master-eligible node in the {default-dist}, set:
  163. [source,yaml]
  164. -------------------
  165. node.master: true <1>
  166. node.voting_only: true <2>
  167. node.data: false <3>
  168. node.ingest: false <4>
  169. node.ml: false <5>
  170. xpack.ml.enabled: true <6>
  171. node.transform: false <7>
  172. xpack.transform.enabled: true <8>
  173. node.remote_cluster_client: false <9>
  174. -------------------
  175. <1> The `node.master` role is enabled by default.
  176. <2> Enable the `node.voting_only` role (disabled by default).
  177. <3> Disable the `node.data` role (enabled by default).
  178. <4> Disable the `node.ingest` role (enabled by default).
  179. <5> Disable the `node.ml` role (enabled by default).
  180. <6> The `xpack.ml.enabled` setting is enabled by default.
  181. <7> Disable the `node.transform` role.
  182. <8> The `xpack.transform.enabled` setting is enabled by default.
  183. <9> Disable remote cluster connections (enabled by default).
  184. [float]
  185. [[data-node]]
  186. === Data node
  187. Data nodes hold the shards that contain the documents you have indexed. Data
  188. nodes handle data related operations like CRUD, search, and aggregations.
  189. These operations are I/O-, memory-, and CPU-intensive. It is important to
  190. monitor these resources and to add more data nodes if they are overloaded.
  191. The main benefit of having dedicated data nodes is the separation of the master
  192. and data roles.
  193. To create a dedicated data node in the {default-dist}, set:
  194. [source,yaml]
  195. -------------------
  196. node.master: false <1>
  197. node.voting_only: false <2>
  198. node.data: true <3>
  199. node.ingest: false <4>
  200. node.ml: false <5>
  201. node.transform: false <6>
  202. xpack.transform.enabled: true <7>
  203. node.remote_cluster_client: false <8>
  204. -------------------
  205. <1> Disable the `node.master` role (enabled by default).
  206. <2> The `node.voting_only` role is disabled by default.
  207. <3> The `node.data` role is enabled by default.
  208. <4> Disable the `node.ingest` role (enabled by default).
  209. <5> Disable the `node.ml` role (enabled by default).
  210. <6> Disable the `node.transform` role.
  211. <7> The `xpack.transform.enabled` setting is enabled by default.
  212. <8> Disable remote cluster connections (enabled by default).
  213. To create a dedicated data node in the {oss-dist}, set:
  214. [source,yaml]
  215. -------------------
  216. node.master: false <1>
  217. node.data: true <2>
  218. node.ingest: false <3>
  219. node.remote_cluster_client: false <4>
  220. -------------------
  221. <1> Disable the `node.master` role (enabled by default).
  222. <2> The `node.data` role is enabled by default.
  223. <3> Disable the `node.ingest` role (enabled by default).
  224. <4> Disable remote cluster connections (enabled by default).
  225. [float]
  226. [[node-ingest-node]]
  227. === Ingest node
  228. Ingest nodes can execute pre-processing pipelines, composed of one or more
  229. ingest processors. Depending on the type of operations performed by the ingest
  230. processors and the required resources, it may make sense to have dedicated
  231. ingest nodes, that will only perform this specific task.
  232. To create a dedicated ingest node in the {default-dist}, set:
  233. [source,yaml]
  234. -------------------
  235. node.master: false <1>
  236. node.voting_only: false <2>
  237. node.data: false <3>
  238. node.ingest: true <4>
  239. node.ml: false <5>
  240. node.transform: false <6>
  241. node.remote_cluster_client: false <7>
  242. -------------------
  243. <1> Disable the `node.master` role (enabled by default).
  244. <2> The `node.voting_only` role is disabled by default.
  245. <3> Disable the `node.data` role (enabled by default).
  246. <4> The `node.ingest` role is enabled by default.
  247. <5> Disable the `node.ml` role (enabled by default).
  248. <6> Disable the `node.transform` role.
  249. <7> Disable remote cluster connections (enabled by default).
  250. To create a dedicated ingest node in the {oss-dist}, set:
  251. [source,yaml]
  252. -------------------
  253. node.master: false <1>
  254. node.data: false <2>
  255. node.ingest: true <3>
  256. node.remote_cluster_client: false <4>
  257. -------------------
  258. <1> Disable the `node.master` role (enabled by default).
  259. <2> Disable the `node.data` role (enabled by default).
  260. <3> The `node.ingest` role is enabled by default.
  261. <4> Disable remote cluster connections (enabled by default).
  262. [float]
  263. [[coordinating-only-node]]
  264. === Coordinating only node
  265. If you take away the ability to be able to handle master duties, to hold data,
  266. and pre-process documents, then you are left with a _coordinating_ node that
  267. can only route requests, handle the search reduce phase, and distribute bulk
  268. indexing. Essentially, coordinating only nodes behave as smart load balancers.
  269. Coordinating only nodes can benefit large clusters by offloading the
  270. coordinating node role from data and master-eligible nodes. They join the
  271. cluster and receive the full <<cluster-state,cluster state>>, like every other
  272. node, and they use the cluster state to route requests directly to the
  273. appropriate place(s).
  274. WARNING: Adding too many coordinating only nodes to a cluster can increase the
  275. burden on the entire cluster because the elected master node must await
  276. acknowledgement of cluster state updates from every node! The benefit of
  277. coordinating only nodes should not be overstated -- data nodes can happily
  278. serve the same purpose.
  279. To create a dedicated coordinating node in the {default-dist}, set:
  280. [source,yaml]
  281. -------------------
  282. node.master: false <1>
  283. node.voting_only: false <2>
  284. node.data: false <3>
  285. node.ingest: false <4>
  286. node.ml: false <5>
  287. xpack.ml.enabled: true <6>
  288. node.transform: false <7>
  289. xpack.transform.enabled: true <8>
  290. node.remote_cluster_client: false <9>
  291. -------------------
  292. <1> Disable the `node.master` role (enabled by default).
  293. <2> The `node.voting_only` role is disabled by default.
  294. <3> Disable the `node.data` role (enabled by default).
  295. <4> Disable the `node.ingest` role (enabled by default).
  296. <5> Disable the `node.ml` role (enabled by default).
  297. <6> The `xpack.ml.enabled` setting is enabled by default.
  298. <7> Disable the `node.transform` role.
  299. <8> The `xpack.transform.enabled` setting is enabled by default.
  300. <9> Disable remote cluster connections (enabled by default).
  301. To create a dedicated coordinating node in the {oss-dist}, set:
  302. [source,yaml]
  303. -------------------
  304. node.master: false <1>
  305. node.data: false <2>
  306. node.ingest: false <3>
  307. node.remote_cluster_client: false <4>
  308. -------------------
  309. <1> Disable the `node.master` role (enabled by default).
  310. <2> Disable the `node.data` role (enabled by default).
  311. <3> Disable the `node.ingest` role (enabled by default).
  312. <4> Disable remote cluster connections (enabled by default).
  313. [float]
  314. [[ml-node]]
  315. === [xpack]#Machine learning node#
  316. The {ml-features} provide {ml} nodes, which run jobs and handle {ml} API
  317. requests. If `xpack.ml.enabled` is set to `true` and `node.ml` is set to `false`,
  318. the node can service API requests but it cannot run jobs.
  319. If you want to use {ml-features} in your cluster, you must enable {ml}
  320. (set `xpack.ml.enabled` to `true`) on all master-eligible nodes. If you want to
  321. use {ml-features} in clients (including {kib}), it must also be enabled on all
  322. coordinating nodes. If you have the {oss-dist}, do not use these settings.
  323. For more information about these settings, see <<ml-settings>>.
  324. To create a dedicated {ml} node in the {default-dist}, set:
  325. [source,yaml]
  326. -------------------
  327. node.master: false <1>
  328. node.voting_only: false <2>
  329. node.data: false <3>
  330. node.ingest: false <4>
  331. node.ml: true <5>
  332. xpack.ml.enabled: true <6>
  333. node.transform: false <7>
  334. xpack.transform.enabled: true <8>
  335. node.remote_cluster_client: false <9>
  336. -------------------
  337. <1> Disable the `node.master` role (enabled by default).
  338. <2> The `node.voting_only` role is disabled by default.
  339. <3> Disable the `node.data` role (enabled by default).
  340. <4> Disable the `node.ingest` role (enabled by default).
  341. <5> The `node.ml` role is enabled by default.
  342. <6> The `xpack.ml.enabled` setting is enabled by default.
  343. <7> Disable the `node.transform` role.
  344. <8> The `xpack.transform.enabled` setting is enabled by default.
  345. <9> Disable remote cluster connections (enabled by default).
  346. [discrete]
  347. [[transform-node]]
  348. === [xpack]#{transform-cap} node#
  349. {transform-cap} nodes run {transforms} and handle {transform} API requests.
  350. If you want to use {transforms} in your cluster, you must have
  351. `xpack.transform.enabled` set to `true` on all master-eligible nodes and all
  352. data nodes. If you want to use {transforms} in clients (including {kib}), it
  353. must also be enabled on all coordinating nodes. You must also have
  354. `node.transform` set to `true` on at least one node. This is the default
  355. behavior. If you have the {oss-dist}, do not use these settings. For more
  356. information, see <<transform-settings>>.
  357. To create a dedicated {transform} node in the {default-dist}, set:
  358. [source,yaml]
  359. -------------------
  360. node.master: false <1>
  361. node.voting_only: false <2>
  362. node.data: false <3>
  363. node.ingest: false <4>
  364. node.ml: false <5>
  365. node.transform: true <6>
  366. xpack.transform.enabled: true <7>
  367. node.remote_cluster_client: false <8>
  368. -------------------
  369. <1> Disable the `node.master` role.
  370. <2> Disable the `node.voting_only`.
  371. <3> Disable the `node.data` role.
  372. <4> Disable the `node.ingest` role.
  373. <5> Disable the `node.ml` role.
  374. <6> Enable the `node.transform` role.
  375. <7> Enable the `xpack.transform.enabled` setting.
  376. <8> Disable remote cluster connections.
  377. [float]
  378. [[change-node-role]]
  379. === Changing the role of a node
  380. Each data node maintains the following data on disk:
  381. * the shard data for every shard allocated to that node,
  382. * the index metadata corresponding with every shard allocated to that node, and
  383. * the cluster-wide metadata, such as settings and index templates.
  384. Similarly, each master-eligible node maintains the following data on disk:
  385. * the index metadata for every index in the cluster, and
  386. * the cluster-wide metadata, such as settings and index templates.
  387. Each node checks the contents of its data path at startup. If it discovers
  388. unexpected data then it will refuse to start. This is to avoid importing
  389. unwanted <<modules-gateway-dangling-indices,dangling indices>> which can lead
  390. to a red cluster health. To be more precise, nodes with `node.data: false` will
  391. refuse to start if they find any shard data on disk at startup, and nodes with
  392. both `node.master: false` and `node.data: false` will refuse to start if they
  393. have any index metadata on disk at startup.
  394. It is possible to change the roles of a node by adjusting its
  395. `elasticsearch.yml` file and restarting it. This is known as _repurposing_ a
  396. node. In order to satisfy the checks for unexpected data described above, you
  397. must perform some extra steps to prepare a node for repurposing when setting
  398. its `node.data` or `node.master` roles to `false`:
  399. * If you want to repurpose a data node by changing `node.data` to `false` then
  400. you should first use an <<allocation-filtering,allocation filter>> to safely
  401. migrate all the shard data onto other nodes in the cluster.
  402. * If you want to repurpose a node to have both `node.master: false` and
  403. `node.data: false` then it is simplest to start a brand-new node with an
  404. empty data path and the desired roles. You may find it safest to use an
  405. <<allocation-filtering,allocation filter>> to migrate the shard data
  406. elsewhere in the cluster first.
  407. If it is not possible to follow these extra steps then you may be able to use
  408. the <<node-tool-repurpose,`elasticsearch-node repurpose`>> tool to delete any
  409. excess data that prevents a node from starting.
  410. [float]
  411. == Node data path settings
  412. [float]
  413. [[data-path]]
  414. === `path.data`
  415. Every data and master-eligible node requires access to a data directory where
  416. shards and index and cluster metadata will be stored. The `path.data` defaults
  417. to `$ES_HOME/data` but can be configured in the `elasticsearch.yml` config
  418. file an absolute path or a path relative to `$ES_HOME` as follows:
  419. [source,yaml]
  420. -----------------------
  421. path.data: /var/elasticsearch/data
  422. -----------------------
  423. Like all node settings, it can also be specified on the command line as:
  424. [source,sh]
  425. -----------------------
  426. ./bin/elasticsearch -Epath.data=/var/elasticsearch/data
  427. -----------------------
  428. TIP: When using the `.zip` or `.tar.gz` distributions, the `path.data` setting
  429. should be configured to locate the data directory outside the {es} home
  430. directory, so that the home directory can be deleted without deleting your data!
  431. The RPM and Debian distributions do this for you already.
  432. [float]
  433. == Other node settings
  434. More node settings can be found in <<modules,Modules>>. Of particular note are
  435. the <<cluster.name,`cluster.name`>>, the <<node.name,`node.name`>> and the
  436. <<modules-network,network settings>>.