Challenge - 5 Problems
Replica Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Elasticsearch replica setting query?
Given the following request to update the number of replicas for an index, what will be the number of replicas after the update?
Elasticsearch
PUT /my-index/_settings
{
"index" : {
"number_of_replicas" : 2
}
}Attempts:
2 left
💡 Hint
The number_of_replicas setting controls how many copies of each shard exist besides the primary.
✗ Incorrect
The PUT request sets the number_of_replicas to 2, so each primary shard will have 2 replica shards.
❓ Predict Output
intermediate2:00remaining
What happens if you set number_of_replicas to 0?
Consider this request to update an index's replica count:
PUT /logs/_settings
{
"index": {
"number_of_replicas": 0
}
}
What is the effect on the index?
Elasticsearch
PUT /logs/_settings
{
"index": {
"number_of_replicas": 0
}
}Attempts:
2 left
💡 Hint
Replicas provide copies of data for fault tolerance. Zero means no copies.
✗ Incorrect
Setting number_of_replicas to 0 means the index will have only primary shards and no replicas.
❓ Predict Output
advanced2:00remaining
What error does this replica setting update cause?
What error will this request produce?
PUT /data/_settings
{
"index": {
"number_of_replicas": -1
}
}
Elasticsearch
PUT /data/_settings
{
"index": {
"number_of_replicas": -1
}
}Attempts:
2 left
💡 Hint
Replica count cannot be negative.
✗ Incorrect
Elasticsearch validates that number_of_replicas is zero or positive. Negative values cause a 400 error.
🧠 Conceptual
advanced2:00remaining
How does replica count affect search availability during node failure?
If an Elasticsearch cluster has 1 replica per shard and one data node fails, what happens to search availability for the shards on that node?
Attempts:
2 left
💡 Hint
Replicas provide copies that can serve search requests if primaries fail.
✗ Incorrect
With replicas, if a node holding primary shards fails, the replicas on other nodes serve search requests, keeping availability.
❓ Predict Output
expert3:00remaining
What is the number of shards and replicas after this index creation?
Given this index creation request, how many total shards (primary + replicas) will the index have?
PUT /analytics
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 2
}
}
Elasticsearch
PUT /analytics
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 2
}
}Attempts:
2 left
💡 Hint
Total shards = primary shards + (primary shards × number_of_replicas).
✗ Incorrect
With 3 primary shards and 2 replicas each, total shards = 3 + (3×2) = 9.