Azure Repositoryedit

To enable Azure repositories, you have first to set your azure storage settings in elasticsearch.yml file:

cloud:
    azure:
        storage:
            account: your_azure_storage_account
            key: your_azure_storage_key

For information, in previous version of the azure plugin, settings were:

cloud:
    azure:
        storage_account: your_azure_storage_account
        storage_key: your_azure_storage_key

You can set the timeout to use when making any single request. It can be defined globally, per account or both. Defaults to 5m.

cloud:
    azure:
        storage:
            account: your_azure_storage_account
            key: your_azure_storage_key
            timeout: 10s

The Azure repository supports following settings:

container
Container name. Defaults to elasticsearch-snapshots
base_path
Specifies the path within container to repository data. Defaults to empty (root directory).
chunk_size
Big files can be broken down into chunks during snapshotting if needed. The chunk size can be specified in bytes or by using size value notation, i.e. 1g, 10m, 5k. Defaults to 64m (64m max)
compress
When set to true metadata files are stored in compressed format. This setting doesn’t affect index files that are already compressed by default. Defaults to false.
read_only
Makes repository read-only. [2.1.0] Added in 2.1.0. Defaults to false.

Some examples, using scripts:

# The simpliest one
PUT _snapshot/my_backup1
{
    "type": "azure"
}

# With some settings
PUT _snapshot/my_backup2
{
    "type": "azure",
    "settings": {
        "container": "backup-container",
        "base_path": "backups",
        "chunk_size": "32m",
        "compress": true
    }
}

Example using Java:

client.admin().cluster().preparePutRepository("my_backup3")
    .setType("azure").setSettings(Settings.settingsBuilder()
        .put(Storage.CONTAINER, "backup-container")
        .put(Storage.CHUNK_SIZE, new ByteSizeValue(32, ByteSizeUnit.MB))
    ).get();

Repository validation rulesedit

According to the containers naming guide, a container name must be a valid DNS name, conforming to the following naming rules:

  • Container names must start with a letter or number, and can contain only letters, numbers, and the dash (-) character.
  • Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names.
  • All letters in a container name must be lowercase.
  • Container names must be from 3 through 63 characters long.