repository-source-only.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [[snapshots-source-only-repository]]
  2. === Source-only repository
  3. You can use a source-only repository to take minimal, source-only snapshots that
  4. use up to 50% less disk space than regular snapshots.
  5. Unlike other repository types, a source-only repository doesn't directly store
  6. snapshots. It delegates storage to another registered snapshot repository.
  7. When you take a snapshot using a source-only repository, {es} creates a
  8. source-only snapshot in the delegated storage repository. This snapshot only
  9. contains stored fields and metadata. It doesn't include index or doc values
  10. structures and isn't immediately searchable when restored. To search the
  11. restored data, you first have to <<docs-reindex,reindex>> it into a new data
  12. stream or index.
  13. [IMPORTANT]
  14. ==================================================
  15. Source-only snapshots are only supported if the `_source` field is enabled and no source-filtering is applied.
  16. As a result, indices adopting synthetic source cannot be restored. When you restore a source-only snapshot:
  17. * The restored index is read-only and can only serve `match_all` search or scroll requests to enable reindexing.
  18. * Queries other than `match_all` and `_get` requests are not supported.
  19. * The mapping of the restored index is empty, but the original mapping is available from the types top
  20. level `meta` element.
  21. * Information such as document count, deleted document count and store size are not available for such indices
  22. since these indices do not contain the relevant data structures to retrieve this information from. Therefore,
  23. this information is not shown for such indices in APIs such as the <<cat-indices,cat indices API>>.
  24. ==================================================
  25. Before registering a source-only repository, use {kib} or the
  26. <<put-snapshot-repo-api,create snapshot repository API>> to register a snapshot
  27. repository of another type to use for storage. Then register the source-only
  28. repository and specify the delegated storage repository in the request.
  29. [source,console]
  30. ----
  31. PUT _snapshot/my_src_only_repository
  32. {
  33. "type": "source",
  34. "settings": {
  35. "delegate_type": "fs",
  36. "location": "my_backup_repository"
  37. }
  38. }
  39. ----
  40. // TEST[setup:setup-repository]
  41. // TEST[s/my_backup_repository/my_repository/]
  42. [[source-only-repository-settings]]
  43. ==== Repository settings
  44. `chunk_size`::
  45. (Optional, <<byte-units,byte value>>)
  46. Maximum size of files in snapshots. In snapshots, files larger than this are
  47. broken down into chunks of this size or smaller. Defaults to `null` (unlimited
  48. file size).
  49. `compress`::
  50. (Optional, Boolean)
  51. If `true`, metadata files, such as index mappings and settings, are compressed
  52. in snapshots. Data files are not compressed. Defaults to `true`.
  53. `delegate_type`::
  54. (Optional, string)
  55. Delegated repository type. For valid values, see the
  56. <<put-snapshot-repo-api-request-type,`type` parameter>>.
  57. +
  58. `source` repositories can use `settings` properties for its delegated repository
  59. type. See <<snapshots-source-only-repository>>.
  60. `max_number_of_snapshots`::
  61. (Optional, integer)
  62. Maximum number of snapshots the repository can contain.
  63. Defaults to `Integer.MAX_VALUE`, which is `2^31-1` or `2147483647`.
  64. include::repository-shared-settings.asciidoc[]