Created
September 11, 2017 11:02
-
-
Save elipapa/a35ff84b6835d595f1c8cde917103d72 to your computer and use it in GitHub Desktop.
restore open targets elasticsearch public snapshots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# assuming your ES is at http://localhost:9200 | |
# set all existing indices to 0 replicas | |
curl -XPUT "http://localhost:9200/_settings" --data '{"index":{"number_of_replicas": 0}}' | |
# set marvel index to default 0 replicas | |
curl -XPUT "http://localhost:9200/_template/custom_marvel" --data '{ | |
"template": ".marvel*", | |
"order": 1, | |
"settings": {"number_of_replicas": 0} | |
}' | |
# Registering the S3 release repository ... | |
curl -XPUT "http://localhost:9200/_snapshot/17.06" --data '{ | |
"type": "url", | |
"settings": { | |
"url": "https://s3-eu-west-1.amazonaws.com/targetvalidation-releases-es-snapshots/17.06/" | |
}}' | |
# triggering the restore of the snapshot... | |
curl -XPOST "http://localhost:9200/_snapshot/17.06/release/_restore" -d '{ | |
"ignore_unavailable": "true", | |
"index_settings": {"index.number_of_replicas": 0}, | |
"include_global_state": "false" | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
note that the
elasticsearch.yml
config file for your Elasticsearch deployment must have the line:repositories.url.allowed_urls: ["https://s3-eu-west-1.amazonaws.com/*"]
for this to work.