Swirrl / ook

Structural search engine
https://search-prototype.gss-data.org.uk/
Eclipse Public License 1.0
6 stars 0 forks source link

Create index backups on Google Cloud Storage #29

Closed Robsteranium closed 2 years ago

Robsteranium commented 3 years ago

We should create snapshots to backup the index.

We can use the Google Cloud Storage repository plugin.

Robsteranium commented 3 years ago

For the time being I've just created a filesystem repository for snapshots...

I added a dir /etc/elasticsearch/elasticsearch.yml:

path.repo: /var/lib/elasticsearch/backups

Then did:

sudo mkdir /var/lib/elasticsearch/backups
sudo chown -R elasticsearch: /var/lib/elasticsearch/backups/

sudo systemctl restart elasticsearch

curl -X PUT "localhost:9200/_snapshot/fs_backup?pretty" -H 'Content-Type: application/json' -d'
{
  "type": "fs",
  "settings": {
    "location": "backup",       
    "compress": true
  }
}
'

curl -X PUT "localhost:9200/_snapshot/fs_backup/snapshot_1?wait_for_completion=true&pretty"

Not sure it's ideal that the backups are inside the data dir, but hopefully ES won't mind for now.