Restoring a snapshot from a remote repository

Hi all,

I set a local repository with type: "url" to access a remote repository.

PUT localhost:9200/_snapshot/elastic_backup

{
   "type": "url",
   "settings": {
       "url": "http://remote_url_repository:9205"
   }
}

The elasticsearch.yml was set as follows:

repositories.url.allowed_urls: "http://remote_url_repository:9205"

The GET http://remote_url_repository:9205/_snapshot/elastic_backup/2017-02-13 returns:

{
"snapshots": [
{
    "snapshot": "2017-02-13",
    "uuid": "F_Q8708SSqC9yHJZ_xNefw",
    "version_id": 5010199,
    "version": "5.1.1",
   "indices": [
       "delfos_index_homologacao"
    ],
   "state": "SUCCESS",
   "start_time": "2017-02-13T14:14:31.438Z",
   "start_time_in_millis": 1486995271438,
   "end_time": "2017-02-13T14:24:59.539Z",
   "end_time_in_millis": 1486995899539,
   "duration_in_millis": 628101,
   "failures": [],
   "shards": {
   "total": 5,
   "failed": 0,
   "successful": 5
  }
 }
]
}

When I try to create a local snapshot

PUT localhost:9200/_snapshot/elastic_backup/2017-02-13/, I got the exception

{
 "error": {
   "root_cause": [
     {
       "type": "repository_exception",
       "reason": "[elastic_backup] cannot create snapshot in a readonly repository"
     }
   ],
   "type": "repository_exception",
   "reason": "[elastic_backup] cannot create snapshot in a readonly repository"
 },
 "status": 500
}

What am I suppose to do after the backup creation? If it's a read-only backup, how can I restore a snapshot remotely?

Did I missed something in the back-up creation?

{
       "type": "url",
       "settings": {
           "url": "http://remote_url_repository:9205"
       }
    }

BTW, which are the "url" type settings in the ES documentation??
https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html#_read_only_url_repository

Can anybody give me a hint?

Thanks,

Guilherme

URL repositories are only readonly. You can't write to them.

It's often used if you backup your data using shared FS or S3 or gcs or azure, then expose the backup behind a webserver so people can download your data but can't write to them.

Makes sense?

Sure, @dadoonet! Thank you!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.