Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a snapshot in Elasticsearch?
A snapshot is a backup of your Elasticsearch cluster data and metadata, stored in a repository. It helps you save the current state to restore later if needed.
Click to reveal answer
beginner
How do you create a snapshot repository in Elasticsearch?
You create a snapshot repository by sending a PUT request to Elasticsearch with repository settings, like type (e.g., 'fs' for file system) and location path.
Click to reveal answer
beginner
What is the purpose of restoring a snapshot?
Restoring a snapshot recovers your cluster data and settings from a saved backup, useful after data loss or to move data between clusters.
Click to reveal answer
intermediate
Can you take snapshots while Elasticsearch is running and serving requests?
Yes, snapshots are taken without stopping the cluster. Elasticsearch uses a consistent view of data, so backups do not interrupt normal operations.
Click to reveal answer
intermediate
What types of repositories can be used for snapshots in Elasticsearch?
Common repository types include 'fs' (file system), 's3' (Amazon S3), 'gcs' (Google Cloud Storage), and 'azure' (Microsoft Azure Blob Storage).
Click to reveal answer
What command creates a snapshot repository in Elasticsearch?
ADELETE /_snapshot/my_backup
BGET /_snapshot/my_backup
CPOST /_snapshot/my_backup/_restore
DPUT /_snapshot/my_backup
✗ Incorrect
PUT is used to create or update a snapshot repository.
Which repository type is used for storing snapshots on local disk?
As3
Bgcs
Cfs
Dazure
✗ Incorrect
'fs' stands for file system, used for local disk storage.
Can you restore a snapshot to a running Elasticsearch cluster?
AYes, cluster can be running
BNo, cluster must be stopped
COnly if cluster is in read-only mode
DOnly during off-peak hours
✗ Incorrect
Snapshots can be restored while the cluster is running.
What does a snapshot include?
AIndex data and cluster metadata
BOnly index data
COnly cluster settings
DOnly node configurations
✗ Incorrect
Snapshots include both index data and cluster metadata.
Which API call starts a snapshot creation?
APOST /_snapshot/my_backup/snapshot_1/_create
BPUT /_snapshot/my_backup/snapshot_1
CPOST /_snapshot/my_backup/snapshot_1/_restore
DGET /_snapshot/my_backup/snapshot_1
✗ Incorrect
PUT is used to create a snapshot with a given name.
Explain the process of creating and restoring a snapshot in Elasticsearch.
Think about backup and recovery steps.
You got /4 concepts.
Why is snapshot and restore important for Elasticsearch clusters?
Consider real-life data safety and availability.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of taking a snapshot in Elasticsearch?
easy
A. To save a backup of your data for recovery later
B. To speed up search queries
C. To delete old indexes automatically
D. To create new indexes from templates
Solution
Step 1: Understand snapshot purpose
A snapshot in Elasticsearch is used to save a backup of your data at a point in time.
Step 2: Compare options
Options B, C, and D describe other Elasticsearch features, not snapshot backup.
Final Answer:
To save a backup of your data for recovery later -> Option A
Quick Check:
Snapshot = Backup [OK]
Hint: Snapshots save data backups for recovery [OK]
Common Mistakes:
Confusing snapshots with index templates
Thinking snapshots speed up searches
Assuming snapshots delete data
2. Which of the following is the correct syntax to create a snapshot repository in Elasticsearch?
easy
A. POST /_snapshot/my_backup {"type": "fs", "settings": {"location": "/mount/backups"}}
B. PUT /_snapshot/my_backup {"type": "fs", "settings": {"location": "/mount/backups"}}
C. GET /_snapshot/my_backup {"type": "fs", "settings": {"location": "/mount/backups"}}
D. DELETE /_snapshot/my_backup {"type": "fs", "settings": {"location": "/mount/backups"}}
Solution
Step 1: Identify correct HTTP method for creating repository
Creating a snapshot repository uses the PUT method to define or update it.
Step 2: Check other methods
POST is for creating snapshots, GET is for retrieving info, DELETE is for removing repositories.
Final Answer:
PUT /_snapshot/my_backup {"type": "fs", "settings": {"location": "/mount/backups"}} -> Option B
Quick Check:
Repository creation = PUT [OK]
Hint: Use PUT to create or update snapshot repositories [OK]
Common Mistakes:
Using POST instead of PUT for repository creation
Confusing GET with creation commands
Trying to delete instead of create repository
3. Given this snapshot restore request:
POST /_snapshot/my_backup/snapshot_1/_restore
{
"indices": "index1,index2",
"rename_pattern": "index(.*)",
"rename_replacement": "restored_index$1"
}
What will be the name of the restored index originally named index2?
medium
A. restored_index2
B. restored_index_index2
C. index2
D. index_restored2
Solution
Step 1: Understand rename_pattern and rename_replacement
The pattern "index(.*)" captures the part after "index". The replacement "restored_index$1" adds "restored_index" plus the captured part.
Step 2: Apply to index2
For "index2", the captured part is "2", so the new name is "restored_index2".
Hint: Captured group $1 appends after renamed prefix [OK]
Common Mistakes:
Ignoring rename_pattern and keeping original name
Adding extra 'index' in the replacement
Misplacing the captured group in new name
4. You try to restore a snapshot but get an error: repository_missing_exception. What is the most likely cause?
medium
A. The snapshot name is incorrect
B. The cluster is running an incompatible Elasticsearch version
C. The snapshot repository does not exist or is not registered
D. The indices in the snapshot are corrupted
Solution
Step 1: Understand repository_missing_exception meaning
This error means Elasticsearch cannot find the snapshot repository to access snapshots.
Step 2: Check other options
Snapshot name errors cause different exceptions; corrupted indices cause restore failures but not repository missing; version mismatch causes other errors.
Final Answer:
The snapshot repository does not exist or is not registered -> Option C
Hint: Check repository registration if repository_missing_exception occurs [OK]
Common Mistakes:
Assuming snapshot name typo causes repository_missing_exception
Blaming corrupted indices for repository errors
Ignoring repository setup before restore
5. You want to restore only specific indexes from a snapshot but rename them to avoid conflicts. Which JSON snippet correctly does this during restore?