Source-only repository settings
You can use a source repository to take source-only snapshots that delegate storage to another registered repository type. This page lists settings that apply to the source repository type when you create or update it via the Create or update a snapshot repository API.
The source repository type supports a list of settings. You supply them in the settings object when you register or update the repository.
For example, the following request registers my_src_only_repository with the following settings:
PUT _snapshot/my_src_only_repository
{
"type": "source",
"settings": {
"delegate_type": "fs",
"location": "my_backup_repository"
}
}
- In
sourcerepository types, snapshots are source-only and Elasticsearch writes stored fields and related metadata through a delegated repository instead of snapshotting full index data. delegate_typeselects the inner repository implementation.fsmeans snapshot blobs are stored with the shared filesystem repository type.locationbelongs to the delegatedfsrepository (not a separatesource-only key). It is the samelocationsetting as described in Shared file system repository settings. You can add other keys from the delegated type’s reference in the samesettingsobject, plussource-level options listed below (for examplecompressor throttling).
The following settings are supported:
chunk_size- (Optional, byte value) Maximum size of files in snapshots. In snapshots, files larger than this are broken down into chunks of this size or smaller. Defaults to
null(unlimited file size). compress- (Optional, Boolean) If
true, metadata files, such as index mappings and settings, are compressed in snapshots. Data files are not compressed. Defaults totrue. delegate_type-
(Optional, string) Delegated repository type. For valid values, see the
typeparameter. This must be set when you create asourcerepository.sourcerepositories can usesettingsproperties for their delegated repository type. max_number_of_snapshots- (Optional, integer) Maximum number of snapshots the repository can contain. Defaults to
Integer.MAX_VALUE, which is231-1or2147483647. max_restore_bytes_per_sec- (Optional, byte value) Maximum snapshot restore rate per node. Defaults to unlimited. Note that restores are also throttled through recovery settings.
max_snapshot_bytes_per_sec- (Optional, byte value) Maximum snapshot creation rate per node. Defaults to
40mbper second. Note that if the recovery settings for managed services are set, then it defaults to unlimited, and the rate is additionally throttled through recovery settings. readonly-
(Optional, Boolean) If
true, the repository is read-only. The cluster can retrieve and restore snapshots from the repository but not write to the repository or create snapshots in it.Only a cluster with write access can create snapshots in the repository. All other clusters connected to the repository should have the
readonlyparameter set totrue.If
false, the cluster can write to the repository and create snapshots in it. Defaults tofalse.ImportantIf you register the same snapshot repository with multiple clusters, only one cluster should have write access to the repository. Having multiple clusters write to the repository at the same time risks corrupting the contents of the repository.