freeze.asciidoc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[freeze-index-api]]
  4. === Freeze index API
  5. ++++
  6. <titleabbrev>Freeze index</titleabbrev>
  7. ++++
  8. Freezes an index.
  9. [[freeze-index-api-request]]
  10. ==== {api-request-title}
  11. `POST /<index>/_freeze`
  12. [[freeze-index-api-prereqs]]
  13. ==== {api-prereq-title}
  14. * If the {es} {security-features} are enabled, you must have the `manage`
  15. <<privileges-list-indices,index privilege>> for the target index or index alias.
  16. [[freeze-index-api-desc]]
  17. ==== {api-description-title}
  18. A frozen index has almost no overhead on the cluster (except for maintaining its
  19. metadata in memory) and is read-only. Read-only indices are blocked for write
  20. operations, such as <<indexing,docs-index_>> or <<indices-forcemerge,force
  21. merges>>. See <<frozen-indices>> and <<unfreeze-index-api>>.
  22. The current write index on a data stream cannot be frozen. In order to freeze
  23. the current write index, the data stream must first be
  24. <<data-streams-rollover,rolled over>> so that a new write index is created
  25. and then the previous write index can be frozen.
  26. IMPORTANT: Freezing an index will close the index and reopen it within the same
  27. API call. This causes primaries to not be allocated for a short amount of time
  28. and causes the cluster to go red until the primaries are allocated again. This
  29. limitation might be removed in the future.
  30. [[freeze-index-api-path-parms]]
  31. ==== {api-path-parms-title}
  32. `<index>`::
  33. (Required, string) Identifier for the index.
  34. [[freeze-index-api-examples]]
  35. ==== {api-examples-title}
  36. The following example freezes and unfreezes an index:
  37. [source,console]
  38. --------------------------------------------------
  39. POST /my-index-000001/_freeze
  40. POST /my-index-000001/_unfreeze
  41. --------------------------------------------------
  42. // TEST[s/^/PUT my-index-000001\n/]