misc.asciidoc 8.9 KB

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