Skip to content

Instantly share code, notes, and snippets.

@imotov imotov/issue-8229.sh
Created Oct 26, 2014

Embed
What would you like to do?
# Create test index
curl -XDELETE 'http://localhost:9200/test-idx?pretty'
curl -XPUT 'http://localhost:9200/test-idx?pretty' -d '{
"settings": {
"index.number_of_shards": 10,
"index.number_of_replicas": 0
}
}'
for i in {1..100}
do
curl -XPUT "http://localhost:9200/test-idx/doc/$i" -d "{\"foo\": \"bar $i\"}"
done
curl -XPOST "http://localhost:9200/test-idx/_flush"
# Create really slow backup so we can check status
curl -XDELETE 'http://localhost:9200/_snapshot/my_backup?pretty'
rm -r /tmp/my_backup
curl -XPUT 'http://localhost:9200/_snapshot/my_backup?pretty' -d '{
"type": "fs",
"settings": {
"location": "/tmp/my_backup"
}
}'
#Snapshot and display status
curl -XPUT "localhost:9200/_snapshot/my_backup/snapshot_1?pretty&wait_for_completion" -d '{
"indices": "test-idx",
"ignore_unavailable": "true",
"include_global_state": false
}'
curl -XDELETE "localhost:9200/_snapshot/my_backup/snapshot_1"
curl -XDELETE "localhost:9200/_snapshot/my_backup"
rm -rf /tmp/my_backup/*
curl -XPUT 'http://localhost:9200/_snapshot/my_backup?pretty' -d '{
"type": "fs",
"settings": {
"location": "/tmp/my_backup"
}
}'
#Snapshot and display status
curl -XPUT "localhost:9200/_snapshot/my_backup/snapshot_1?pretty&wait_for_completion" -d '{
"indices": "test-idx",
"ignore_unavailable": "true",
"include_global_state": false
}'
{
"acknowledged" : true
}
{
"acknowledged" : true
}
{"_index":"test-idx","_type":"doc","_id":"1","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"2","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"3","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"4","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"5","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"6","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"7","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"8","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"9","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"10","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"11","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"12","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"13","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"14","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"15","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"16","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"17","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"18","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"19","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"20","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"21","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"22","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"23","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"24","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"25","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"26","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"27","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"28","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"29","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"30","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"31","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"32","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"33","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"34","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"35","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"36","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"37","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"38","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"39","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"40","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"41","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"42","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"43","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"44","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"45","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"46","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"47","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"48","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"49","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"50","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"51","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"52","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"53","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"54","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"55","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"56","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"57","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"58","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"59","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"60","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"61","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"62","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"63","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"64","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"65","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"66","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"67","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"68","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"69","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"70","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"71","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"72","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"73","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"74","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"75","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"76","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"77","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"78","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"79","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"80","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"81","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"82","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"83","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"84","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"85","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"86","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"87","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"88","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"89","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"90","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"91","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"92","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"93","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"94","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"95","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"96","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"97","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"98","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"99","_version":1,"created":true}{"_index":"test-idx","_type":"doc","_id":"100","_version":1,"created":true}{"_shards":{"total":10,"successful":10,"failed":0}}{
"error" : "RepositoryMissingException[[my_backup] missing]",
"status" : 404
}
{
"acknowledged" : true
}
{
"snapshot" : {
"snapshot" : "snapshot_1",
"indices" : [ "test-idx" ],
"state" : "SUCCESS",
"start_time" : "2014-10-26T17:24:21.554Z",
"start_time_in_millis" : 1414344261554,
"end_time" : "2014-10-26T17:24:21.673Z",
"end_time_in_millis" : 1414344261673,
"duration_in_millis" : 119,
"failures" : [ ],
"shards" : {
"total" : 10,
"failed" : 0,
"successful" : 10
}
}
}
{"acknowledged":true}{"acknowledged":true}{
"acknowledged" : true
}
{
"snapshot" : {
"snapshot" : "snapshot_1",
"indices" : [ "test-idx" ],
"state" : "SUCCESS",
"start_time" : "2014-10-26T17:24:21.756Z",
"start_time_in_millis" : 1414344261756,
"end_time" : "2014-10-26T17:24:21.818Z",
"end_time_in_millis" : 1414344261818,
"duration_in_millis" : 62,
"failures" : [ ],
"shards" : {
"total" : 10,
"failed" : 0,
"successful" : 10
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.