node.asciidoc 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. [IMPORTANT]
  39. ====
  40. If you set `node.roles`, ensure you specify every node role your cluster needs.
  41. Every cluster requires the following node roles:
  42. * `master`
  43. * {blank}
  44. +
  45. --
  46. `data_content` and `data_hot` +
  47. OR +
  48. `data`
  49. --
  50. Some {stack} features also require specific node roles:
  51. - {ccs-cap} and {ccr} require the `remote_cluster_client` role.
  52. - {stack-monitor-app} and ingest pipelines require the `ingest` role.
  53. - {fleet}, the {security-app}, and {transforms} require the `transform` role.
  54. The `remote_cluster_client` role is also required to use {ccs} with these
  55. features.
  56. - {ml-cap} features, such as {anomaly-detect}, require the `ml` role.
  57. ====
  58. As the cluster grows and in particular if you have large {ml} jobs or
  59. {ctransforms}, consider separating dedicated master-eligible nodes from
  60. dedicated data nodes, {ml} nodes, and {transform} nodes.
  61. To learn more about the available node roles, see <<node-roles-overview>>.
  62. [discrete]
  63. === Node data path settings
  64. [[data-path]]
  65. ==== `path.data`
  66. Every data and master-eligible node requires access to a data directory where
  67. shards and index and cluster metadata will be stored. The `path.data` defaults
  68. to `$ES_HOME/data` but can be configured in the `elasticsearch.yml` config
  69. file an absolute path or a path relative to `$ES_HOME` as follows:
  70. [source,yaml]
  71. ----
  72. path.data: /var/elasticsearch/data
  73. ----
  74. Like all node settings, it can also be specified on the command line as:
  75. [source,sh]
  76. ----
  77. ./bin/elasticsearch -Epath.data=/var/elasticsearch/data
  78. ----
  79. The contents of the `path.data` directory must persist across restarts, because
  80. this is where your data is stored. {es} requires the filesystem to act as if it
  81. were backed by a local disk, but this means that it will work correctly on
  82. properly-configured remote block devices (e.g. a SAN) and remote filesystems
  83. (e.g. NFS) as long as the remote storage behaves no differently from local
  84. storage. You can run multiple {es} nodes on the same filesystem, but each {es}
  85. node must have its own data path.
  86. TIP: When using the `.zip` or `.tar.gz` distributions, the `path.data` setting
  87. should be configured to locate the data directory outside the {es} home
  88. directory, so that the home directory can be deleted without deleting your data!
  89. The RPM and Debian distributions do this for you already.
  90. // tag::modules-node-data-path-warning-tag[]
  91. WARNING: Don't modify anything within the data directory or run processes that
  92. might interfere with its contents. If something other than {es} modifies the
  93. contents of the data directory, then {es} may fail, reporting corruption or
  94. other data inconsistencies, or may appear to work correctly having silently
  95. lost some of your data. Don't attempt to take filesystem backups of the data
  96. directory; there is no supported way to restore such a backup. Instead, use
  97. <<snapshot-restore>> to take backups safely. Don't run virus scanners on the
  98. data directory. A virus scanner can prevent {es} from working correctly and may
  99. modify the contents of the data directory. The data directory contains no
  100. executables so a virus scan will only find false positives.
  101. // end::modules-node-data-path-warning-tag[]
  102. [[custom-node-attributes]]
  103. ==== Custom node attributes
  104. 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>>.
  105. [TIP]
  106. ===============================================
  107. You can also set a node attribute using the `-E` command line argument when you start a node:
  108. [source,sh]
  109. --------------------------------------------------------
  110. ./bin/elasticsearch -Enode.attr.rack_id=rack_one
  111. --------------------------------------------------------
  112. ===============================================
  113. `node.attr.<attribute-name>`::
  114. (<<dynamic-cluster-setting,Dynamic>>)
  115. 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.
  116. [discrete]
  117. [[other-node-settings]]
  118. === Other node settings
  119. More node settings can be found in <<settings>> and <<important-settings>>,
  120. including:
  121. * <<cluster-name,`cluster.name`>>
  122. * <<node-name,`node.name`>>
  123. * <<modules-network,network settings>>