Contact Info
London Office :
Denizli Office :
Pamukkale Üniversitesi Teknoloji Geliştirme Merkezi B Blok Oda:Z17, 20070 Denizli
info@cloudnesil.com
+88 (0) 101 0000 000
Certified Kubernetes Administrator Certified Developer on Apache Cassandra

CloudNesil

Backup/Restore elasticsearch between aws accounts

This article is about backing up and restoring elasticsearch between aws accounts. Since you can find plenty of resources online about installing s3 plugin, creating iam user, creating iam role for s3 access. I will focus on key points of backup and restore.
  1. Create snapshot repository on where you want to take backup.
```
PUT /_snapshot/$snapshot_repository?verify=false&pretty
{
"type": "s3",
"settings": {
"bucket": "$bucket_name",
"region": "eu-central-1"
}
}
```
2. Create backup
```
PUT /_snapshot/$snapshot_repository/$snapshot_name
```
3. Create secure credentials on elasticsearch-data nodes
```
bin/elasticsearch-keystore add s3.client.default.access_key
bin/elasticsearch-keystore add s3.client.default.secret_key
```
4. Reload security settings.
```
POST _nodes/reload_secure_settings
```
5. Create snapshot repository on where you want to restore backup.
```
PUT /_snapshot/$snapshot_repository?verify=false&pretty
{
"type": "s3",
"settings": {
"bucket": "$bucket_name",
"region": "eu-central-1"
}
}
```
6. Delete existing indexes
```
DELETE /_all
```
7. Close existing indexes
```
POST $index_to_be_closed/_close
```
8. Restore snapshot
```
POST /_snapshot/$snapshot_repository/$snapshot_name/_restore
```

Post a Comment

Retype the CAPTCHA code from the image
Change the CAPTCHA codeSpeak the CAPTCHA code