misc.asciidoc 8.1 KB

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