repository-azure.asciidoc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. [[repository-azure]]
  2. === Azure Repository Plugin
  3. The Azure Repository plugin adds support for using Azure as a repository for
  4. {ref}/modules-snapshots.html[Snapshot/Restore].
  5. [[repository-azure-install]]
  6. [float]
  7. ==== Installation
  8. This plugin can be installed using the plugin manager:
  9. [source,sh]
  10. ----------------------------------------------------------------
  11. sudo bin/plugin install repository-azure
  12. ----------------------------------------------------------------
  13. The plugin must be installed on every node in the cluster, and each node must
  14. be restarted after installation.
  15. [[repository-azure-remove]]
  16. [float]
  17. ==== Removal
  18. The plugin can be removed with the following command:
  19. [source,sh]
  20. ----------------------------------------------------------------
  21. sudo bin/plugin remove repository-azure
  22. ----------------------------------------------------------------
  23. The node must be stopped before removing the plugin.
  24. [[repository-azure-usage]]
  25. ==== Azure Repository
  26. To enable Azure repositories, you have first to set your azure storage settings in `elasticsearch.yml` file:
  27. [source,yaml]
  28. ----
  29. cloud:
  30. azure:
  31. storage:
  32. account: your_azure_storage_account
  33. key: your_azure_storage_key
  34. ----
  35. For information, in previous version of the azure plugin, settings were:
  36. [source,yaml]
  37. ----
  38. cloud:
  39. azure:
  40. storage_account: your_azure_storage_account
  41. storage_key: your_azure_storage_key
  42. ----
  43. The Azure repository supports following settings:
  44. `container`::
  45. Container name. Defaults to `elasticsearch-snapshots`
  46. `base_path`::
  47. Specifies the path within container to repository data. Defaults to empty
  48. (root directory).
  49. `chunk_size`::
  50. Big files can be broken down into chunks during snapshotting if needed.
  51. The chunk size can be specified in bytes or by using size value notation,
  52. i.e. `1g`, `10m`, `5k`. Defaults to `64m` (64m max)
  53. `compress`::
  54. When set to `true` metadata files are stored in compressed format. This
  55. setting doesn't affect index files that are already compressed by default.
  56. Defaults to `false`.
  57. `read_only`::
  58. Makes repository read-only. coming[2.1.0] Defaults to `false`.
  59. Some examples, using scripts:
  60. [source,json]
  61. ----
  62. # The simpliest one
  63. PUT _snapshot/my_backup1
  64. {
  65. "type": "azure"
  66. }
  67. # With some settings
  68. PUT _snapshot/my_backup2
  69. {
  70. "type": "azure",
  71. "settings": {
  72. "container": "backup_container",
  73. "base_path": "backups",
  74. "chunk_size": "32m",
  75. "compress": true
  76. }
  77. }
  78. ----
  79. // AUTOSENSE
  80. Example using Java:
  81. [source,java]
  82. ----
  83. client.admin().cluster().preparePutRepository("my_backup3")
  84. .setType("azure").setSettings(Settings.settingsBuilder()
  85. .put(Storage.CONTAINER, "backup_container")
  86. .put(Storage.CHUNK_SIZE, new ByteSizeValue(32, ByteSizeUnit.MB))
  87. ).get();
  88. ----
  89. [[repository-azure-validation]]
  90. ===== Repository validation rules
  91. According to the http://msdn.microsoft.com/en-us/library/dd135715.aspx[containers naming guide], a container name must
  92. be a valid DNS name, conforming to the following naming rules:
  93. * Container names must start with a letter or number, and can contain only letters, numbers, and the dash (-) character.
  94. * Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not
  95. permitted in container names.
  96. * All letters in a container name must be lowercase.
  97. * Container names must be from 3 through 63 characters long.
  98. [[repository-azure-testing]]
  99. ==== Testing Azure
  100. Integrations tests in this plugin require working Azure configuration and therefore disabled by default.
  101. To enable tests prepare a config file `elasticsearch.yml` with the following content:
  102. [source,yaml]
  103. ----
  104. cloud:
  105. azure:
  106. storage:
  107. account: "YOUR-AZURE-STORAGE-NAME"
  108. key: "YOUR-AZURE-STORAGE-KEY"
  109. ----
  110. Replaces `account`, `key` with your settings. Please, note that the test will delete all snapshot/restore related
  111. files in the specified bucket.
  112. To run test:
  113. [source,sh]
  114. ----
  115. mvn -Dtests.azure=true -Dtests.config=/path/to/config/file/elasticsearch.yml clean test
  116. ----