0
0
Elasticsearchquery~10 mins

Snapshot and restore in Elasticsearch - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a snapshot repository named 'my_backup'.

Elasticsearch
PUT /_snapshot/[1]
{
  "type": "fs",
  "settings": {
    "location": "/mount/backups/my_backup"
  }
}
Drag options to blanks, or click blank then click option'
Abackup_repo
Bmy_backup
Csnapshot1
Drepo_backup
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different repository name in the URL and settings.
Misspelling the repository name.
2fill in blank
medium

Complete the code to create a snapshot named 'snapshot_1' in the 'my_backup' repository.

Elasticsearch
PUT /_snapshot/my_backup/[1]
{
  "indices": "index1,index2",
  "ignore_unavailable": true,
  "include_global_state": false
}
Drag options to blanks, or click blank then click option'
Abackup_1
Bsnap1
Csnapshot_1
Dbackup_snapshot
Attempts:
3 left
💡 Hint
Common Mistakes
Using the repository name instead of the snapshot name.
Using an invalid snapshot name.
3fill in blank
hard

Fix the error in the restore request to restore 'snapshot_1' from 'my_backup' repository.

Elasticsearch
POST /_snapshot/my_backup/[1]/_restore
{
  "indices": "index1",
  "rename_pattern": "index1",
  "rename_replacement": "restored_index1"
}
Drag options to blanks, or click blank then click option'
Asnapshot_1
Brestore_1
Cmy_backup
Dbackup_1
Attempts:
3 left
💡 Hint
Common Mistakes
Using the repository name instead of the snapshot name in the URL.
Using a non-existent snapshot name.
4fill in blank
hard

Fill both blanks to create a snapshot that includes only 'logs-*' indices and excludes global state.

Elasticsearch
PUT /_snapshot/my_backup/[1]
{
  "indices": "[2]",
  "include_global_state": false
}
Drag options to blanks, or click blank then click option'
Asnapshot_logs
Blogs-*
Csnapshot_all
Dindex-*
Attempts:
3 left
💡 Hint
Common Mistakes
Using a generic snapshot name that doesn't match the indices.
Including global state when it should be excluded.
5fill in blank
hard

Fill all three blanks to restore 'snapshot_logs' from 'my_backup' repository, renaming 'logs-2023' to 'restored-logs-2023' and ignoring unavailable indices.

Elasticsearch
POST /_snapshot/my_backup/[1]/_restore
{
  "indices": "[2]",
  "rename_pattern": "[3]",
  "rename_replacement": "restored-logs-2023",
  "ignore_unavailable": true
}
Drag options to blanks, or click blank then click option'
Asnapshot_logs
Blogs-2023
Dsnapshot_all
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect snapshot or index names.
Not matching the rename pattern to the index name.