register-fs-repo.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. // tag::unix[]
  2. Linux and macOS installations support Unix-style paths:
  3. [source,yaml]
  4. ----
  5. path:
  6. repo:
  7. - /mount/backups
  8. - /mount/long_term_backups
  9. ----
  10. // tag::register-fs-repo[]
  11. After restarting each node, use {kib} or the <<put-snapshot-repo-api,create
  12. snapshot repository API>> to register the repository. When registering the
  13. repository, specify the file system's path:
  14. // end::register-fs-repo[]
  15. [source,console]
  16. ----
  17. PUT _snapshot/my_fs_backup
  18. {
  19. "type": "fs",
  20. "settings": {
  21. "location": "/mount/backups/my_fs_backup_location",
  22. "compress": true
  23. }
  24. }
  25. ----
  26. // TEST[skip:no access to path]
  27. // tag::relative-path[]
  28. If you specify a relative path, {es} resolves the path using the first value in
  29. the `path.repo` setting.
  30. // end::relative-path[]
  31. [source,console]
  32. ----
  33. PUT _snapshot/my_fs_backup
  34. {
  35. "type": "fs",
  36. "settings": {
  37. "location": "my_fs_backup_location", <1>
  38. "compress": true
  39. }
  40. }
  41. ----
  42. // TEST[skip:no access to path]
  43. <1> The first value in the `path.repo` setting is `/mount/backups`. This
  44. relative path, `my_fs_backup_location`, resolves to
  45. `/mount/backups/my_fs_backup_location`.
  46. include::{es-repo-dir}/snapshot-restore/register-repository.asciidoc[tag=multi-cluster-repo]
  47. // tag::fs-repo-read-only[]
  48. To register a file system repository as read-only using the create snapshot
  49. repository API, set the `readonly` parameter to true. Alternatively, you can
  50. register a <<snapshots-read-only-repository,URL repository>> for the file
  51. system.
  52. // end::fs-repo-read-only[]
  53. [source,console]
  54. ----
  55. PUT _snapshot/my_fs_backup
  56. {
  57. "type": "fs",
  58. "settings": {
  59. "location": "my_fs_backup_location",
  60. "readonly": true
  61. }
  62. }
  63. ----
  64. // end::unix[]
  65. // tag::win[]
  66. Windows installations support both DOS and Microsoft UNC paths. Escape any
  67. backslashes in the paths. For UNC paths, provide the server and share name as a
  68. prefix.
  69. [source,yaml]
  70. ----
  71. path:
  72. repo:
  73. - "E:\\Mount\\Backups" <1>
  74. - "\\\\MY_SERVER\\Mount\\Long_term_backups" <2>
  75. ----
  76. <1> DOS path
  77. <2> UNC path
  78. include::register-fs-repo.asciidoc[tag=register-fs-repo]
  79. [source,console]
  80. ----
  81. PUT _snapshot/my_fs_backup
  82. {
  83. "type": "fs",
  84. "settings": {
  85. "location": "E:\\Mount\\Backups\\My_fs_backup_location",
  86. "compress": true
  87. }
  88. }
  89. ----
  90. // TEST[skip:no access to path]
  91. include::register-fs-repo.asciidoc[tag=relative-path]
  92. [source,console]
  93. ----
  94. PUT _snapshot/my_fs_backup
  95. {
  96. "type": "fs",
  97. "settings": {
  98. "location": "My_fs_backup_location", <1>
  99. "compress": true
  100. }
  101. }
  102. ----
  103. // TEST[skip:no access to path]
  104. <1> The first value in the `path.repo` setting is `E:\Mount\Backups`. This
  105. relative path, `My_fs_backup_location`, resolves to
  106. `E:\Mount\Backups\My_fs_backup_location`.
  107. include::{es-repo-dir}/snapshot-restore/register-repository.asciidoc[tag=multi-cluster-repo]
  108. include::register-fs-repo.asciidoc[tag=fs-repo-read-only]
  109. [source,console]
  110. ----
  111. PUT _snapshot/my_fs_backup
  112. {
  113. "type": "fs",
  114. "settings": {
  115. "location": "my_fs_backup_location",
  116. "readonly": true
  117. }
  118. }
  119. ----
  120. // TEST[skip:no access to path]
  121. // end::win[]