disk_allocator.asciidoc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. [[disk-allocator]]
  2. === Disk-based Shard Allocation
  3. Elasticsearch factors in the available disk space on a node before deciding
  4. whether to allocate new shards to that node or to actively relocate shards
  5. away from that node.
  6. Below are the settings that can be configured in the `elasticsearch.yml` config
  7. file or updated dynamically on a live cluster with the
  8. <<cluster-update-settings,cluster-update-settings>> API:
  9. `cluster.routing.allocation.disk.threshold_enabled`::
  10. Defaults to `true`. Set to `false` to disable the disk allocation decider.
  11. `cluster.routing.allocation.disk.watermark.low`::
  12. Controls the low watermark for disk usage. It defaults to 85%, meaning ES will
  13. not allocate new shards to nodes once they have more than 85% disk used. It
  14. can also be set to an absolute byte value (like 500mb) to prevent ES from
  15. allocating shards if less than the configured amount of space is available.
  16. `cluster.routing.allocation.disk.watermark.high`::
  17. Controls the high watermark. It defaults to 90%, meaning ES will attempt to
  18. relocate shards to another node if the node disk usage rises above 90%. It can
  19. also be set to an absolute byte value (similar to the low watermark) to
  20. relocate shards once less than the configured amount of space is available on
  21. the node.
  22. `cluster.routing.allocation.disk.watermark.flood_stage`::
  23. +
  24. --
  25. Controls the flood stage watermark. It defaults to 95%, meaning ES enforces
  26. a read-only index block (`index.blocks.read_only_allow_delete`) on every
  27. index that has one or more shards allocated on the node that has at least
  28. one disk exceeding the flood stage. This is a last resort to prevent nodes
  29. from running out of disk space. The index block must be released manually
  30. once there is enough disk space available to allow indexing operations to
  31. continue.
  32. NOTE: You can not mix the usage of percentage values and byte values within
  33. these settings. Either all are set to percentage values, or all are set to byte
  34. values. This is so that we can we validate that the settings are internally
  35. consistent (that is, the low disk threshold is not more than the high disk
  36. threshold, and the high disk threshold is not more than the flood stage
  37. threshold).
  38. An example of resetting the read-only index block on the `twitter` index:
  39. [source,js]
  40. --------------------------------------------------
  41. PUT /twitter/_settings
  42. {
  43. "index.blocks.read_only_allow_delete": null
  44. }
  45. --------------------------------------------------
  46. // CONSOLE
  47. // TEST[setup:twitter]
  48. --
  49. `cluster.info.update.interval`::
  50. How often Elasticsearch should check on disk usage for each node in the
  51. cluster. Defaults to `30s`.
  52. `cluster.routing.allocation.disk.include_relocations`::
  53. Defaults to +true+, which means that Elasticsearch will take into account
  54. shards that are currently being relocated to the target node when computing a
  55. node's disk usage. Taking relocating shards' sizes into account may, however,
  56. mean that the disk usage for a node is incorrectly estimated on the high side,
  57. since the relocation could be 90% complete and a recently retrieved disk usage
  58. would include the total size of the relocating shard as well as the space
  59. already used by the running relocation.
  60. NOTE: Percentage values refer to used disk space, while byte values refer to
  61. free disk space. This can be confusing, since it flips the meaning of high and
  62. low. For example, it makes sense to set the low watermark to 10gb and the high
  63. watermark to 5gb, but not the other way around.
  64. An example of updating the low watermark to at least 100 gigabytes free, a high
  65. watermark of at least 50 gigabytes free, and a flood stage watermark of 10
  66. gigabytes free, and updating the information about the cluster every minute:
  67. [source,js]
  68. --------------------------------------------------
  69. PUT _cluster/settings
  70. {
  71. "transient": {
  72. "cluster.routing.allocation.disk.watermark.low": "100gb",
  73. "cluster.routing.allocation.disk.watermark.high": "50gb",
  74. "cluster.routing.allocation.disk.watermark.flood_stage": "10gb",
  75. "cluster.info.update.interval": "1m"
  76. }
  77. }
  78. --------------------------------------------------
  79. // CONSOLE