Restore snapshot from remote fails to find snapshot

Dear readers,

I have two clusters. One I'll call 'remote', the other 'local'.
I have successfully created a snapshot called 'snapshot_1' in the repository 'my_backup' on the remote cluster.
I'm trying to follow the instructions here: Restore a snapshot | Elasticsearch Guide [8.11] | Elastic
It states:

Therefore, it’s possible to restore a snapshot created from one cluster into another cluster by registering the repository that contains the snapshot in the new cluster and starting the restore process.

So on my local cluster I do that with:

    $ curl -X PUT "localhost:9201/_snapshot/my_local_backup?pretty" -H 'Content-Type: application/json' -d'
  {
    "type": "url",
    "settings": {
      "url": "http://<remote>:9200/_snapshot/my_backup"
    }
  }'

This seems to work. Please pay attention to the url key, I am not sure that is correct.

When trying to restore a snapshot I do:

    $ curl -X POST "localhost:9201/_snapshot/my_local_backup/snapshot_1/_restore?pretty"

This fails with:

    {
      "error" : {
        "root_cause" : [
          {
            "type" : "snapshot_restore_exception",
            "reason" : "[my_local_backup:snapshot_1] snapshot does not exist"
          }
        ],
        "type" : "snapshot_restore_exception",
        "reason" : "[my_local_backup:snapshot_1] snapshot does not exist"
      },
      "status" : 500
    }

What I expected to happen is that when I try to restore a snapshot on the local cluster is that Elasticsearch would query the remote cluster somehow to find the snapshot. Perhaps that is a misunderstanding?

I have set the env var: repositories.url.allowed_urls=http://elasticsearch:9200

I'm running the latest version/7.9.3.

Nor am I ...

Yes, that's not how this works. Elasticsearch doesn't expose the repository contents over HTTP. If you want to use the read-only URL repository then you need to set up a separate webserver that exposes the repository contents.

Excellent! Then I know what is wrong.

In order to 'expose' the repository content would that be as easy as hosting the content of /usr/share/elasticsearch/backup somewhere?

Yes that's right

1 Like

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