misc.asciidoc 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. [[misc-cluster-settings]]
  2. === Miscellaneous cluster settings
  3. [discrete]
  4. [[cluster-read-only]]
  5. ==== Metadata
  6. An entire cluster may be set to read-only with the following setting:
  7. `cluster.blocks.read_only`::
  8. (<<dynamic-cluster-setting,Dynamic>>)
  9. Make the whole cluster read only (indices do not accept write
  10. operations), metadata is not allowed to be modified (create or delete
  11. indices).
  12. `cluster.blocks.read_only_allow_delete`::
  13. (<<dynamic-cluster-setting,Dynamic>>)
  14. Identical to `cluster.blocks.read_only` but allows to delete indices
  15. to free up resources.
  16. WARNING: Don't rely on this setting to prevent changes to your cluster. Any
  17. user with access to the <<cluster-update-settings,cluster-update-settings>>
  18. API can make the cluster read-write again.
  19. [discrete]
  20. [[cluster-shard-limit]]
  21. ==== Cluster shard limit
  22. There is a soft limit on the number of shards in a cluster, based on the number
  23. of nodes in the cluster. This is intended to prevent operations which may
  24. unintentionally destabilize the cluster.
  25. IMPORTANT: This limit is intended as a safety net, not a sizing recommendation. The
  26. exact number of shards your cluster can safely support depends on your hardware
  27. configuration and workload, but should remain well below this limit in almost
  28. all cases, as the default limit is set quite high.
  29. If an operation, such as creating a new index, restoring a snapshot of an index,
  30. or opening a closed index would lead to the number of shards in the cluster
  31. going over this limit, the operation will fail with an error indicating the
  32. shard limit.
  33. If the cluster is already over the limit, due to changes in node membership or
  34. setting changes, all operations that create or open indices will fail until
  35. either the limit is increased as described below, or some indices are
  36. <<indices-open-close,closed>> or <<indices-delete-index,deleted>> to bring the
  37. number of shards below the limit.
  38. The cluster shard limit defaults to 1,000 shards per non-frozen data node for
  39. normal (non-frozen) indices and 3000 shards per frozen data node for frozen
  40. indices.
  41. Both primary and replica shards of all open indices count toward the limit,
  42. including unassigned shards.
  43. For example, an open index with 5 primary shards and 2 replicas counts as 15 shards.
  44. Closed indices do not contribute to the shard count.
  45. You can dynamically adjust the cluster shard limit with the following setting:
  46. [[cluster-max-shards-per-node]]
  47. `cluster.max_shards_per_node`::
  48. +
  49. --
  50. (<<dynamic-cluster-setting,Dynamic>>)
  51. Limits the total number of primary and replica shards for the cluster. {es}
  52. calculates the limit as follows:
  53. `cluster.max_shards_per_node * number of non-frozen data nodes`
  54. Shards for closed indices do not count toward this limit. Defaults to `1000`.
  55. A cluster with no data nodes is unlimited.
  56. {es} rejects any request that creates more shards than this limit allows. For
  57. example, a cluster with a `cluster.max_shards_per_node` setting of `100` and
  58. three data nodes has a shard limit of 300. If the cluster already contains 296
  59. shards, {es} rejects any request that adds five or more shards to the cluster.
  60. Note that if `cluster.max_shards_per_node` is set to a higher value than the
  61. default, the limits for <<vm-max-map-count, mmap count>> and
  62. <<file-descriptors, open file descriptors>> might also require adjustment.
  63. Notice that frozen shards have their own independent limit.
  64. --
  65. [[cluster-max-shards-per-node-frozen]]
  66. `cluster.max_shards_per_node.frozen`::
  67. +
  68. --
  69. (<<dynamic-cluster-setting,Dynamic>>)
  70. Limits the total number of primary and replica frozen shards for the cluster.
  71. {es} calculates the limit as follows:
  72. `cluster.max_shards_per_node.frozen * number of frozen data nodes`
  73. Shards for closed indices do not count toward this limit. Defaults to `3000`.
  74. A cluster with no frozen data nodes is unlimited.
  75. {es} rejects any request that creates more frozen shards than this limit allows.
  76. For example, a cluster with a `cluster.max_shards_per_node.frozen` setting of
  77. `100` and three frozen data nodes has a frozen shard limit of 300. If the
  78. cluster already contains 296 shards, {es} rejects any request that adds five or
  79. more frozen shards to the cluster.
  80. NOTE: These setting do not limit shards for individual nodes. To limit the
  81. number of shards for each node, use the
  82. <<cluster-total-shards-per-node,`cluster.routing.allocation.total_shards_per_node`>>
  83. setting.
  84. --
  85. [discrete]
  86. [[user-defined-data]]
  87. ==== User-defined cluster metadata
  88. User-defined metadata can be stored and retrieved using the Cluster Settings API.
  89. This can be used to store arbitrary, infrequently-changing data about the cluster
  90. without the need to create an index to store it. This data may be stored using
  91. any key prefixed with `cluster.metadata.`. For example, to store the email
  92. address of the administrator of a cluster under the key `cluster.metadata.administrator`,
  93. issue this request:
  94. [source,console]
  95. -------------------------------
  96. PUT /_cluster/settings
  97. {
  98. "persistent": {
  99. "cluster.metadata.administrator": "sysadmin@example.com"
  100. }
  101. }
  102. -------------------------------
  103. IMPORTANT: User-defined cluster metadata is not intended to store sensitive or
  104. confidential information. Any information stored in user-defined cluster
  105. metadata will be viewable by anyone with access to the
  106. <<cluster-get-settings,Cluster Get Settings>> API, and is recorded in the
  107. {es} logs.
  108. [discrete]
  109. [[cluster-max-tombstones]]
  110. ==== Index tombstones
  111. The cluster state maintains index tombstones to explicitly denote indices that
  112. have been deleted. The number of tombstones maintained in the cluster state is
  113. controlled by the following setting:
  114. `cluster.indices.tombstones.size`::
  115. (<<static-cluster-setting,Static>>)
  116. Index tombstones prevent nodes that are not part of the cluster when a delete
  117. occurs from joining the cluster and reimporting the index as though the delete
  118. was never issued. To keep the cluster state from growing huge we only keep the
  119. last `cluster.indices.tombstones.size` deletes, which defaults to 500. You can
  120. increase it if you expect nodes to be absent from the cluster and miss more
  121. than 500 deletes. We think that is rare, thus the default. Tombstones don't take
  122. up much space, but we also think that a number like 50,000 is probably too big.
  123. include::{es-repo-dir}/indices/dangling-indices-list.asciidoc[tag=dangling-index-description]
  124. You can use the <<dangling-indices-api,Dangling indices API>> to manage
  125. this situation.
  126. [discrete]
  127. [[cluster-logger]]
  128. ==== Logger
  129. The settings which control logging can be updated <<dynamic-cluster-setting,dynamically>> with the
  130. `logger.` prefix. For instance, to increase the logging level of the
  131. `indices.recovery` module to `DEBUG`, issue this request:
  132. [source,console]
  133. -------------------------------
  134. PUT /_cluster/settings
  135. {
  136. "persistent": {
  137. "logger.org.elasticsearch.indices.recovery": "DEBUG"
  138. }
  139. }
  140. -------------------------------
  141. [discrete]
  142. [[persistent-tasks-allocation]]
  143. ==== Persistent tasks allocation
  144. Plugins can create a kind of tasks called persistent tasks. Those tasks are
  145. usually long-lived tasks and are stored in the cluster state, allowing the
  146. tasks to be revived after a full cluster restart.
  147. Every time a persistent task is created, the master node takes care of
  148. assigning the task to a node of the cluster, and the assigned node will then
  149. pick up the task and execute it locally. The process of assigning persistent
  150. tasks to nodes is controlled by the following settings:
  151. `cluster.persistent_tasks.allocation.enable`::
  152. +
  153. --
  154. (<<dynamic-cluster-setting,Dynamic>>)
  155. Enable or disable allocation for persistent tasks:
  156. * `all` - (default) Allows persistent tasks to be assigned to nodes
  157. * `none` - No allocations are allowed for any type of persistent task
  158. This setting does not affect the persistent tasks that are already being executed.
  159. Only newly created persistent tasks, or tasks that must be reassigned (after a node
  160. left the cluster, for example), are impacted by this setting.
  161. --
  162. `cluster.persistent_tasks.allocation.recheck_interval`::
  163. (<<dynamic-cluster-setting,Dynamic>>)
  164. The master node will automatically check whether persistent tasks need to
  165. be assigned when the cluster state changes significantly. However, there
  166. may be other factors, such as memory usage, that affect whether persistent
  167. tasks can be assigned to nodes but do not cause the cluster state to change.
  168. This setting controls how often assignment checks are performed to react to
  169. these factors. The default is 30 seconds. The minimum permitted value is 10
  170. seconds.