Verzeichnis anlegen und Snapshot konfigurieren dafür:
sudo mkdir /mnt/es_snapshots
sudo chown elasticsearch.elasticsearch /mnt/es_snapshots
curl -XPUT 'localhost:9200/_snapshot/es_snapshots' -d '{"type": "fs", "settings": {"location": "/mnt/es_snapshots", "compress": true}}'
curl -XPUT 'localhost:9200/_snapshot/es_snapshots/snapshot_1?wait_for_completion=true'
Indices löschen, falls sie schon bestehen (curl -XDELETE localhost:9200/*
) und dann restore anwerfen:
curl -XPOST 'localhost:9200/_snapshot/es_snapshots/snapshot_1/_restore?wait_for_completion=true'
tar -czvf es_snapshots.tgz es_snapshots/
r=recursive,p=preserve
scp -P722 -rp [email protected]:/mnt/es_snapshots .