0
0
Elasticsearchquery~20 mins

Cluster, node, and shard architecture in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Elasticsearch Cluster Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this Elasticsearch cluster health API call?

Consider an Elasticsearch cluster with 3 nodes and 5 primary shards per index. You run the following API call:

GET /_cluster/health

What key value will the status field most likely show if all nodes and shards are functioning correctly?

Elasticsearch
GET /_cluster/health
A"status": "green"
B"status": "blue"
C"status": "red"
D"status": "yellow"
Attempts:
2 left
💡 Hint

Think about what the cluster health colors mean in Elasticsearch.

🧠 Conceptual
intermediate
2:00remaining
How many shards will an index have if it is created with 4 primary shards and 2 replicas?

You create an index in Elasticsearch with 4 primary shards and set the number of replicas to 2. How many total shards will this index have?

A8
B6
C4
D12
Attempts:
2 left
💡 Hint

Remember that replicas are copies of primary shards.

🔧 Debug
advanced
2:00remaining
Identify the error in this node allocation setting

Given the following Elasticsearch node setting snippet, what error will occur when starting the node?

node.attr.zone: us-east-1a
node.attr.zone: us-east-1b
ARuntimeError: Invalid zone attribute value
BNode will start normally with zone set to 'us-east-1b'
CSyntaxError: Duplicate key 'node.attr.zone' in configuration
DWarning: Multiple zones assigned, node will be assigned to first zone
Attempts:
2 left
💡 Hint

Check if the same key is repeated in the configuration file.

Predict Output
advanced
2:00remaining
What is the output of this shard allocation filtering query?

Assume you have a cluster with nodes tagged by zone attribute. You run this allocation filtering query:

GET /_cluster/allocation/explain
{
  "index": "myindex",
  "shard": 0,
  "primary": true
}

The node has node.attr.zone: us-west-2a but the index has allocation filtering set to include.zone: us-east-1a. What will the explanation say about shard allocation?

AShard cannot be allocated to node because node zone 'us-west-2a' is excluded by allocation filtering
BShard allocation failed due to missing primary shard
CShard allocation delayed due to node overload
DShard allocated successfully to node in zone 'us-west-2a'
Attempts:
2 left
💡 Hint

Think about how allocation filtering works with node attributes.

🧠 Conceptual
expert
2:00remaining
How does Elasticsearch handle shard rebalancing when a new node joins the cluster?

When a new node joins an Elasticsearch cluster, how does the cluster decide to rebalance shards across nodes?

AShards remain on original nodes until manually moved by the administrator
BElasticsearch automatically moves shards to the new node to balance disk usage and shard count
CNew shards are created on the new node but existing shards stay put
DThe cluster shuts down and restarts to redistribute shards evenly
Attempts:
2 left
💡 Hint

Consider Elasticsearch's automatic cluster management features.