index.asciidoc 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. [[snapshot-restore]]
  2. = Snapshot and restore
  3. [partintro]
  4. --
  5. // tag::snapshot-intro[]
  6. A _snapshot_ is a backup taken from a running {es} cluster.
  7. You can take snapshots of an entire cluster, including all its data streams and
  8. indices. You can also take snapshots of only specific data streams or indices in
  9. the cluster.
  10. You must
  11. <<snapshots-register-repository, register a snapshot repository>>
  12. before you can <<snapshots-take-snapshot, create snapshots>>.
  13. Snapshots can be stored in either local or remote repositories.
  14. Remote repositories can reside on Amazon S3, HDFS, Microsoft Azure,
  15. Google Cloud Storage,
  16. and other platforms supported by a {plugins}/repository.html[repository plugin].
  17. // end::snapshot-intro[]
  18. {es} takes snapshots incrementally: the snapshotting process only copies data
  19. to the repository that was not already copied there by an earlier snapshot,
  20. avoiding unnecessary duplication of work or storage space. This means you can
  21. safely take snapshots very frequently with minimal overhead. This
  22. incrementality only applies within a single repository because no data is
  23. shared between repositories. Snapshots are also logically independent from each
  24. other, even within a single repository: deleting a snapshot does not affect the
  25. integrity of any other snapshot.
  26. // tag::restore-intro[]
  27. You can <<snapshots-restore-snapshot,restore snapshots>> to a running cluster, which includes all data streams and indices in the snapshot
  28. by default.
  29. However, you can choose to restore only the cluster state or specific data
  30. streams or indices from a snapshot.
  31. // end::restore-intro[]
  32. You can use
  33. <<getting-started-snapshot-lifecycle-management, {slm}>>
  34. to automatically take and manage snapshots.
  35. // tag::backup-warning[]
  36. WARNING: **The only reliable and supported way to back up a cluster is by
  37. taking a snapshot**. You cannot back up an {es} cluster by making copies of the
  38. data directories of its nodes. There are no supported methods to restore any
  39. data from a filesystem-level backup. If you try to restore a cluster from such
  40. a backup, it may fail with reports of corruption or missing files or other data
  41. inconsistencies, or it may appear to have succeeded having silently lost some
  42. of your data.
  43. // end::backup-warning[]
  44. A copy of the data directories of a cluster's nodes does not work as a backup
  45. because it is not a consistent representation of their contents at a single
  46. point in time. You cannot fix this by shutting down nodes while making the
  47. copies, nor by taking atomic filesystem-level snapshots, because {es} has
  48. consistency requirements that span the whole cluster. You must use the built-in
  49. snapshot functionality for cluster backups.
  50. [discrete]
  51. [[snapshot-restore-version-compatibility]]
  52. === Version compatibility
  53. IMPORTANT: Version compatibility refers to the underlying Lucene index
  54. compatibility. Follow the <<setup-upgrade,Upgrade documentation>>
  55. when migrating between versions.
  56. A snapshot contains a copy of the on-disk data structures that comprise an
  57. index or a data stream's backing indices. This means that snapshots can only be restored to versions of
  58. {es} that can read the indices.
  59. The following table indicates snapshot compatibility between versions. The first column denotes the base version that you can restore snapshots from.
  60. // tag::snapshot-compatibility-matrix[]
  61. [cols="6"]
  62. |===
  63. | 5+^h| Cluster version
  64. ^h| Snapshot version ^| 2.x ^| 5.x ^| 6.x ^| 7.x ^| 8.x
  65. ^| *1.x* -> ^|{yes-icon} ^|{no-icon} ^|{no-icon} ^|{no-icon} ^|{no-icon}
  66. ^| *2.x* -> ^|{yes-icon} ^|{yes-icon} ^|{no-icon} ^|{no-icon} ^|{no-icon}
  67. ^| *5.x* -> ^|{no-icon} ^|{yes-icon} ^|{yes-icon} ^|{no-icon} ^|{no-icon}
  68. ^| *6.x* -> ^|{no-icon} ^|{no-icon} ^|{yes-icon} ^|{yes-icon} ^|{no-icon}
  69. ^| *7.x* -> ^|{no-icon} ^|{no-icon} ^|{no-icon} ^|{yes-icon} ^|{yes-icon}
  70. |===
  71. // end::snapshot-compatibility-matrix[]
  72. The following conditions apply for restoring snapshots and indices across versions:
  73. * *Snapshots*: You cannot restore snapshots from later {es} versions into a cluster running an earlier {es} version. For example, you cannot restore a snapshot taken in 7.6.0 to a cluster running 7.5.0.
  74. * *Indices*: You cannot restore indices into a cluster running a version of {es} that is more than _one major version_ newer than the version of {es} used to snapshot the indices. For example, you cannot restore indices from a snapshot taken in 5.0 to a cluster running 7.0.
  75. +
  76. [NOTE]
  77. ====
  78. The one caveat is that snapshots taken by {es} 2.0 can be restored in clusters running {es} 5.0.
  79. ====
  80. ifeval::["{release-state}"!="released"]
  81. [[snapshot-prerelease-build-compatibility]]
  82. NOTE: This documentation is for {es} version {version}, which is not yet
  83. released. The compatibility table above applies only to snapshots taken in a
  84. released version of {es}. If you're testing a pre-release build of {es} then you
  85. can still restore snapshots taken in earlier released builds as permitted by
  86. this compatibility table. You can also take snapshots using your pre-release
  87. build, and restore them using the same build. However once a pre-release build
  88. of {es} has written to a snapshot repository you must not use the same
  89. repository with other builds of {es}, even if the builds have the same version.
  90. Different pre-release builds of {es} may use different and incompatible
  91. repository layouts. If the repository layout is incompatible with the {es} build
  92. in use then taking and restoring snapshots may result in errors or may appear to
  93. succeed having silently lost some data. You should discard your repository
  94. before using a different build.
  95. endif::[]
  96. Each snapshot can contain indices created in various versions of {es}. This
  97. includes backing indices created for data streams. When restoring a snapshot, it
  98. must be possible to restore all of these indices into the target cluster. If any
  99. indices in a snapshot were created in an incompatible version, you will not be
  100. able restore the snapshot.
  101. IMPORTANT: When backing up your data prior to an upgrade, keep in mind that you
  102. won't be able to restore snapshots after you upgrade if they contain indices
  103. created in a version that's incompatible with the upgrade version.
  104. If you end up in a situation where you need to restore a snapshot of a data stream or index
  105. that is incompatible with the version of the cluster you are currently running,
  106. you can restore it on the latest compatible version and use
  107. <<reindex-from-remote,reindex-from-remote>> to rebuild the data stream or index on the current
  108. version. Reindexing from remote is only possible if the original data stream or index has
  109. source enabled. Retrieving and reindexing the data can take significantly
  110. longer than simply restoring a snapshot. If you have a large amount of data, we
  111. recommend testing the reindex from remote process with a subset of your data to
  112. understand the time requirements before proceeding.
  113. --
  114. include::register-repository.asciidoc[]
  115. include::take-snapshot.asciidoc[]
  116. include::monitor-snapshot-restore.asciidoc[]
  117. include::delete-snapshot.asciidoc[]
  118. include::restore-snapshot.asciidoc[]
  119. include::../slm/index.asciidoc[]
  120. include::../searchable-snapshots/index.asciidoc[]