Challenge - 5 Problems
Shard Allocation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the effect of this shard allocation awareness setting?
Given this Elasticsearch cluster setting, what will be the output of
GET _cluster/settings?include_defaults=true regarding awareness attributes?Elasticsearch
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.awareness.attributes": "rack_id"
}
}Attempts:
2 left
💡 Hint
Think about what shard allocation awareness does with the specified attribute.
✗ Incorrect
Setting cluster.routing.allocation.awareness.attributes to rack_id tells Elasticsearch to spread shards across nodes with different rack_id values to improve fault tolerance.
🧠 Conceptual
intermediate2:00remaining
What happens if a node lacks the awareness attribute?
In an Elasticsearch cluster with shard allocation awareness set to
zone, what happens if a node does not have the zone attribute configured?Attempts:
2 left
💡 Hint
Consider how awareness attributes control shard distribution.
✗ Incorrect
Nodes without the configured awareness attribute are excluded from shard allocation to ensure shards are spread across distinct attribute values.
❓ Predict Output
advanced2:00remaining
What is the output of this shard allocation command?
What will be the output of this command in an Elasticsearch cluster with awareness attribute
rack set, when trying to allocate a shard to a node without the rack attribute?Elasticsearch
POST /_cluster/reroute
{
"commands": [
{
"allocate": {
"index": "my_index",
"shard": 0,
"node": "node_without_rack",
"allow_primary": true
}
}
]
}Attempts:
2 left
💡 Hint
Think about how awareness attributes restrict shard allocation.
✗ Incorrect
Elasticsearch prevents allocating shards to nodes missing the required awareness attribute to maintain balanced distribution.
🧠 Conceptual
advanced2:00remaining
How does forced awareness affect shard allocation?
If
cluster.routing.allocation.awareness.force.zone.values is set to ["zone1", "zone2"], what is the effect on shard allocation?Attempts:
2 left
💡 Hint
Forced awareness restricts allocation to specified attribute values.
✗ Incorrect
Forced awareness limits shard allocation strictly to the listed attribute values, ignoring nodes outside those values.
❓ Predict Output
expert3:00remaining
What is the number of shards allocated after these settings?
Given a cluster with 3 nodes having rack attributes: node1 (rack: a), node2 (rack: b), node3 (rack: a), and an index with 3 primary shards and 1 replica each, with awareness attribute set to
rack, how many shards will be allocated on node3?Elasticsearch
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.awareness.attributes": "rack"
}
}
PUT my_index
{
"settings": {
"number_of_shards": 3,
"number_of_replicas": 1
}
}Attempts:
2 left
💡 Hint
Consider how replicas are allocated across different rack values.
✗ Incorrect
Since node1 and node3 share the same rack 'a', replicas cannot be allocated on the same rack as primaries. Node3 will only get replicas for shards whose primaries are on rack 'b'.