Elastic search snapshot and restore with type as url

1.7k views Asked by At

I want to take snapshot of an index present in my local, and save the snapshot at some remote location i.e. another machine. How can I use elastic search snapshot functionality for this?

1

There are 1 answers

5
Andrei Stefan On

On the machine where you want to transfer your snapshot, define a snapshot repository just like you did for the machine where you took the snapshot. For example:

$ curl -XPUT 'http://localhost:9200/_snapshot/my_backup' -d '{
    "type": "fs",
    "settings": {
        "location": "/mount/restore/my_backup",
        "compress": true
    }
}'

Assuming that your snapshot was something like the following:

PUT /_snapshot/my_backup/my_first_snapshot

Copy everything from the snapshot directory on the source machine to the /mount/restore/my_backup on the destination machine. And then POST /_snapshot/my_backup/my_first_snapshot/_restore. This is, also, in the documentation.

UPDATE: as per @EricLandry's comment, it seems there is a way: url type repository. I haven't tested it, but it looks promising after the description.